
var httpLoadcity=null;var httpLoadregion=null;var httpLoadstate=null;var reg_id=-1;var cit_id=-1;var sta_id=-1;function xmlhttpcreate(){var xmlHttpReq=false;if(window.XMLHttpRequest){xmlHttpReq=new XMLHttpRequest();}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}
return xmlHttpReq;}
function LoaderCity(strURL,strSubmit){httpLoadcity=xmlhttpcreate();if(httpLoadcity.readyState==0){httpLoadcity.open('POST',strURL,true);httpLoadcity.setRequestHeader('Content-Type','application/x-www-form-urlencoded');httpLoadcity.onreadystatechange=function(){if(httpLoadcity.readyState==4){try{eval(httpLoadcity.responseText);}catch(e){}}}
httpLoadcity.send(strSubmit);}}
function LoaderRegion(strURL,strSubmit){httpLoadregion=xmlhttpcreate();if(httpLoadregion.readyState==0){httpLoadregion.open('POST',strURL,true);httpLoadregion.setRequestHeader('Content-Type','application/x-www-form-urlencoded');httpLoadregion.onreadystatechange=function(){if(httpLoadregion.readyState==4){try{eval(httpLoadregion.responseText);}catch(e){}}}
httpLoadregion.send(strSubmit);}}
function LoaderState(strURL,strSubmit){httpLoadstate=xmlhttpcreate();if(httpLoadstate.readyState==0){httpLoadstate.open('POST',strURL,true);httpLoadstate.setRequestHeader('Content-Type','application/x-www-form-urlencoded');httpLoadstate.onreadystatechange=function(){if(httpLoadstate.readyState==4){try{eval(httpLoadstate.responseText);}catch(e){}}}
httpLoadstate.send(strSubmit);}}
function loadCity(selected_id){region_id=document.getElementById('Region').value;if(selected_id!=-1){region_id=selected_id;}else{region_id=document.getElementById('Region').value;}
if(region_id!=-1){while(document.getElementById('City').length>1){document.getElementById('City').remove(1);}
strSubmit='region_id='+region_id;document.getElementById('City').style.visibility='visible';LoaderCity('loadFunction.php',strSubmit);}}
function loadRegion(selected_id){state_id=document.getElementById('State').value;if(selected_id!=-1){state_id=selected_id;}else{state_id=document.getElementById('State').value;}
if(state_id!=-1){while(document.getElementById('Region').length>1){document.getElementById('Region').remove(1);}
strSubmit='state_id='+state_id;LoaderRegion('loadFunction.php',strSubmit);}
document.getElementById('Region').style.visibility='visible';document.getElementById('City').style.visibility='hidden';}
function loadState(selected_id,lang){strSubmit='';document.getElementById('Region').style.visibility='hidden';document.getElementById('City').style.visibility='hidden';LoaderState('loadFunction.php?lang='+lang,strSubmit);}
