var xmlHttp

function CheckVisitorValid(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="/check_visitor_valid.php?q="+str
xmlHttp.onreadystatechange=VisitorChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ShowCity(str)
{ 
document.getElementById("Loader3").style.display="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="/GetCity.php?q="+str
xmlHttp.onreadystatechange=CityChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function CheckUserValid(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="/check_user_valid.php?q="+str
xmlHttp.onreadystatechange=stateChanged3
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ShowState(str)
{ 
document.getElementById("Loader1").style.display="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="/GetState.php?q="+str
xmlHttp.onreadystatechange=stateChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ShowCountry(str)
{ 
document.getElementById("Loader2").style.display="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="GetCountry.php?q="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function VisitorChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  if (xmlHttp.responseText=="Valid")
  {
	  alert("This Username Can Be Use");
  }
  else
  {
	  alert("This Username Was Used By Someone");
  }
 } 
}

function CityChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ajax_city").innerHTML=xmlHttp.responseText ;
 document.getElementById("Loader3").style.display="none";
 } 
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ajax_state").innerHTML=xmlHttp.responseText ;
 document.getElementById("Loader2").style.display="none";
 } 
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ajax_state2").innerHTML=xmlHttp.responseText ;
 document.getElementById("Loader1").style.display="none";
 } 
}

function stateChanged3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  if (xmlHttp.responseText=="Valid")
  {
	  alert("This Username Can Be Use");
  }
  else
  {
	  alert("This Username Was Used By Someone");
  }
 } 
}

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














