function chec_zip()
{
	var zip=document.getElementById('zip').value;
	b=AjaxRequest.get(
		{
		'url':'/ajax/index.php',
		'parameters':{ 'act':'validateZip', 'zip':zip },
		'onSuccess':chec_zip2
		}
	);
}

function chec_zip2(req)
{
	var status;
	var form=document.getElementById('form-get-auto-quote');

	if(!status)	if(!validator(form)) status=1;
	var zip=document.getElementById('zip').value;
	

	if (req.responseXML && req.responseXML.documentElement && !status)
	{
		var response = POXunserialize(req.responseXML.documentElement);

		if(response.valid=="200")
		{
			if(response.texas==1)
			{
				//window.open("https://www.shmktpl.com/search.asp?src=161523&zc="+zip+"&res=2&var1="); return false;
				form.action="http://www.800-insurance.com/program/getquote/";
			}
			firstzip=parseInt(zip.substring(0,1),10);
			if(firstzip != 9 || (zip<90001 || zip>96150 ))
			{
				//window.open("http://www.insurance.com/quotes/auto.aspx?cp=1714");
				//return false;
				form.action="http://www.800-insurance.com/program/getquote/";
			}
		}
		else
		{
			firstzip=parseInt(zip.substring(0,1),10);
			if(firstzip != 9 || (zip<90001 || zip>96150 ))
			{
				form.action="http://www.800-insurance.com/program/getquote/";
				//window.open("http://www.insurance.com/quotes/auto.aspx?cp=1714");
				//return false;
			}
			else
			{
				alert('Please enter 5 digits ZIP Code');
				status=1;
			}
		}
	}

	if(!status) form.submit();
}