	function DOM(n) {return 'document.getElementById("'+n+'")'}	var nd=0;	/* function iclear(n)	{		if (nd<2) {		nd++;		id = 'i'+ n;		eval(DOM(id)+'.value=""');}	} */	function pwin(hr)	{		popupWin=window.open(hr, '', 'width=600,height=630,location=no,resizable=yes,menubar=no,status=yes,toolbar=no,scrollbars=yes,top=150,left=40');		popupWin.focus();	}	function showhide(theId, divID) 	{		var el = document.getElementById(divID+'-'+ theId);		if (el.style.display=='none') 		{			el.style.display='';		}		else 		{			el.style.display='none';		}		return false;	}	function AddToCart(productid,mnum,cnum)	{		cartquantity++;		var gen_quan_id = 'cart_quantity_general';			var quantity = parseInt(eval(DOM(gen_quan_id)+'.value'));		var quan_id = 'cart_quantity';				quantity += 1;		eval(DOM(quan_id)+'.innerHTML=quantity'); 		eval(DOM(gen_quan_id)+'.value=quantity'); 						var gen_summ_id = 'cart_summary_general';			var summary = parseInt(eval(DOM(gen_summ_id)+'.value'));		var prod_summ_id = 'prod_summ';			var prod_summary = parseInt(eval(DOM(prod_summ_id)+'.value'));				var summ_id = 'cart_summary';				summary += prod_summary;		eval(DOM(summ_id)+'.innerHTML=summary'); 		eval(DOM(gen_summ_id)+'.value=summary'); 				var myConn1 = new XHConn();			if (!myConn1) alert("XMLHTTP not available. Try a newer/better browser.");				var fnWhenDone1 = function (oXML)		{			var id='addtocart'+productid;			eval(DOM(id)+'.innerHTML="В&nbsp;корзине"');		};		myConn1.connect("../modules/addtocart.php", "POST", "id="+productid+"&product_summ="+summary+"&cartquantity="+cartquantity+"&product=1", fnWhenDone1); 						for (var i = 0; i < mnum; i++) { //// set cookie for colors	    	var colorstype = [ "frontage", "body", "fabric" ];					for (var i=0; i<colorstype.length; i++) {//// поиск выбранных цветов и вычисление наценки				if (document.getElementById('colors_total['+colorstype[i]+']')) 	{					var colorsnum =  parseInt(document.getElementById('colors_total['+colorstype[i]+']').value);													if (document.getElementsByName(colorstype[i])) 	{						var group_color = document.getElementsByName(colorstype[i]); 						for (k=0; k< group_color.length; k++) {							if (group_color[k].checked == true) {															var colorid = group_color[k].value;																var myConncolor= new XHConn();									var fnWhenDonecolor = function (oXML)								{			};								if (!myConncolor) alert("XMLHTTP not available. Try a newer/better browser.");								myConncolor.connect("../modules/addtocart.php", "POST", "id="+productid+"&colorid="+colorid+"&colortype="+colorstype[i]+"&cartquantity="+cartquantity+"&colors=1", fnWhenDonecolor);																		break;														}						} 					}				}							}			    }  			for (var m = 0; m < mnum; m++) { //// set cookie for modules	    		    	module_id = parseInt(document.getElementById('mod_id'+m).value);			module_quantity = parseInt(document.getElementById('QUANT'+m).value);			// module_summ = parseInt(document.getElementById('PRICE'+m).value));									var myConnmodule = new XHConn();				var fnWhenDonemodule = function (oXML)			{			};						if (!myConnmodule) alert("XMLHTTP not available. Try a newer/better browser.");					myConnmodule.connect("../modules/addtocart.php", "POST", "id="+productid+"&moduleid="+module_id+"&modquan="+module_quantity+"&cartquantity="+cartquantity+"&module=1", fnWhenDonemodule);	    }		 	}				function chkrad(bam)	{		if (document.all) 		{			if (bam == 1) {Company.style.display = "none"; Person.style.display = "inline"}			else {Person.style.display = "none"; Company.style.display = "inline"}		} 		else 		{			if (bam == 1) {document.getElementById("Company").style.display = "none";document.getElementById("Person").style.display = "inline"}			else {document.getElementById("Person").style.display = "none";document.getElementById("Company").style.display = "inline"}		}	}			function setProp(tp,val,nm,cnt,img)	{		for (var i = 0; i < cnt; i++) { //// unselect colors	    	if (document.getElementById(tp+i)) {	    		document.getElementById(tp+i).style.border='2px solid #fff';	   		}	    }	    if (document.getElementById(tp+nm)) { ////select color	    	document.getElementById(tp+nm).style.border='2px solid #ccc';	  	}		if (document.getElementById('colorprice['+tp+']['+nm+']')) {			calcSumm('');	  	}		if (document.getElementById(tp+'I')) {	    	document.getElementById(tp+'I').src=img;////small image to full product description	  	}	    if (document.getElementById(tp)) {	    	document.getElementById(tp).value=val;	    }	    if (document.getElementById(tp+'V')) {	    	document.getElementById(tp+'V').innerHTML=val;				    }			}					function calcSumm(mod_num)	{		if (document.getElementById('QUANT'+mod_num)) { //// if empty quantity of module - set to 0			var quan = parseInt(document.getElementById('QUANT'+mod_num).value);			if (quan == '')	{				document.getElementById('QUANT'+mod_num).value = 0;			}				}						var cols = 0;		var summ = 0;		var addsumm = 0;		var colorstype = [ "frontage", "body", "fabric" ];				for (var i=0; i<colorstype.length; i++) {//// поиск выбранных цветов и вычисление наценки			if (document.getElementById('colors_total['+colorstype[i]+']')) 	{				var colorsnum =  parseInt(document.getElementById('colors_total['+colorstype[i]+']').value);										if (document.getElementsByName(colorstype[i])) 	{					var group_color = document.getElementsByName(colorstype[i]); 					for (k=0; k< group_color.length; k++) {						if (group_color[k].checked == true) {														var select_color_id = group_color[k].value;														var select_color = (document.getElementById('colornumber['+select_color_id+']')).value;							if (document.getElementById('colorprice['+colorstype[i]+']['+select_color+']')) {								addsumm += parseInt(document.getElementById('colorprice['+colorstype[i]+']['+select_color+']').value);							}												break;													}					} 				}			}					}				if (document.getElementById('items_total'))	{	var cnt =  parseInt(document.getElementById('items_total').value);					for (var i = 0; i < cnt; i++) {				cols += parseInt(document.getElementById('QUANT'+i).value);								document.getElementById('mod'+i).style.display = 'block';				document.getElementById('mod_quan'+i).innerHTML = parseInt(document.getElementById('QUANT'+i).value);								summ += (parseInt(document.getElementById('QUANT'+i).value) * parseInt(document.getElementById('PRICE'+i).value));						}		}		else if ( document.getElementById('prod_summ'))	summ += parseInt(document.getElementById('prod_summ').value);				summ += addsumm;	    if ( document.getElementById('COLS'))	 document.getElementById('COLS').innerHTML = cols;				if ( document.getElementById('sale_value'))	 {			var salevalue = parseFloat(document.getElementById('sale_value').value);						var salesumm = Math.ceil(summ*salevalue);			if ( document.getElementById('SUMM_SALE'))	 document.getElementById('SUMM_SALE').innerHTML = salesumm;			if ( document.getElementById('prod_summ_sale'))	 document.getElementById('prod_summ_sale').value = salesumm;		}			    if ( document.getElementById('SUMM'))	 document.getElementById('SUMM').innerHTML = summ;		 if ( document.getElementById('prod_summ'))	 document.getElementById('prod_summ').value = summ;				for (var i = 0; i < cnt; i++) {	    	if (parseInt(document.getElementById('QUANT'+i).value) == 0)	{				document.getElementById('mod'+i).style.display = 'none';							}				    }	}						function QuanChange(n,nm,cnt)	{		var quan = parseInt(document.getElementById('QUANT'+nm).value);						if (n == 'up')  quan += 1;					else if (n == 'down')  	{			if (quan>0) quan -= 1;		}				document.getElementById('QUANT'+nm).value = quan;				var mod_disp = document.getElementById('mod'+nm).style.display;				document.getElementById('mod'+nm).style.display = 'block';		document.getElementById('mod_quan'+nm).innerHTML = quan;					}					function SetToZero(cnt)	{				var cols = 0;		var summ = 0;				for (var i = 0; i < cnt; i++) {						document.getElementById('mod_quan'+i).innerHTML = 0;			document.getElementById('QUANT'+i).value = 0;				    }	    if ( document.getElementById('COLS'))	 document.getElementById('COLS').innerHTML = 0;	    if ( document.getElementById('SUMM'))	 document.getElementById('SUMM').innerHTML = 0;		if ( document.getElementById('prod_summ'))	 document.getElementById('prod_summ').value = 0;						if ( document.getElementById('sale_value'))	 {					if ( document.getElementById('SUMM_SALE'))	 document.getElementById('SUMM_SALE').innerHTML = 0;			if ( document.getElementById('prod_summ_sale'))	 document.getElementById('prod_summ_sale').value = 0;		}				for (var i = 0; i < cnt; i++) {	    	if (parseInt(document.getElementById('QUANT'+i).value) == 0)	{				document.getElementById('mod'+i).style.display = 'none';							}				    }	}		function DisablePrice(mode)	{						if (document.getElementById('TotalSummary'))	{						if (mode=='off') document.getElementById('TotalSummary').style.display = 'block';			else if (mode=='on') document.getElementById('TotalSummary').style.display = 'none';		}				if (document.getElementById('PersonalColors'))	{						if (mode=='off') document.getElementById('PersonalColors').style.display = 'none';			else if (mode=='on') document.getElementById('PersonalColors').style.display = 'block';		}			}			function SetToDefault(m,c)	{				var cols = 0;		var summ = 0;				for (var i = 0; i < m; i++) {				if (document.getElementById('QUANT_DEF'+i).value)	{				cols += parseInt(document.getElementById('QUANT_DEF'+i).value);			   	summ += (parseInt(document.getElementById('QUANT_DEF'+i).value) * parseInt(document.getElementById('PRICE'+i).value));				document.getElementById('mod_quan'+i).innerHTML = parseInt(document.getElementById('QUANT_DEF'+i).value);				document.getElementById('QUANT'+i).value = parseInt(document.getElementById('QUANT_DEF'+i).value);			}			else 	{				document.getElementById('mod_quan'+i).innerHTML = 0;				document.getElementById('QUANT'+i).value = 0;			}	    }					    document.getElementById('COLS').innerHTML = cols;	    document.getElementById('SUMM').innerHTML = summ;		document.getElementById('prod_summ').value = summ;				for (var i = 0; i < c; i++) {			if (document.getElementById('acd'+i))	{				document.getElementById('acd'+i).onclick();			}		}				calcSumm(m); 		}		function setFormAction(formId, actionPath) {				document.formId.action = actionPath;		return true; 	}		function preSubmit(formId)	{		st = eval(DOM(formId));		st.submit();	}			/* //////////////////////////////////////////////////////////// */			$(document).ready(function(){		if (($(window).width()>=1244) && ($("#popular").width()==239)) {			$("#popular").width(488);			$("#img_1, #img_3, .br2").show();		} else {			$("#img_1, #img_3, .br2").hide();		};				$(window).resize(function(){			if (($(window).width()>=1244) && ($("#popular").width()==239)) {				$("#popular").hide().width(488).show();				$("#img_1, #img_3, .br2").show();			} else if (($(window).width()<=1244) && ($("#popular").width()==488)) {				$("#popular").hide().width(239).show();				$("#img_1, #img_3, .br2").hide();			};		});						$("#manager .avatar").attr("src","modules/online/ava.php?id="+$("select#manager_select").val());				$("#manager_select").change(function(){			var select_val = $("select#manager_select").val();			$("#manager .avatar").attr("src","modules/online/ava.php?id="+select_val);			/* online_get("manager=1&user_id="+$("#user_id").val()+"&manager_id="+select_val);			$("html").delay(50000); 			location.reload(); */			$("#manager_form").submit();		});			});	function online_fck() {		//if ($("#message").length()) {			var sBasePath = '/admmod/includes/fckeditor/' ;			var oFCKeditor = new FCKeditor( 'message' ) ;			//oFCKeditor.Width = 420 ;			oFCKeditor.Height = 150 ;			oFCKeditor.BasePath	= sBasePath ;			oFCKeditor.ToolbarSet = 'Basic' ;			oFCKeditor.ReplaceTextarea() ;		//}	}			function online_send(div,params) {				var user_id = $("#user_id").val();		var to_id = $("select#manager_select").val();				$("#"+div).load('modules/online/ajax.php?'+params+'&id='+user_id+'&to='+to_id, {}, function() { online_fck(); });		//return false;	}		function online_send2(div,params) {				var user_id = $("#user_id").val();		var to_id = $("select#manager_select").val();				$("#"+div).load('modules/online/ajax.php?'+params+'&id='+user_id+'&to='+to_id);	}		function online_get(params) {		$.get('modules/online/ajax.php?'+params); //alert('Запрос выполнен');		//return false;	}	
