var xmlHttpfunction;

function CheckZipCode()
{
	
	 xmlHttp=GetXmlHttpObject()
	 if (xmlHttp==null)
	 {
	   alert("Browser does not support HTTP Request")
	   return
	 }
	   var ShippingZip=document.getElementById("ShippingZip").value
	   
	   if(document.getElementById("a").checked)
	   {
			 PT="CCAvenue"
	
	   }					
	   else if(document.getElementById("b").checked)
	   {
		 PT="AT"
	   }
	   else if(document.getElementById("c").checked)
	   {
			PT="EBS"
	   }
  	   else if(document.getElementById("e").checked)
	   {
		 PT="COD"
	   }
	   else
	   {
		 PT="DD"
	   }
		   var url="CheckZipCode.php"
		   url=url+"?ZipCode="+ShippingZip 
		   url=url+"&Payment="+PT 
		   url=url+"&sid="+Math.random()
	//	   alert(url)
		   xmlHttp.onreadystatechange=CheckstateChanged
		   xmlHttp.open("GET",url,true)
		   xmlHttp.send(null)
}

function CheckstateChanged()
{
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
            document.getElementById("DivZipMessage").innerHTML=xmlHttp.responseText 
    } 
 
}


function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
	// Firefox, Opera 8.0+, Safari
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	 //Internet Explorer
		try
		{
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
