// JavaScript Document
function validateSign20(theForm) { // Sends in the 4 x 8 sign
	
		// SET PRICING TABLE VALUES
		var signArray = new Array(10);
		for ( var i=0; i <= 10; i++ )
		  signArray[i] = new Array(10);
		
    var mapArray = new Array(3);
		for ( var i=0; i <= 3; i++ )
		  mapArray[i] = new Array(4);
		var signQty;
		var strPartno;
		var intRow=0, intColumn=3, intMapRow=0;intMapColumn=0;
		
		signArray[0][0] = 80.00;
		signArray[0][1] = 175.00;
		signArray[0][2] = 225.00;
		
		// POPULATE ARRAY FOR MAP/PHOTO
		// NO PHOTO MAP
		mapArray[0][0] = 0;
		mapArray[0][1] = 35;
		mapArray[0][2] = 75;

		// CHECK WHAT WAS CHOSEN, SET PRICE ACCORDINGLY BY QTY
		if(document.getElementById('corex').checked==true)
		{
			intRow = 0; intColumn = 0;
		}
		else if(document.getElementById('plywood').checked==true)
		{
			intRow = 0; intColumn = 1;
		}
		else if(document.getElementById('plastic').checked==true)
		{	
			intRow = 0; intColumn = 2;
		}
		else
		{
		//alert("Not yet setup");
		event.returnValue=false;
		}
		switch (theForm.p4.value) {
			case "No Photo/Map" :
				intMapRow = 0;intMapColumn=0;
			break;
			case "Personal Photo" :
				intMapRow = 0;intMapColumn=1;
			break;
			case "Map or Property Photo" :
				intMapRow = 0;intMapColumn=2;
			break;
		}
			theForm.t1.value ="d-Sign Type;"+theForm.p1.value+":partno="+strPartno+",price=+"+signArray[intRow][intColumn];
			theForm.t4.value = "d-Photo/Map;"+theForm.p4.value+":price=+"+mapArray[intMapRow][intMapColumn];
		
	}
window.onload=function()
{ 	 
	
	delivery();
	pageload();
}
function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
 {
         theText.value = ""
     }
 }
 function SelectedColor1(SColor, SerialNoColor)
{
    var SelColor;   
    var SNoColor;
    var len;
    var i;
    var CurSNo;
    var z;
    z=0;
	var x=0;
	x=document.getElementById("cpno").value;
	var txt=new Array();
	txt[1]="txt1";txt[2]="txt2";txt[3]="txt3";txt[4]="txt4";txt[5]="txt5";
	txt[6]="txt6";txt[7]="txt7";txt[8]="txt8";txt[9]="txt9";
        SelColor = document.getElementById(txt[x]).value;
        SNoColor = SerialNoColor;
        if((SelColor == "") || (SelColor == null))
        {
        SelColor = SColor;
        }
        else
        {
        SelColor = SelColor + "," + SColor;
        SNoColor = SNoColor + document.getElementById("temptext").value;
        }
        len = SNoColor.length;
        
        for(i=1; i<=len;i++)
        {
            CurSNo = SNoColor.substr(i,1);
            if(SerialNoColor == CurSNo)
            {
                alert("This color has already been selected.");
                z=1;
            }
        
        }
        
    
    if(z==0)
    {
    document.getElementById('temptext').value=SNoColor;
    document.getElementById(txt[x]).value = SelColor;
    }
}
function mypopups(popname, popheight, popwidth, ptop, pleft)
{
mypop = document.getElementById('pop32');
mypop.style.visibility='visible';
mypop.src=popname;
mypop.style.height=popheight;
mypop.style.width=popwidth;
mypop.style.top=ptop;
mypop.style.marginLeft=pleft;
}
function closeIframe() {
   document.getElementById('pop32').style.visibility='hidden';
   }

function delivery()
{
	
	for (i=0;i<document.myform1.p8.length;i++) 
	{ 
      if (document.myform1.p8[i].checked) 
      { 
          if(document.myform1.p8[i].value=="Shipping (not included in total)") 		  
		  document.myform1.p9.disabled=false;
		  else
		  document.myform1.p9.disabled=true;
      } 
	}
	
	if(document.getElementById('corex').checked==true)
		{document.myform1.p1.value='Corex Economy A-frame 36x24';
		 document.getElementById('sitepic').src='images2008/corexframe.jpg';}
		 
	else if(document.getElementById('plywood').checked==true)
	{document.myform1.p1.value='Plywood A-frame - 48x24';
		 document.getElementById('sitepic').src='images2008/wood-aframe.jpg';}
	else
	{document.myform1.p1.value='Signcade A-frame - 40x27';
		 document.getElementById('sitepic').src='images2008/signcadeframe.jpg';}
} 
function delivery1(){
	var date = new Date();
     document.myform1.p11.value = date.getTime();
for (z=0;z<document.myform1.p8.length;z++) 
	{ 
      if (document.myform1.p8[z].checked) 
      { 
		if(document.myform1.p8[z].value=="Shipping (not included in total)") {
			  if(document.myform1.p9.value==""){
			  alert('Please enter installation/shipping address'); 
			  document.myform1.p9.focus();
			  return false;}
			  else{alert('You will be contact with installation/shipping charge.\n'+'     '+' Charge will not be included in the cart total ');event.returnValue=true;}
		}
      } 
	}
}
function pageload()
{ Pageno=document.getElementById('pageno').value;
Page1=document.getElementById('page1');
Page2=document.getElementById('page2');
Page3=document.getElementById('page3');
if(Pageno==1){Page1.style.display='block';Page2.style.display='none';Page3.style.display='none';}
else if(Pageno==2){Page1.style.display='none';Page2.style.display='block';document.getElementById('mainpic').style.display='block';Page3.style.display='none';}
else{Page1.style.display='none';Page2.style.display='none';document.getElementById('mainpic').style.display='none';Page3.style.display='block';}
}
