var xmlHttp
function getstate(str)
{ 
//var stateid=document.getElementById("hidState").value();
//alert(stateid);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="components/com_propertylisting/ajax/checkAjax.php";
url=url+"?ids="+str;
//url+="&sid="+stateid;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function getstateofoperation(str)
{ 
//var stateid=document.getElementById("hidState").value();
//alert(stateid);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="components/com_propertylisting/ajax/getstateofoperation.php";
url=url+"?ids="+str;
//url+="&sid="+stateid;
xmlHttp.onreadystatechange=stateChanged3;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}


function getCity(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getcity.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function getLocality(str)
{ 
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_buyer/ajax/getlocality.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged5;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function getCityBuyer(str)
{
		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_buyer/ajax/getcityfilter.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function getCityBuyerSearch(str)
{
		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_buyer/ajax/getcityfiltersearch.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChangedSearch;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}


function getcityofoperation(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getcityofoperation.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged4;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function checkmail(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/checkmail.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged2;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);		
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{
document.getElementById("txtSelState").innerHTML=xmlHttp.responseText;
}
}



function stateChanged1() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelCityBuyer").innerHTML=xmlHttp.responseText;
	}
}
function stateChangedSearch() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelCityBuyer").innerHTML=xmlHttp.responseText;
	}
}


function stateChanged2() 
{ 
	if (xmlHttp.readyState==4)
	{		
		document.getElementById("hidEmail").value=xmlHttp.responseText;	
		if(xmlHttp.responseText==1)
		{
			document.getElementById("txtCheckMail").innerHTML="<span class='error'> Email already exists! Choose New </span>";
		}	
	}
}

function stateChanged3() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelStateOperation").innerHTML=xmlHttp.responseText;
	}
}

function stateChanged4() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelCityOperation").innerHTML=xmlHttp.responseText;
	}
}

function stateChanged5() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelLocalityBuyer").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;
}

