// JavaScript Document
var xmlHttp


// from area
function showLocation(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=from_area"
url=url+"&q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
} 
} 


// from city
function showLocation2(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=from_city"
url=url+"&r="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint2").innerHTML=xmlHttp.responseText 
} 
} 


// to area
function showLocation3(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=to_area"
url=url+"&s="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged3 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint3").innerHTML=xmlHttp.responseText 
} 
} 

// to city
function showLocation4(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=to_city"
url=url+"&t="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged4 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged4() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint4").innerHTML=xmlHttp.responseText 
} 
} 



// all area
function showLocation5(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=area"
url=url+"&country_id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged5 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged5() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint5").innerHTML=xmlHttp.responseText 
//document.getElementById("txtHint7").innerHTML=xmlHttp.responseText 
} 
} 

// all city
function showLocation6(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=city"
url=url+"&city_id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged6 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged6() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint6").innerHTML=xmlHttp.responseText 
//document.getElementById("txtHint8").innerHTML=xmlHttp.responseText 
} 
} 


// all area2
function showLocation7(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=area2"
url=url+"&country_id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged7 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged7() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint7").innerHTML=xmlHttp.responseText 
} 
} 


// all city2
function showLocation8(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="loc.php?action=city2"
url=url+"&city_id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged8 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged8() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint8").innerHTML=xmlHttp.responseText 
} 
} 


function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}