var xmlHttp



// State Ajax for Validaiton 
// ----------------------------------------------
function showstatename(country_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getStatesNameList&countryID="+country_ID+"&no_html=1"
xmlHttp.onreadystatechange=statenameChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function statenameChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  document.getElementById("statediv").innerHTML=xmlHttp.responseText
 
 }
 
}
// -----------------------------------------------




// -----------------------------------------------
// City Ajax for Validation
// -----------------------------------------------
function showcityname(state_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCitiesNameList&stateID="+state_ID+"&no_html=1"
xmlHttp.onreadystatechange=citynameChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function citynameChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("citydiv").innerHTML=xmlHttp.responseText
 
 } 
}
// -----------------------------------------------





// Region Ajax for Validation
// --------------------------------------------------
function showregionname(city_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getRegionsNameList&cityID="+city_ID+"&no_html=1"
xmlHttp.onreadystatechange=regionnameChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function regionnameChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("regiondiv").innerHTML=xmlHttp.responseText
  
 } 
}
// --------------------------------------------------


//  ----------------------------------------------

// Country Ajax for Validation.
// --------------------------------------------------
function showcountryname(continent_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCountriesNameList&continentID="+continent_ID+"&no_html=1"
xmlHttp.onreadystatechange=countrynameChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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












//  ----------------------------------------------
// State Ajax for Locaiton Ajax
function showstate(country_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getStatesList&countryID="+country_ID+"&no_html=1"
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 

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



function actionstate(country_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=countryAction&countryID="+country_ID+"&no_html=1"
xmlHttp.onreadystatechange=actionstateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function actionstateChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  document.getElementById("llink").innerHTML=xmlHttp.responseText

 }
 
}

// City Ajax for Location Ajax
function showcity(state_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCitiesList&stateID="+state_ID+"&no_html=1"
xmlHttp.onreadystatechange=cityChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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




// Region Ajax for Location Ajax
function showregion(city_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getRegionsList&cityID="+city_ID+"&no_html=1"
xmlHttp.onreadystatechange=regionChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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


// Country Ajax for location Ajax
function showcountry(continent_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCountriesList&continentID="+continent_ID+"&no_html=1"
xmlHttp.onreadystatechange=countryChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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



// these Ajax for  Advanced Search

// State Ajax for  Advanced Search Validaiton 
// ----------------------------------------------
function showstatenameas(country_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getStatesNameListas&countryID="+country_ID+"&no_html=1"
xmlHttp.onreadystatechange=statenameChangedas 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function statenameChangedas() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  document.getElementById("statedivas").innerHTML=xmlHttp.responseText
 
 }
 
}
// -----------------------------------------------




// -----------------------------------------------

// City Ajax for  Advanced Search Validation
// -----------------------------------------------
function showcitynameas(state_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCitiesNameListas&stateID="+state_ID+"&no_html=1"
xmlHttp.onreadystatechange=citynameChangedas 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function citynameChangedas() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("citydivas").innerHTML=xmlHttp.responseText
 
 } 
}
// -----------------------------------------------





// Region Ajax for  Advanced Search Validation
// --------------------------------------------------
function showregionnameas(city_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getRegionsNameListas&cityID="+city_ID+"&no_html=1"
xmlHttp.onreadystatechange=regionnameChangedas 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function regionnameChangedas() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("regiondivas").innerHTML=xmlHttp.responseText
  
 } 
}
// --------------------------------------------------


//  ----------------------------------------------

// Country Ajax for  Advanced Search Validation.
// --------------------------------------------------
function showcountrynameas(continent_ID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="index2.php?option=com_countrymanager&task=getCountriesNameListas&continentID="+continent_ID+"&no_html=1"
xmlHttp.onreadystatechange=countrynameChangedas 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function countrynameChangedas() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("countrydivas").innerHTML=xmlHttp.responseText
 
 } 
}
// --------------------------------------------------

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;
} 
