var xmlHttp
function request_district_by_city(city_id)
{ 
	var str = 'param='+city_id;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url="/ajax.php"
	url=url+"?"+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=Index_Changed_City 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function request_district_by_account(city_id)
{ 
	var str = 'param='+city_id;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url="/ajax.php"
	url=url+"?"+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=Index_Changed_City 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function Index_Changed_City() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		var arr_panel = new Array();
		eval(xmlHttp.responseText);
		for(i=0;i<length_arr;i++) 
		{
			document.frm_search.district.options[i]=new Option(arr_panel[i]["text"], arr_panel[i]["value"]);
		}
	 } 
}
function request_district_by_city2(city_id)
{ 
	var str = 'param='+city_id;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url="/ajax.php"
	url=url+"?"+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=Index_Changed_City2 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function Index_Changed_City2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		var arr_panel = new Array();
		eval(xmlHttp.responseText);
		for(i=0;i<length_arr;i++) 
		{
			document.frm_search2.district.options[i]=new Option(arr_panel[i]["text"], arr_panel[i]["value"]);
		}
	 } 
}

//----------end show oil value
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;
}
//---Ty gia
function tygia(currency_id,total,type,txt_id,subpath)
{ 
	var str = 'currency_id='+currency_id+'&total='+total+'&type='+type+'&txt_id='+txt_id;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url;
	if(subpath=="home")
		url="../ajax_rate.php"
	if(subpath=="page")
		url="../../../../ajax_rate.php"
	if(subpath=="city")
		url="../../../../ajax_rate.php"
	url=url+"?"+str
	
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=Tygia_Changed 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function Tygia_Changed() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		var arr_panel = new Array();	
		eval(xmlHttp.responseText);
		document.getElementById("txt_forex"+arr_panel['id']).innerHTML=arr_panel['value'];
	 } 
}
