
var xmlHttp

function change(url)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
 
xmlHttp.onreadystatechange=updatedist;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

 

function updatedist() 
{ 
if (xmlHttp.readyState==4)
{
	var xmldoc=xmlHttp.responseXML.documentElement;

	var x =  xmldoc.getElementsByTagName('DistrictName');
	var y =  xmldoc.getElementsByTagName('DistID'); 
	document.frm.District.options.length=0; 
	document.frm.District.options[0]=new Option('--',''); 
	for (i=0; i<x.length; i++){
	
		document.frm.District.options[document.frm.District.options.length]=new Option(x[i].firstChild.data,y[i].firstChild.data);
	
	} 

}
}

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

 


function changecat(url)
{
	 
xmlHttp=GetXmlHttpObject();
  
  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
 
xmlHttp.onreadystatechange=updatestypes;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}


function updatestypes(){
	
	if (xmlHttp.readyState==4)
	{
	
	var xmlDoc=xmlHttp.responseXML.documentElement;
	var x = xmlDoc.getElementsByTagName('PropertyType');
	var y = xmlDoc.getElementsByTagName('CatID');
	document.frm.ProType.options.length=0

	document.frm.ProType.options[0]=new Option('--','');

		for (i=0; i<=x.length; i++){
		
		document.frm.ProType.options[document.frm.ProType.options.length]=new Option(x[i].firstChild.data,y[i].firstChild.data);
		
		}

	}

}

function changePrice(url)
{
	 
xmlHttp=GetXmlHttpObject();
  
  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
 
xmlHttp.onreadystatechange=updatePrice;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}


function updatePrice(){
	
	if (xmlHttp.readyState==4)
	{
	
	var xmlDoc=xmlHttp.responseXML.documentElement;
	var x = xmlDoc.getElementsByTagName('price'); 
	
	 
	
	document.frm.PriceMin.options.length=0
	document.frm.PriceMax.options.length=0
	
	document.frm.PriceMin.options[0]=new Option('--','');
	document.frm.PriceMax.options[0]=new Option('--','');

		for (i=0; i<=x.length; i++){
		
		document.frm.PriceMin.options[document.frm.PriceMin.options.length]=new Option(x[i].firstChild.data,x[i].firstChild.data);
		document.frm.PriceMax.options[document.frm.PriceMax.options.length]=new Option(x[i].firstChild.data,x[i].firstChild.data);
		
		}
		
		 

	}

}
