// JavaScript Document
var XMLHttp;
var XMLHttpQty;





function CheckKey(e){
	var keynum;
var keychar;
var numcheck;
if(window.event) // IE
  {
	 
  keynum = e.keyCode;
  }
else if(e.which) // Netscape/Firefox/Opera
  {
  
  keynum = e.which;
  }
  if(keynum==13){
	  	
		Login(); 
  }
}


function Login(){

var done=0;
var varZip=document.getElementById("txtZipCode").value;
if (varZip=="ash374908") { window.location="toolkit.html"; done=1; }
if (varZip=="aur722808") { window.location="toolkit.html"; done=1; }
if (varZip=="bat142408") { window.location="toolkit.html"; done=1; }
if (varZip=="brk436508") { window.location="toolkit.html"; done=1; }
if (varZip=="cht531508") { window.location="toolkit.html"; done=1; }
if (varZip=="cor904108") { window.location="toolkit.html"; done=1; }
if (varZip=="cre414008") { window.location="toolkit.html"; done=1; }
if (varZip=="dek206008") { window.location="toolkit.html"; done=1; }
if (varZip=="dix148508") { window.location="toolkit.html"; done=1; }
if (varZip=="flo230008") { window.location="toolkit.html"; done=1; }
if (varZip=="fra217708") { window.location="toolkit.html"; done=1; }
if (varZip=="fgv213108") { window.location="toolkit.html"; done=1; }
if (varZip=="ful261608") { window.location="toolkit.html"; done=1; }
if (varZip=="gen965408") { window.location="toolkit.html"; done=1; }
if (varZip=="hin558108") { window.location="toolkit.html"; done=1; }
if (varZip=="jol405008") { window.location="toolkit.html"; done=1; }
if (varZip=="map303908") { window.location="toolkit.html"; done=1; }
if (varZip=="mok820008") { window.location="toolkit.html"; done=1; }
if (varZip=="mor765708") { window.location="toolkit.html"; done=1; }
if (varZip=="nau822808") { window.location="toolkit.html"; done=1; }
if (varZip=="nle640008") { window.location="toolkit.html"; done=1; }
if (varZip=="ore632108") { window.location="toolkit.html"; done=1; }
if (varZip=="osw361808") { window.location="toolkit.html"; done=1; }
if (varZip=="pfor562308") { window.location="toolkit.html"; done=1; }
if (varZip=="pla282408") { window.location="toolkit.html"; done=1; }
if (varZip=="roc703108") { window.location="toolkit.html"; done=1; }
if (varZip=="sch616108") { window.location="toolkit.html"; done=1; }
if (varZip=="ste339508") { window.location="toolkit.html"; done=1; }
if (varZip=="stl662108") { window.location="toolkit.html"; done=1; }
if (varZip=="sgv450708") { window.location="toolkit.html"; done=1; }
if (varZip=="syc531008") { window.location="toolkit.html"; done=1; }
if (varZip=="tnp500008") { window.location="toolkit.html"; done=1; }
if (varZip=="unp321108") { window.location="toolkit.html"; done=1; }
if (varZip=="lee210808") { window.location="toolkit.html"; done=1; }
if (varZip=="ken558108") { window.location="toolkit.html"; done=1; }
if (varZip=="whi385408") { window.location="toolkit.html"; done=1; }
if (varZip=="wil175308") { window.location="toolkit.html"; done=1; }
if (varZip=="coo820008") { window.location="toolkit.html"; done=1; }
if (varZip=="kan374908") { window.location="toolkit.html"; done=1; }
if (varZip=="dkb778808") { window.location="toolkit.html"; done=1; }
if (varZip=="lhc374908") { window.location="toolkit.html"; done=1; }
if (varZip=="ilt374908") { window.location="toolkit.html"; done=1; }
if (varZip=="ili374908") { window.location="toolkit.html"; done=1; }
if (done==0){ 
	zipNotFound(document.getElementById("txtZipCode").value);
	//alert("Incorrect Password");
}
}

function zipNotFound(varZip){
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="zipNotFound.php"
	url=url+"?ZipCode="+varZip;
	//url=url+"&sid="+Math.random()	
	xmlHttp.onreadystatechange=stateChangedZipNF
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)	
}

function stateChangedZipNF(){
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 		
				document.getElementById("divZipNotFound").style.display='';			
		} 
}



function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 

function updateQuantity(varItemNumber){
		XMLHttpQty=GetXmlHttpObject()
	if (XMLHttpQty==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="UpdateQuantity.php"
	url=url+"?ItemNumber="+varItemNumber+"&ItemQuantity="+document.getElementById(varItemNumber).value;
	XMLHttpQty.onreadystatechange=stateChangedUpdateQuantity
	XMLHttpQty.open("GET",url,true)
	XMLHttpQty.send(null)	
}

function stateChangedUpdateQuantity(){
		if (XMLHttpQty.readyState==4 || XMLHttpQty.readyState=="complete"){ 
				window.alert('Update Finished');
				//var varNothing=1;	//does nothing	
		} 
}