

var xmlHttp;
	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;
							}
							
	function setStates()
	{
		document.getElementById("stateTab").innerHTML='<font color="red"><img src="images/loading-small.gif" height="25" width="25">&nbsp;Loading... Please wait</font>';
		xmlHttp=GetXmlHttpObject();
		var country_id=document.getElementById("prod_country").value;
		//alert(country_id);
		
		var url="getUserState.php?for=setState&coun_id="+country_id+"&burstcache="+new Date().getTime();
		//alert(url);
		xmlHttp.open("GET",url,true);
		
		xmlHttp.onreadystatechange=function()
								 {
										if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
										{ 
											
											document.getElementById("stateTab").innerHTML=xmlHttp.responseText;
											//document.getElementById("stateTab").innerHTML='';
											//alert(xmlHttp.responseText);										
										}
								}
								xmlHttp.send(null);		
	}
	
	function setCities()
	{
		document.getElementById("cityTab").innerHTML='<font color="red"><img src="images/loading-small.gif" height="25" width="25">&nbsp;Loading... Please wait</font>';
		xmlHttp=GetXmlHttpObject();
		var state_id=document.getElementById("user_state").value;
		//alert(state_id);
		
		var url="getUserState.php?for=setCity&state_id="+state_id+"&burstcache="+new Date().getTime();
		//alert(url);
		xmlHttp.open("GET",url,true);
		
		xmlHttp.onreadystatechange=function()
								 {
										if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
										{ 
											
											document.getElementById("cityTab").innerHTML=xmlHttp.responseText;
											//alert(xmlHttp.responseText);										
										}
								}
								xmlHttp.send(null);		
	}	