function GetXmlHttpObject1()
{
	try
  	{
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	}
	catch (e)
  	{
  		// Internet Explorer
  		try
    	{
	    	var aVersions = [ "MSXML2.XMLHttp.5.0",
	        "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
	        "MSXML2.XMLHttp","Msxm12.XMLHTTP","Microsoft.XMLHttp"];

	    	for (var i = 0; i < aVersions.length; i++) 
		 	{
	        	try {
	            	var xmlHttp = new ActiveXObject(aVersions[i]);
	            	return xmlHttp;
	            	} 
				catch (oError) 
			   	{
	            	//Do nothing
	           	}
	    	}
    	}
  		catch (e)
    	{
    	}
  	}
  	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
  		return;
  	} 
	return xmlHttp;
}


xmlHttp1 = GetXmlHttpObject1();


function aj_city(cnt)
{
	url = "ajx_country_city.php?show=city&cnt="+cnt;
	
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseS;
	xmlHttp1.send(null);
	
}

function aj_state(cnt)
{
	url = "ajx_country_city.php?show=state&cnt="+cnt;
	
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseG;
	xmlHttp1.send(null);
	
}



function aj_stcity(stat)
{
	url = "ajx_country_city.php?show=state_city&stat="+stat;
	//alert(url);exit;
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseK;
	xmlHttp1.send(null);
	
}


function ajx_index_city(cnt)
{
	url = "ajx_country_city.php?show=index_city&cnt="+cnt;
	//alert(url);
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseI;
	xmlHttp1.send(null);
	
}

function aj_location(cty)
{
	
	url = "ajx_country_city.php?show=location&city="+cty;
	//alert(url);exit;
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseC;
	xmlHttp1.send(null);
	
}

function ajx_stars_rate(rt)
{
		url = "ajx_country_city.php?show=stars&rate="+rt;
	//alert(url);exit;
	xmlHttp1.open("GET", url,true);
	xmlHttp1.onreadystatechange=handleHttpResponseV;
	xmlHttp1.send(null);

}


function handleHttpResponseI()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		Iresults = xmlHttp1.responseText;
		//alert(Iresults);
		document.getElementById('pi_city').innerHTML=Iresults;
	}
	else
		document.getElementById('pi_city').innerHTML="<img src='images/loader_1.gif'>";
}
function handleHttpResponseK()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		Kresults = xmlHttp1.responseText;
		
		document.getElementById('ST_city').innerHTML=Kresults;
		
	}
}
function handleHttpResponseG()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		Gresults = xmlHttp1.responseText;
		
		document.getElementById('p_state').innerHTML=Gresults;
		
	}
}


function handleHttpResponseS()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		results = xmlHttp1.responseText;
		
		document.getElementById('p_city').innerHTML=results;
		
	}
}
function handleHttpResponseC()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		resul = xmlHttp1.responseText;
		
		document.getElementById('p_location').innerHTML=resul;
		
	}
}

function handleHttpResponseV()
{
	//alert(xmlHttp.readyState);
	if(xmlHttp1.readyState== 4)
	{
		Vresults = xmlHttp1.responseText;
		
		document.getElementById('aj_stars').innerHTML=Vresults;
		
	}
}
