
function PropertyCatOnChange_city_area_search() 
{	
    var continentList = document.getElementById("drppropcountry");	
    // get selected continent from dropdown list
    var selectedContinent = continentList.options[continentList.selectedIndex].value;
 	
    var requestUrl;
    // use the following line if using asp
	
    requestUrl = "LoadTypeCombo_area_search.php" + "?filter=" + encodeURIComponent(selectedContinent);
    // use the following line if using php
    // requestUrl = "xml_data_provider.php" + "?filter=" + encodeURIComponent(selectedContinent);

	CreateXmlHttpObj();
	
	// verify XmlHttpObj variable was successfully initialized
	if(XmlHttpObj)
	{
        // assign the StateChangeHandler function ( defined below in this file)
        // to be called when the state of the XmlHttpObj changes
        // receiving data back from the server is one such change
		XmlHttpObj.onreadystatechange = StateChangeHandler_city_area_search;
		
		// define the iteraction with the server -- true for as asynchronous.
		XmlHttpObj.open("GET", requestUrl,  true);
		
		// send request to server, null arg  when using "GET"
		XmlHttpObj.send(null);		
	}
}
function StateChangeHandler_city_area_search()
{
	// state ==4 indicates receiving response data from server is completed
	if(XmlHttpObj.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpObj.status == 200)
		{			
			PopulateTypeList_city(XmlHttpObj.responseXML.documentElement);
		}
		else
		{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj.status);
		}
	}
}
function PopulateTypeList_city_area_search(countryNode)
{
   // var countryList = document.getElementById("cmbmodel");
   var countryList = document.addproperty.city;

	// clear the country list 
	for (var count = countryList.options.length-1; count >-1; count--)
	{
		countryList.options[count] = null;
	}

	var countryNodes = countryNode.getElementsByTagName('type');
	var idValue;
	var textValue; 
	var optionItem;
	// populate the dropdown list with data from the xml doc
	for (var count = 0; count < countryNodes.length; count++)
	{
   		textValue = GetInnerText(countryNodes[count]);
		idValue = countryNodes[count].getAttribute("id");
		optionItem = new Option( textValue, idValue,  false, true);
		countryList.options[countryList.length] = optionItem;
	}
}
//=====================================================Search Locality
function PropertyCatOnChange_locality_lk_area() 
{	

    var continentList = document.getElementById("city");	
    // get selected continent from dropdown list
    var selectedContinent = continentList.options[continentList.selectedIndex].value;
 	
    var requestUrl;
    // use the following line if using asp
	
    requestUrl = "LoadTypeCombo_area_search.php" + "?filter=" + encodeURIComponent(selectedContinent);
    // use the following line if using php
    // requestUrl = "xml_data_provider.php" + "?filter=" + encodeURIComponent(selectedContinent);
    
	CreateXmlHttpObj();
	
	// verify XmlHttpObj variable was successfully initialized
	if(XmlHttpObj)
	{
        // assign the StateChangeHandler function ( defined below in this file)
        // to be called when the state of the XmlHttpObj changes
        // receiving data back from the server is one such change
		XmlHttpObj.onreadystatechange = StateChangeHandler_locality_lk_area;
		
		// define the iteraction with the server -- true for as asynchronous.
		XmlHttpObj.open("GET", requestUrl,  true);
		
		// send request to server, null arg  when using "GET"
		XmlHttpObj.send(null);		
	}
}
function StateChangeHandler_locality_lk_area()
{
	// state ==4 indicates receiving response data from server is completed
	if(XmlHttpObj.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpObj.status == 200)
		{			
			PopulateTypeList_loc_lk(XmlHttpObj.responseXML.documentElement);
		}
		else
		{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj.status);
		}
	}
}
