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.document.getElementById("totalpaitnsh").value = parseFloat(window.opener.document.getElementById("totalpaitnsh").value) + parseFloat(window.opener.document.getElementById("pricea").value)
			var totalpaintmostx = parseFloat(window.opener.document.getElementById("totalpaitnsh").value);
			window.opener.document.getElementById("textpintshop").innerHTML = "Total USD $ " + totalpaintmostx.toFixed(2);
			
			var supertotalmostrar = parseFloat(window.opener.document.getElementById("latoptotal").value) + parseFloat(window.opener.document.getElementById("totalpaitnsh").value);
			
			
			
			window.opener.document.getElementById("supertotalpaint").innerHTML = "Gran total USD $ " + supertotalmostrar.toFixed(2);
		}


















	
	window.close();
}

function uploadImgAccept(que)
{
if(que == 1)
{
		window.opener.document.frnNvous.accept.value = 1;
		window.close();
}else{
		window.opener.document.frnNvous.accept.value = 0;	
		window.opener.document.frnNvous.attacho1.value = "";
		window.opener.document.frnNvous.attacho12.value = "";
		window.opener.document.frnNvous.attacho13.value = "";
		window.opener.document.frnNvous.attacho14.value = "";
		
		window.opener.document.getElementById("1").value = "0";
		window.opener.document.getElementById("2").value = "0";
		window.opener.document.getElementById("3").value = "0";
		window.opener.document.getElementById("4").value = "0";
		window.close();
	}


	
	return false;
}
function News(cual)
{
if(cual == 1)
	document.getElementById("newsp").innerHTML = "<br><strong class='Titulos_sum_yellow'>STEP 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br><br><strong>A.Panel: Outside Surface</strong><br>  <span class='botones_panel'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select color (solid or metallic). </span> <br><br>You may also add your own artwork (upload it in the File Upload section and use the comment box to describe your design to us). <br>Or select one of our Pre-Existing Designs. <br>When you're satisfied with your selection continue to B.Panel.";


if(cual == 2)
	document.getElementById("newsp").innerHTML = "<br><strong class='Titulos_sum_yellow'>STEP 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br><br><strong>B.Panel: Screen Surface</strong><br> <span class='botones_panel'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select color (solid or metallic). </span> <br><br>You may also add your own artwork (upload it in the File Upload section and use the comment box to describe your design to us). <br>When you're satisfied with your selection continue to C.Panel.";


if(cual == 3)
	document.getElementById("newsp").innerHTML = "<br><strong class='Titulos_sum_yellow'>STEP 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br><br><strong>C.Panel: Keyboard Surface</strong><br> <span class='botones_panel'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select color (solid or metallic). </span> <br><br>You may also add your own artwork (upload it in the File Upload section and use the comment box to describe your design to us). <br>When you're satisfied with your selection continue to D.Panel.";

if(cual == 4)
	document.getElementById("newsp").innerHTML = "<br><strong class='Titulos_sum_yellow'>STEP 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><br><br><strong>D.Panel: Bottom Surface </strong><br> <span class='botones_panel'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select color (solid or metallic). </span> <br><br>You may also add your own artwork (upload it in the File Upload section and use the comment box to describe your design to us). <br>Or select one of our Pre-Existing Designs.<br>Upon completion of your order, our designers will contact you with a preview of your desing for final approval.";






}














function fixPNG2(imgIDx,imgTitlex,imagenxx,donde) 
{
	var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])   
   if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
		
       var imgID 	= "id='" + imgIDx + "' "
	   var imgName	= "name='" + imgIDx + "' "
	   var imgTitle = "title='" + imgTitlex  + "' " 
	   var strNewHTML = "<span " + imgID + imgName +  imgTitle
                  + " style=\"" + "width:398"
                  + "px; height:150"
                  + "px;display:inline-block;"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=http://esneider/nvouspc/adminsite/img/colors_palete/" + imagenxx + "\', sizingMethod='scale');\"></span>"
				  
		  
				  
		//alert(strNewHTML);
		//alert(document.getElementById("shoesx1").innerHTML);
		//alert(strNewHTML);	 
		document.getElementById(donde).innerHTML = strNewHTML
		//alert(document.getElementById("shoesx1").innerHTML);
	  return true;
    }
}

function fixPNG(myImage) 
{
var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {

//alert(myImage.width);
		
       var imgID 	= (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgName	= (myImage.name) ? "name='" + myImage.name + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgName + imgClass + imgTitle
                  + " style=\"" + "width:398" 
                  + "px; height:150" 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
				  
		  
			//alert(strNewHTML);	  
				  
	   myImage.outerHTML = strNewHTML	  
    }
}



function changetxt()
{
	//alert(document.getElementById("commentbox").value)
	if(document.getElementById("commentbox").value == "Use this comment box to further describe the placement or concept of your uploaded image, or to describe your desired paintjob in general")
	{
			document.getElementById("commentbox").value = "";
			return false;
	}
	
}