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)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getlocality.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged5;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getLocalityBuyer(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getlocalitybuyer.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged55;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function getCityFilter(str)
{ 
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getcityfilter.php";
	url=url+"?ids="+str;		
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function getBudget(str)
{
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getbudget.php";
	url=url+"?ids="+str;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged6;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getBudgetBuyer(str)
{
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getbudgetbuyer.php";
	url=url+"?ids="+str;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged66;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getBudgetProperty(str)
{
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getbudgetbuyer.php";
	url=url+"?ids="+str;
	//alert(url);
	xmlHttp.onreadystatechange=stateChangedPro;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function getCityFilterBuyer(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="components/com_propertylisting/ajax/getcityfilterbuyer.php";
	url=url+"?ids="+str;	
	xmlHttp.onreadystatechange=stateChanged11;
	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)
	{
		var arr=Array();
		arr=xmlHttp.responseText.split("~");
	
	document.getElementById("txtSelCity").innerHTML=arr[0];
	document.getElementById("txtSelLocality").innerHTML=arr[1];	
	}
}
function stateChanged11() 
{ 
	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("txtSelLocality").innerHTML=xmlHttp.responseText;
	}
}

function stateChanged55() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtSelLocalityBuyer").innerHTML=xmlHttp.responseText;
	}
}


function stateChanged6() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtBudget").innerHTML=xmlHttp.responseText;
	}
}

function stateChanged66() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtBudgetBuyer").innerHTML=xmlHttp.responseText;
	}
}

function stateChangedPro() 
{ 
	if (xmlHttp.readyState==4)
	{
	document.getElementById("txtBudgetProperty").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;
}

