	function chek_chng_pass()
	{		
		if (document.chng_pass.old.value=="")
		{
			alert("Please enter old password ...!");	
			document.chng_pass.old.focus();
			return false;			
		}

		if (document.chng_pass.newp.value=="")
		{
			alert("Please enter new password ...!");	
			document.chng_pass.newp.focus();
			return false;			
		}

		if (document.chng_pass.new2.value=="")
		{
			alert("Please confirm new password ...!");	
			document.chng_pass.new2.focus();
			return false;			
		}		
		

		if (document.chng_pass.new2.value!=document.chng_pass.newp.value)
		{
			alert("Both values for new password does not match ...!");	
			document.chng_pass.new2.focus();
			return false;			
		}				
		
	}




	function clear_field()
	{
		document.regist.R4.value="";
	}



	function validate_CC()
	{		
		if (document.CC_main.chfname.value=="")
		{			
		alert('Please enter first name as written on card...!')	
		document.CC_main.chfname.focus();
		return false;
		}

		if (document.CC_main.chfname.value.length<=2)
		{			
		alert('Name should not be so small...!')	
		document.CC_main.chfname.focus();
		document.CC_main.chfname.select();
		return false;
		}


		if (document.CC_main.chlname.value=="")
		{			
		alert('Please enter last name as written on card...!')	
		document.CC_main.chlname.focus();
		return false;
		}		

		if (document.CC_main.cardtype.value=="")
		{			
		alert('Please select card type...!')	
		document.CC_main.cardtype.focus();
		return false;
		}		

		if (document.CC_main.cardnumber.value=="")
		{			
		alert('Please enter card number ...!')	
		document.CC_main.cardnumber.focus();
		return false;
		}		

		if (document.CC_main.cardnumber.value.length<10)
		{			
		alert('Please enter correct card number. Length should be greater than 10 digits ...!')	
		document.CC_main.cardnumber.focus();
		document.CC_main.cardnumber.select();
		return false;
		}				

		if (isNaN(document.CC_main.cardnumber.value))
		{			
		alert('Please enter only numeric values ...!')	
		document.CC_main.cardnumber.focus();
		document.CC_main.cardnumber.select();
		return false;
		}						

		if (document.CC_main.cvno.value=="")
		{			
		alert('Please enter card verification number ...!')	
		document.CC_main.cvno.focus();
		return false;
		}				
	}
	




					function hide_county_else(c_id)
					{
					document.regist.submit();	
					}	






					function change_proof(x)
					{					
						if (x)
							{
						var a=x.split("+");					
							}
							else
								{
								var a=0;						
								}
						
						if (a[1]>0)
							{
						document.getElementById('pcostid').style.visibility="visible";
						document.getElementById('pcostid').style.display="";							
						document.ord.prof_cost.value=a[1];						
						
						pt=parseFloat(document.ord.pt.value)
						tax=parseFloat(document.ord.tTax.value)
						shp=parseFloat(document.ord.shpmnt.value)						
						
						pt=pt.toFixed(2)
						tax=tax.toFixed(2)
						shp=shp.toFixed(2)
						
						fin_val1=parseFloat(pt)+parseFloat(tax)+parseFloat(shp)+parseFloat(a[1]);						
						fin_val=fin_val1.toFixed(2)							
						document.ord.final.value=fin_val;
						
						mywin=window.open('proof_addr.php','','width=450,height=420,scrollbars=1,toolbars=0,resizeable=no');						
						mywin.moveTo(1,1);
						
							}
						else
						{
						document.getElementById('pcostid').style.visibility="hidden";
						document.getElementById('pcostid').style.display="none";							
						document.ord.prof_cost.value=0;						

						fin_val=parseFloat(document.ord.pt.value)+parseFloat(document.ord.tTax.value)+parseFloat(document.ord.shpmnt.value);
						fin_val=fin_val.toFixed(2)	
						document.ord.final.value=fin_val;
						
					}					
					
					}





function stopRKey(evt) { 
  var evt = (evt) ? evt : ((event) ? event : null); 
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); 

  if ((evt.keyCode == 13))  
  {
  	return getweight();
  	} 
} 

document.onkeypress = stopRKey; 




function chek_user(iid)
  				{  
  					var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        { 
        	 	if (xmlHttp.responseText==0)
        			{
								var obj=document.getElementById("nxt");        		
								obj.style.visibility="visible";
								obj.style.display="";
								var obj1=document.getElementById("usr12");								
								obj1.innerHTML="Username :"								        			
								obj1.style.color="#000000";
							}
							else
							{
								alert("Username already Exists...!")
        				var obj=document.getElementById("nxt");								
								obj.style.visibility="hidden";
								obj.style.display="none";		
								var obj1=document.getElementById("usr12");								
								obj1.innerHTML="Choose Another :"
								obj1.style.color="#EF1C25";
							}	
        
        }
      }		    
       
		var URL="chek_user.php";  
		URL=URL+"?q="+iid;  									
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);      
    }



				function show_card()
				{
					obj2=document.getElementById('resale');
					
					if (document.regist.resel_chk.checked==true)	
					{					
					obj2.style.visibility="visible";
					obj2.style.display="";													
					}
					else
					{
					obj2.style.visibility="hidden";
					obj2.style.display="none";												
						
					}
				
				}


				function show_addr1()
				{
					document.regist.R5.value=document.regist.T11.value;					
				}

				function show_addr11()
				{
					document.regist.R6.value=document.regist.city.value;					
				}
				

				function show_addr2(x)
				{	
					//st=document.regist.state.value.split("+");					
					//document.regist.R7.value=st[0];					
				}

				function show_addr3()
				{
					document.regist.R8.value=document.regist.T13.value;					
				}


				function chek_main_log()
				{
					if (document.log.usr.value=="")
						{
							alert("Enter username ....!")
							document.log.usr.focus();
							return false;
						}						
						
					
				}


function setCookie(name, value, expires, path, domain, secure) 
{	
	var date = new Date();
	date.setTime(date.getTime()+(3000*24*60*60*1000));
	
	var expires1 = "; expires="+date.toGMTString();
	
	document.cookie= name + "=" + escape(value) +
        expires1 +
        
        
        //((expires) ? "; expires=" + expires.toGMTString() : "") +
        //((expires) ? "; expires=Thu, 2 Aug 2020 20:47:11 UTC;" : ""  ) +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");}
        
        	
        	
function getCookie(name) 
{	
var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    logg.pass.value=unescape(dc.substring(begin + prefix.length, end));
}





      	
        	
function getCookie2(name) 
{	
var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    log.pass.value=unescape(dc.substring(begin + prefix.length, end));
}





				function chek_fpost()
				{
						document.getElementById('progress').style.visibility="visible";											
					
					if (document.fpost.filee1.value=="")
						{
							alert("Please Select File....")
							document.fpost.filee1.focus();
							return false;							
						}
						else
						{
						document.getElementById('progress').style.display='block';
						document.getElementById('progress').style.visibility='visible';							
						
						}
					
				}



				function valid_up()
				{
					
					if (document.up.T1.value=="")
						{
							alert("Enter order no.")
							document.up.T1.focus();
							return false;
						}

					if (document.up.T2.value=="")
						{
							alert("Enter order confirmation no.")
							document.up.T2.focus();
							return false;
						}						
					
					
				}



				function chek_shipping()
				{
					if(document.bill_ship.TT1.value=="")
						{
							alert("Enter Complete Shipping info....")
							document.bill_ship.TT1.focus();
							return false;
						}
						
						
					if(document.bill_ship.TT11.value=="")
						{
							alert("Please, enter complete shipping info....")
							document.bill_ship.TT11.focus();
							return false;
						}													

					if(document.bill_ship.TT14.value=="")
						{
							alert("Please, enter complete shipping info....")
							document.bill_ship.TT14.focus();
							return false;
						}																			
					
				}


				function copy_billing()
				{
						if (document.bill_ship.billing.checked==true)
							{
								
								document.bill_ship.TT1.value=document.bill_ship.T1.value;
								document.bill_ship.TT5.value=document.bill_ship.T5.value;
								document.bill_ship.TT10.value=document.bill_ship.T10.value;
								document.bill_ship.TT11.value=document.bill_ship.T11.value;
								document.bill_ship.TT12.value=document.bill_ship.T12.value;
								document.bill_ship.state2.value=document.bill_ship.state.value;
								document.bill_ship.TT13.value=document.bill_ship.T13.value;
								document.bill_ship.TT14.value=document.bill_ship.T14.value;
								document.bill_ship.TT15.value=document.bill_ship.T15.value;
								document.bill_ship.TT16.value=document.bill_ship.T16.value;
								document.bill_ship.city2.value=document.bill_ship.city.value;
								
							}
							else
							{
								document.bill_ship.TT1.value="";
								document.bill_ship.TT5.value="";
								document.bill_ship.TT10.value="";
								document.bill_ship.TT11.value="";
								document.bill_ship.TT12.value="";
								document.bill_ship.state2.value="";
								document.bill_ship.TT13.value="";
								document.bill_ship.TT14.value="";
								document.bill_ship.TT15.value="";
								document.bill_ship.TT16.value="";
								document.bill_ship.city2.value="";
							}	
					
					
				}



				function change_inr(mul)
				{
									
					if (document.calcu.sub_heads_qty)
					{
										//alert(document.calcu.sub_heads_qty.value)						
							var a=document.calcu.sub_heads_qty.value.split("+");					
							if (a.length>1)
								{
									dat1=a[0];
								}
								else
									{
										dat1=0;
									}
					
					}
					else
						{
									dat1=0;	
						}
						
						
					
					if (document.calcu.sub_heads_qty2)
					{
									//alert(document.calcu.sub_heads_qty2.value)
							var b=document.calcu.sub_heads_qty2.value.split("+");					
							if (b.length>1)
								{
									dat2=b[0];
								}
								else
									{
										dat2=0;
									}								
					}
					else
						{
										dat2=0;
						}
					
					
					
					
					if (document.calcu.sub_additional)
					{					
							var c=document.calcu.sub_additional.value.split("|");					
							if (c.length>1)
								{
									dat3=c[1]*mul;
								}				
								else
									{
										dat3=0;
									}									
					}
					else
						{
										dat3=0;
						}
					
					
					var gtot=parseInt(dat1)+parseInt(dat2)+parseInt(dat3);	
					gtot=gtot.toFixed(2)				
					document.getElementById('price').innerHTML=" $ "+gtot;      												
					
				}



				function show_input(xy)
				{
						obj=document.getElementById('inpt')
						obj1=document.getElementById('inpt1')

					if (xy)
					{						
						obj.style.visibility="visible"
						obj.style.display=""
						
						obj1.style.visibility="visible"
						obj1.style.display=""											
					}
					else
					{
						obj.style.visibility="hidden"
						obj.style.display="none"
						
						obj1.style.visibility="hidden"
						obj1.style.display="none"																							
					}	
					
				}



		function show_addition(yy)
		{						
 					var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        {         	    
        //document.getElementById('mn').style.display='none';	                       							
        //document.getElementById('txtHint').innerHTML=xmlHttp.responseText;                               
        				
        			if (xmlHttp.responseText!='')
        			{        				
									/*document.getElementById('sel3').style.visibility='visible';	                       							
    							document.getElementById('sel3').style.display='';   */ 							
    							
									//document.getElementById('add_qty').style.visibility='visible';	                       							
    							//document.getElementById('add_qty').style.display='';    							    							
    							
									//document.getElementById('add_qty1').style.visibility='visible';	                       							
    							//document.getElementById('add_qty1').style.display='';    							    							
    							    							
									document.getElementById('showadditional').innerHTML=xmlHttp.responseText;      
							}
							
        }}
      
      
    idg=yy.split("|")			 		
		var URL="show_additional.php";  
		URL=URL+"?id="+idg[0];  								
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);  
    
  }




	function show_county(x)
	{
		xx=x.split("+")
			if (xx[0]=="California")
			{
				//document.regist.R6.value="";
				//document.regist.R6.value=document.regist.R6.value+" "+xx[0];					
				obj1=document.getElementById('cnt2');
				//obj2=document.getElementById('resale');
				obj1.style.visibility="visible";
				obj1.style.display="";				
				//obj=document.getElementById('cnt1');
				//obj2.style.visibility="visible";
				//obj2.style.display="";								

				//obj.style.visibility="hidden";
				//obj.style.display="none";	
				
				st=document.regist.state.value.split("+");					
				document.regist.R7.value=st[0];																
			}
			else
			{
				//obj2=document.getElementById('resale');
				obj1=document.getElementById('cnt2');
				//obj=document.getElementById('cnt1');
				//obj.style.visibility="visible";
				//obj.style.display="";
				obj1.style.visibility="hidden";
				obj1.style.display="none";												
				//obj2.style.visibility="hidden";
				//obj2.style.display="none";		

				st=document.regist.state.value.split("+");					
				document.regist.R7.value=st[0];																			
			}
	}



	function show_ord_det(x)
	{
		win1=window.open('showorder.php?oid='+x,'','width=600,height=630,scrollbars=1,toolbars=0,resizeable=no');						
		win1.moveTo(0,0);
	}


	function show_ord_status(x)
	{
		win2=window.open('showorder_st.php?oid='+x,'','width=600,height=370,scrollbars=1,toolbars=0,resizeable=no');						
		win2.moveTo(0,100);
	}


	function formatNumberNew(x) 	
	{		
		mn=x.substr(0,1);
		if (mn!="(")
			{			
			var a = x.substr(0,3);			
			var b = x.substr(3,3);			
			var c = x.substr(6);			
			var phn="("+a+")"+" "+b+" "+c
			document.regist.T14.value=phn;
			}
				document.regist.R8.value=document.regist.T14.value;								
	}
	
function formatFaxNumber(x) 	
	{		
		mn=x.substr(0,1);
		if (mn!="(")
			{
			var a = x.substr(0,3);			
			var b = x.substr(3,3);			
			var c = x.substr(6);			
			var phn="("+a+")"+" "+b+" "+c
			document.regist.T16.value=phn;
		}
	}
	
				function cheklost()
				{
					if (document.lost.usr.value=="")
					{
						alert("Enter Username")
						document.lost.usr.focus();
						return false;
					}

					if (document.lost.eml.value=="")
					{
						alert("Enter Email ID")
						document.lost.eml.focus();
						return false;
					}
					
				}
				
				
				function show_inr_2(inr2)				
				{				
								
					
					if (inr2)
					{					
						//alert("Here-2--1")						
						
						aqt=document.calcu.sub_heads_qty.value.split("+");
						
									if (document.calcu.sub_heads_qty2)
									{
									aqt1=document.calcu.sub_heads_qty2.value.split("+");
									var bb=aqt1.length;
									}
									else
										{
											var bb=0;
										}	
														
						var aa=aqt.length;
						
						
						if (aa>1)
						{
							var str=document.calcu.sub_heads_qty.value;
						}
						else
						{
							var str=document.calcu.sub_heads_qty2.value;	
						}
												//alert(inr2)	
										prc1=inr2.split("|")
										prc2=str.split("+")		
										
										prc1=prc1[1]*document.calcu.inpt_m.value;																		
										prc=parseInt(prc1)+parseInt(prc2[0]);																				
							prc=prc.toFixed(2)				
							document.getElementById('price').innerHTML=" $ "+prc;      					
					}
					else
					{						
								//alert("Here-2--2")		

						aqt=document.calcu.sub_heads_qty.value.split("+");
						
								if (document.calcu.sub_heads_qty2)
									{
									aqt1=document.calcu.sub_heads_qty2.value.split("+");
									var bb=aqt1.length;
									}
									else
										{
											var bb=0;
										}	
						
						var aa=aqt.length;
						
						
						if (aa>1)
						{
							var str=document.calcu.sub_heads_qty.value;
						}
						else
						{
							var str=document.calcu.sub_heads_qty2.value;	
						}
												
							prc2=str.split("+")					
							prc=prc2[0];													  					
							document.getElementById('price').innerHTML=" $ "+prc;      												
					}
				}
				
				


				function show_inr(inr)
				{	
			  document.calcu.but1.disabled=false;									
			  document.esti.but2.disabled=false;						

									document.getElementById('add_qty').style.visibility='visible';	                       							
    							document.getElementById('add_qty').style.display='';    							    							
    							
									document.getElementById('add_qty1').style.visibility='visible';	                       							
    							document.getElementById('add_qty1').style.display='';    							    							
			  
			  
			  prc=inr.split("+")
			  
			  
			  if (document.calcu.sub_additional)
			  	{						
			  				if (document.calcu.sub_additional.value)
			  					{			  						
			  						rr=document.calcu.sub_additional.value;
			  						rr=rr.split("|")
			  						prc=parseInt(prc[0])+parseInt(rr[1]);													  					

			  					}
			  					else
			  					{
			  						prc=prc[0];	
			  					}
			  	}
			  	else
			  	{
			  	rr=0;	
			  	prc=prc[0];

								document.getElementById('add_qty').style.visibility='hidden';	                       							
    						document.getElementById('add_qty').style.display='none';    							    							
			  	}				  
				
				//prc=parseInt(prc[0])+parseInt(inr1[1]);							  
				document.getElementById('price').innerHTML=" $ "+prc;      					
				}







				function show_next_hd(xx)
 				{ 
 					var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        {         	    
        //document.getElementById('mn').style.display='none';	                       							
        //document.getElementById('txtHint').innerHTML=xmlHttp.responseText;                       
        			if (xmlHttp.responseText!='')
        			{
									/*document.getElementById('sel3').style.visibility='visible';	                       							
    							document.getElementById('sel3').style.display='';   */ 							
									document.getElementById('sel4').style.visibility='visible';	                       							
    							document.getElementById('sel4').style.display='';    							    							
									document.getElementById('showhere1').innerHTML=xmlHttp.responseText;      
							}
							
        }}
      
      
    
		var URL="show_sub_next.php";  
		URL=URL+"?id="+xx;  						
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);  
    
  }








				function show_qty(xx)
 				{ 
 					var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        {         	    
        //document.getElementById('mn').style.display='none';	                       							
        //document.getElementById('txtHint').innerHTML=xmlHttp.responseText;               
        
        			if (xmlHttp.responseText!='')
					document.getElementById('coating1').style.visibility='visible';	                       							
        				document.getElementById('coating2').style.visibility='visible';	                       							

					document.getElementById('coating1').style.display='';    							
					document.getElementById('coating2').style.display='';    							        				
					
							document.getElementById('sel5').style.visibility='visible';	                       							
    							document.getElementById('sel5').style.display='';    							
							document.getElementById('sel6').style.visibility='visible';	                       							
    							document.getElementById('sel6').style.display='';    							    							
							document.getElementById('showhere11').innerHTML=xmlHttp.responseText;      
							
							
							}
							
        }
      
      
    
		var URL="show_qty.php";  
		URL=URL+"?id="+xx;  															
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);  
    
  }










				function get_next_drop(x)
 				{ 
 					 var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        {         	    
        //document.getElementById('mn').style.display='none';	                       							
        //document.getElementById('txtHint').innerHTML=xmlHttp.responseText;               
        
        			if (xmlHttp.responseText!='')					
							document.getElementById('sel1').style.visibility='visible';	                       							
    							document.getElementById('sel1').style.display='';    							
							document.getElementById('sel2').style.visibility='visible';	                       							
    							document.getElementById('sel2').style.display='';    							    							
							document.getElementById('showhere').innerHTML=xmlHttp.responseText;      
					document.getElementById('coating1').style.visibility='visible';	                       							
        				document.getElementById('coating2').style.visibility='visible';	                       							

					document.getElementById('coating1').style.display='';    							
					document.getElementById('coating2').style.display='';    							        				        			
							
							}
							
        }
      
      
    
		var URL="show_sub.php";  
		URL=URL+"?id="+x;  											
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);  
    
  }




















function showupsval(x)
{	
	fprc=parseFloat(x/100*7);	
	ffpc=parseFloat(x)+parseFloat(fprc);	
	prc=ffpc.toFixed(2)	
	document.getElementById('showprice').innerHTML=" : "+" $ "+prc;      	
}


	function getweight()
	{		
		if (document.getElementById('upsT1').value=="")
		{
			alert("Enter ZIP Code....!")
			document.getElementById('upsT1').focus();
			return false;
		}
		
	if (isNaN(document.getElementById('upsT1').value))
		{
			alert("Enter Numeric Value Only....!")
			document.getElementById('upsT1').value="";
			document.getElementById('upsT1').focus();			
			return false;
		}
		
		document.getElementById('wtbut').disabled=true;
		
		document.getElementById('showimg').style.visibility='visible';	                       							
    		document.getElementById('showimg').style.display='';	                       							            		
		wt=document.calcu.sub_heads_qty.value.split("+")
		
		if (wt.length>1)
		{
			wt1=wt[1]
		}
		else
			{
			wt1=0
			}
								
		var code1=document.calcu.sub_heads_qty.value;

		
		if (document.calcu.sub_heads_qty2)
			{		
				var Code2=document.calcu.sub_heads_qty2.value;
			}


		if (document.calcu.sub_heads)
			{		
				var Code3=document.calcu.sub_heads.value;						
			}
		
		
		code11=code1.split("+");		
		
		if (code11.length<=1)		
		{
			Code22=Code2.split("+");
			ln=Code22.length;			
			id=code1;	
			prcc=id;
			for (i=0;i<ln;i++)
			{
				var prcc=prcc+"+"+Code22[i];				
			}			
			
		}
		else
		{
			Code33=Code3.split("|");
			id=Code33[0];	
			
			Code44=code1.split("+");
			ln=Code44.length;					
			
			prcc=id;
			for (i=0;i<ln;i++)
			{
				var prcc=prcc+"+"+Code44[i];				
			}
			
		}
		
		if (document.calcu.sub_additional)
			{
				wttt=document.calcu.sub_additional.value.split("|")			
				wt3=wttt[2]+"_"+wttt[3];				
						
		        }	
		else
			{
				wt3=0
			}			
				
		zipto=document.getElementById('upsT1').value;				
		addl_qty=document.calcu.inpt_m.value;
		getupsajax(prcc,zipto,wt3,addl_qty);
		return false;
	}
	
	
	
	function getupsajax(prcc,zipto,addi,addl_qty)	
  				{  var xmlHttp;
  					try
    					{ 
    					   // Firefox, Opera 8.0+, Safari    
    					   xmlHttp=new XMLHttpRequest();    
    					   }
  						catch (e)
    								{    
    									// Internet Explorer    
    								try
      								{
      									      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
      							   }
    										catch (e)
      									{      
      										try
        											{        
        												xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
        											}
      													catch (e)
        													{        
        														alert("Your browser does not support AJAX!");        
        														return false;        
        													}      
        									}    
        							}
        							
    xmlHttp.onreadystatechange=function(a)
      {   
      	
      	if(xmlHttp.readyState==4)
        {         	    
        //document.getElementById('mn').style.display='none';	                       							
        //document.getElementById('txtHint').innerHTML=xmlHttp.responseText;               
        
        			if (xmlHttp.responseText!='')
        			{        				
        					//alert(xmlHttp.responseText)
							document.getElementById('showimg').style.visibility='hidden';	                       							
    							document.getElementById('showimg').style.display='none';
    							document.getElementById('wtbut').disabled=false;	                       							        				
							document.getElementById('showhere22').innerHTML=xmlHttp.responseText;      
										
							}
							else
								{
									//alert("No Data is Entered against this Navigation. \n Select Add Permission to add.")
								}
        }
      }		
      
    
		var URL="upstest2.php";  
		URL=URL+"?zipto="+zipto+"&prcc="+prcc+"&addi="+addi+"&addl_qty="+addl_qty;  											
    xmlHttp.open("GET",URL,true);
    xmlHttp.send(null);  
    
    }
	
	
	
	
	
	

	function showhelp(x)
	{		
		window.open('help_center/index.htm#'+x,'','width=500,height=600,scrollbars=1,toolbars=0,resizeable=no');								
	}
	
	
	function willcalll(x)
	{
		
		txt="Selected";		
		document.ord.willcall.value=txt		
		txt2="";				
		document.ord.shipment.value=txt2		
		document.ord.shpmnt.value=0+".00";
		ammf1=parseFloat(document.ord.prof_cost.value)+parseFloat(x)		
		ammf=ammf1.toFixed(2)	
		document.ord.final.value=ammf;
		
	}
	
	
	function chhekorder()
	{
		if (document.ord.willcall.value=="")
		{			
			a=1;
		}
		else
			{
				a=0;
			}
		
		if (document.ord.shipment.value=="")
		{			
			b=1;
		}
		else
			{
				b=0;
			}
			
			i=a+b;
			
				
		if (i==2)
		{
			alert("Select Atleast One Shipment Type...!")
			return false;
		}	
					

		if (document.ord.S12.value=="")
			{
			alert("Please select Proof Type...!")	
			document.ord.S12.focus();
			return false;
			
			}

		
	}
	
	

function chekmain()
{		
	if (document.calcu.S9.value=="")
	{
		alert("Select Quantity....!")
		return false;
		document.calcu.S9.focus();
	}
}


function getshipment(sr,rate1,rate2,wt1,wt2,price)
	{	        
		
		sr1=sr.split("|");
		sr=sr1[1];
		//alert(rate1)         
		//alert(rate2)         		
		//alert(wt1)         		
		//alert(wt2)         		
		
		if (rate1)
		{
		cost1=rate1.split("|");
		cost_1=parseFloat(cost1[sr]*wt1)
		}
		else
		{
		cost_1=0;
		}	
		
		cost2=rate2.split("|");
		cost_2=parseFloat(cost2[sr]*wt2)		
		
		g_ship=parseFloat(cost_1+cost_2)
		g_ship_tax=parseFloat(g_ship/100*7)
		g_ship_f=parseFloat(g_ship+g_ship_tax)
					//alert(g_ship_f)		
		prc=(g_ship_f.toFixed(2))		
				
		//alert(prc)
		//alert(cost_1)
		//alert(cost_2)
		
/*		
		wtss=y;
		
		    if (wtss>0)
		    {
		    	qty=wtss;		    	
		    }
		    else
		    {
		    	qty=0;		    	
		    }	
		
		prc=x.split(",");
		obj=prc[2];
		prc=parseInt(prc[0])*parseInt(qty);						
		*/
		
		obj=price;
		
		window.opener.document.ord.shpmnt.value=prc;				
		txt="Selected";		
		window.opener.document.ord.shipment.value=txt		
		txt2="";		
		window.opener.document.ord.willcall.value=txt2				
		getfinaltax(prc,obj);		
	}
	
	function getfinaltax(xx,obj)		
	{	
		fval=eval(xx)+eval(obj)					
		var num = new Number(fval);
		fval1=parseFloat(window.opener.document.ord.prof_cost.value)+parseFloat(num);
		fval=(fval1.toFixed(2))

		
		window.opener.document.ord.final.value=fval;				
		//window.opener.document.getElementById('final').innerHTML=	fval;           													
		
	}
	
	
				function chek_cmnt()
			{
				
				if (document.cmnts.T1.value=="")
				{
					alert("Enter Your Full Name.... !")
					document.cmnts.T1.focus();
					return false;					
				}
				
				if (document.cmnts.T2.value=="")
				{
					alert("Enter Your Phone Number.... !")
					document.cmnts.T2.focus();
					return false;					
				}

				


			if(!validateEmail(cmnts.T3.value))
					{
					 alert("Please enter valid email address"); 
					 cmnts.T3.focus();
					 cmnts.T3.select();					 
					 return false;
					}			

				if (document.cmnts.T4.value=="")
				{
					alert("Enter Message subject.... !")
					document.cmnts.T4.focus();
					return false;					
				}
				
				if (document.cmnts.T5.value=="")
				{
					alert("Enter Your Message .... !")
					document.cmnts.T5.focus();
					return false;					
				}
				
				
			}



		function chek_estim()
		{
				if(document.estim.T1.value=="")
					{
					 alert("Please Enter Company Name"); 
					 document.estim.T1.focus();
					 return false;
					}			
			
			
				if(!validateEmail(estim.T5.value))
					{
					 alert("Please enter valid email address"); 
					 estim.T5.focus();
					 estim.T5.select();					 
					 return false;
					}			
		}




		function chek_estim2()
		{
				if(document.estim2.T1.value=="")
					{
					 alert("Please Enter Company Name"); 
					 document.estim2.T1.focus();
					 return false;
					}			
			
			
				if(!validateEmail(estim2.T5.value))
					{
					 alert("Please enter valid email address"); 
					 estim2.T5.focus();
					 estim2.T5.select();					 
					 return false;
					}			
		}





			function estimatepopup()
			{ 
				//document.calcu.submit();				
				//alert("HERE")

				var nam=""				
				var val				
				if (document.calcu.S1)
					{						
						val=document.calcu.S1.value;		
						//alert("S1")
						//alert(document.calcu.S1.value)
					}				
				
				if (document.calcu.S2)
					{
						nam=nam+"|C1";		
						val=val+"|"+document.calcu.S2.value;							
						//alert("S2")
						//alert(document.calcu.S2.value)							
					}				
					

				if (document.calcu.sub_heads)
					{
						nam=nam+"|C2";								
						vg=document.calcu.sub_heads.value.split("|");																		
						idget1=vg[0];
						val=val+"|"+idget1;							
						
						//alert("sub_heads-C2")
						//alert(val)													
					}				
					
				if (document.calcu.sub_heads_qty)
					{
						//alert(document.calcu.sub_heads_qty.value)
						nam=nam+"|C3";		
						val=val+"|"+document.calcu.sub_heads_qty.value;		
						
						//alert("sub_heads_qty-C3")
						//alert(document.calcu.sub_heads_qty.value)																																					
					}			

				if (document.calcu.sub_heads_qty2)
					{
						nam=nam+"|C4";		
						val=val+"|"+document.calcu.sub_heads_qty2.value;																				
						
						//alert("sub_heads_qty2-C4")
						//alert(document.calcu.sub_heads_qty2.value)																																											
					}									
						
						
						
		//alert(nam);
		//alert(val)

		i=1;	
		while (i<=10)
		{
		val=val.replace("+","***");
		i++;
		}
		
		
		/*i=1;	
		while (i<=20)
		{
		val=val.replace(" ","_");
		i++;
		}*/
		
		
		i=1;	
		while (i<=10)
		{
		val=val.replace("&","-nbsp-");
		i++;
		}
		
		i=1;	
		while (i<=10)
		{
		val=val.replace("#","-hash-");
		i++;
		}
		
					if (document.calcu.sub_additional)
					{
						addl_qty=document.calcu.inpt_m.value;
						addl=document.calcu.sub_additional.value.split("|")
						addl1=addl[1];								
						window.open('prnt_estmate.php?names='+nam+'&value='+val+'&addl='+addl1+'&addl_qty='+addl_qty,'','width=450,height=600,scrollbars=1,toolbars=0,resizeable=no');				
					}
					else
						{
						window.open('prnt_estmate.php?names='+nam+'&value='+val,'','width=450,height=600,scrollbars=1,toolbars=0,resizeable=no');					
						}	
		}




function chek_disable()
{		
	if (document.ord.accp.checked==true)
	{
	document.ord.submit.disabled=false;
	}
	else
	{
	document.ord.submit.disabled=true;
	}		
	
}


function loginchek()
{	
	if (document.logg.usr.value=="")
	{
		alert("Login Should Not Be Blank...!")
		document.logg.usr.focus();
		return false;		
	}	
}


	function showdrop(id,prc)
	{			
		//alert(id)		
		//alert(prc)
		
		prcc = 0;	
		if (document.calcu.S2)
		{
				p=document.calcu.S2.value.split("+");
					if (p[0]>0)
					{				
					p=p[0];				
					p2=parseInt(p);		
					}
					else
					{
					p2=parseInt(0);					
					}	
					prcc = p2;					
		}
		
			

		if (document.calcu.S3)
		{
				p=document.calcu.S3.value.split("+");
				if (p[0]>0)
				{				
				p=p[0];		
				p3=parseInt(p);
				}
				else
				{			
				p3=parseInt(0);							
				}	
				prcc = prcc+p3;					
		}
	

		if (document.calcu.S4)
		{
					p=document.calcu.S4.value.split("+");
					if (p[0]>0)
					{					
					p=p[0];		
					p4=parseInt(p);
					}
					else
					{
					p4=parseInt(0);								
					}	
				prcc = prcc+p4;					
			}		
				

		if (document.calcu.S5)
		{				
					p=document.calcu.S5.value.split("+");			
					if (p[0]>0)
					{					
					p=p[0];		
					p5=parseInt(p);
					}
					else
					{
					p5=parseInt(0);			
					}	
				prcc = prcc+p5;					
		}
		
		
					if (document.calcu.S7)
					{
							p=document.calcu.S7.value.split("+");
							if (p[0]>0)
							{							
							p=p[0];		
							p7=parseInt(p);
							prcc = prcc+p7;					
							}
							else
							{
							p7=0;			
							prcc = prcc+p7;					
							}			
						
					}
		


		if (document.calcu.S8)
		{
					p=document.calcu.S8.value.split("+");
					if (p[0]>0)
					{					
					p=p[0];		
					p8=parseInt(p);
					prcc = prcc+p8;					
					}
					else
					{				
					p8=0;			
					prcc = prcc+p8;					
					}	
				
			}
			
				
		
		

		if (document.calcu.S9)
		{
				p=document.calcu.S9.value.split("+");
				if (p[1]>0)
					{					
					p=p[1];		
					p9=parseInt(p);					
					}
					else
					{				
					p9=1;								
					}		
		prcc = prcc * p9	;
		}
		
				//alert(prcc)
		
		/*if(prc!="")	
		{
				var oldval=document.getElementById('price').innerHTML;
				prcc=parseInt(prc)+parseInt(oldval);		
		}
		else
		{
			prcc=0;		
		}*/
		
	if (id=="C2")
		{	
			obj=document.getElementById('S3')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S33')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}
		
		
		
		if (id=="C3")
		{	         						
			obj=document.getElementById('S4')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S44')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}


		if (id=="C4")
		{				
			obj=document.getElementById('S5')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S55')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}
		

		if (id=="C5")
		{				
			obj=document.getElementById('S6')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S66')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}		
		

		if (id=="C6")
		{				
			obj=document.getElementById('S7')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S77')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}		


		if (id=="C7")
		{				
			obj=document.getElementById('S8')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S88')										
			obj.style.visibility="visible";
			obj.style.display="";									
		}		
		

		if (id=="C8")
		{	
			obj=document.getElementById('S9')										
			obj.style.visibility="visible";
			obj.style.display="";						

			obj=document.getElementById('S99')										
			obj.style.visibility="visible";
			obj.style.display="";					

			document.calcu.but1.disabled=false;
			document.esti.but2.disabled=false;			
		}		
		

			document.getElementById('price').innerHTML=	prcc+".00";               									
		
	}
	



	function chek_register()
	{
				
		if (document.regist.T1.value=="")
		{
			alert("Enter Full Name....")
			document.regist.T1.focus();
			return false;			
		}

		if (document.regist.T2.value=="")
		{
			alert("Enter User Name....")
			document.regist.T2.focus();
			return false;			
		}


		if (document.regist.T3.value=="")
		{
			alert("Enter Password....")
			document.regist.T3.focus();
			return false;			
		}

		if (document.regist.T4.value=="")
		{
			alert("Confirm Password....")
			document.regist.T4.focus();
			return false;			
		}		
		

		if (document.regist.T4.value!=document.regist.T3.value)
		{
			alert("Both Password Values are Different....")
			document.regist.T4.focus();
			return false;			
		}		


				if(!validateEmail(regist.T5.value))
					{
					 alert("Please enter valid email address"); 
					 regist.T5.focus();
					 regist.T5.select();
					 return false;
					}

			if(!validateEmail(regist.T6.value))
					{
					 alert("Please enter valid email address"); 
					 regist.T6.focus();
					 regist.T6.select();
					 return false;
					}
					

	if (document.regist.T6.value!=document.regist.T5.value)
		{
			alert("Both Email Values are Different....")
			document.regist.T6.focus();
			document.regist.T6.select();
			return false;			
		}							


	if (document.regist.T11.value=="")
		{
			alert("Enter Address ....")
			document.regist.T11.focus();
			return false;			
		}


		if (document.regist.city.value=="")
		{
			alert("Enter City ....")
			document.regist.city.focus();
			return false;
		}	


				
		if (document.regist.state.value=="")
		{
			alert("Select state ....")
			document.regist.state.focus();
			return false;			
		}				
		

	if (document.regist.state.value=="California+91355")
		{
			if (document.regist.T122.value=="")
			{
				alert("Select County ....")
				document.regist.T122.focus();
				return false;			
			}
		}	
		
		/*else
		{
			if (document.regist.T12.value=="")
			{
				alert("Enter County ....")
				document.regist.T12.focus();
				return false;			
			}				
		}*/


		if (document.regist.T13.value=="")
		{
			alert("Enter Zip ....")
			document.regist.T13.focus();
			return false;			
		}					


		if (document.regist.T14.value=="")
		{
			alert("Enter Phone Number ....")
			document.regist.T14.focus();
			return false;			
		}						
	
	if (document.regist.resel_chk.checked==true)
		{
			if (document.regist.R1.value=="")
			{
				alert("Please enter a valid sellers permit number ....")
				document.regist.R1.focus();
				return false;			
			}						
	
	
			if (document.regist.R2.value=="")
			{
				alert("Please enter point # 2  ....")
				document.regist.R2.focus();
				return false;			
			}						
	
			if (document.regist.R4.value=="Enter Name as Legal Signature")
			{
				alert("Please enter your legal signature  ....")
				document.regist.R4.focus();
				document.regist.R4.select();
				return false;			
			}						
		
		}
	}
	

		  	function validateEmail(email)
		  	{
							if (email == "")
							{
								return false;
							}
							
							
							badStuff = ";:/,' \"\\";
							
							for (i=0; i<badStuff.length; i++)
							{
							badCheck = badStuff.charAt(i)
							if (email.indexOf(badCheck,0) != -1){return false;}
							}
							
							posOfAtSign = email.indexOf("@",1)
							if (posOfAtSign == -1){return false;}
							
							
							if (email.indexOf("@",posOfAtSign+1) != -1){return false;}
							
							posOfPeriod = email.indexOf(".", posOfAtSign)
							if (posOfPeriod == -1){return false;}
							
							if (posOfPeriod+2 > email.length){return false;}
							
							return true;
					}
						

