
var xmlHttpWaiting = false;
function doZip(zipElement, cityElement, stateElement) 
{
	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)
	      	{
	      		return false;
	      	}
	    }
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			runningzip=0;
			tmp=xmlHttp.responseText.split(",");
			if(xmlHttp.responseText != "error") 
			{
				cityElement.value = tmp[0];
				stateElement.value = tmp[1];
			}
			checkFieldsToFill();
		}
	}
	xmlHttp.open("GET","zip.php?zip=" + zipElement.value,true);
	xmlHttp.send(null);
	return true;
}

function cancelXmlHttpWait()
{
	xmlHttpWaiting = false;
}
