// JavaScript Document

function validate_zipcode(zip,area)
 {
   //alert(zip);
   //alert(area);
   if(trim(zip) != "" && trim(area) != "" )
   {
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		
		var url="retrieve_zip_list.php";
		
		postString = 'zip_code=' + encodeURI(zip) + '&area_code=' + encodeURI(area);
		
		xmlHttp.onreadystatechange=stateChanged;
		
		xmlHttp.open('post', url, true);
	
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
		
		xmlHttp.setRequestHeader('Content-length', postString.length);
		
		xmlHttp.setRequestHeader('Connection', 'close');
		
		xmlHttp.send(postString);
	}

 }
   
function stateChanged() 
 { 
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
		var op= xmlHttp.responseText ;
		//alert(op); return false;
		document.getElementById('flagAjax').setAttribute("value",op);
   }
 }
 
function GetXmlHttpObject()
 { 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
 } 