var XmlHttpObj_2;
function CreateXmlHttpObj( ){
	try{
		XmlHttpObj_2 = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch( e ){
		try{
			XmlHttpObj_2 = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch( oc ){
			XmlHttpObj_2 = null;
		}
	}
	if(!XmlHttpObj_2 && typeof XMLHttpRequest != "undefined"){
	XmlHttpObj_2 = new XMLHttpRequest();
	}
}

function show_cities(id){
    var requestUrl;
    requestUrl = "http://www.city-discovery.com/globals/js/showCities.php?id=" + encodeURIComponent(id);
	CreateXmlHttpObj();

	if(XmlHttpObj_2){
		XmlHttpObj_2.onreadystatechange = process_cities;
		XmlHttpObj_2.open("GET", requestUrl, true);
		XmlHttpObj_2.send( null );
	}
}

function process_cities( ){
	document.searchForm.cities.options[0] = new Option('Loading please wait...','');
	if( XmlHttpObj_2.readyState == 1 ){
		document.getElementById('cities').innerHTML = "<option>Loading please wait...</option>";
	}

	if( XmlHttpObj_2.readyState == 4 ){
		if( XmlHttpObj_2.status == 200 ){			
			populate_cities( XmlHttpObj_2.responseXML.documentElement );
		}else{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj_2.status);
		}
	}
}

function populate_cities( countryNode ){
    var target_id = document.getElementById("cities");

	for( var count = target_id.options.length-1; count >-1; count-- ){
		target_id.options[count] = null;
	}

	var countryNodes = countryNode.getElementsByTagName('city_xml');
	var idValue;
	var textValue;
	var optionItem;

	for( var count = 0; count < countryNodes.length; count++ ){
   		textValue = GetInnerText_region(countryNodes[count]);
		idValue = countryNodes[count].getAttribute("id");
		optionItem = new Option( textValue,idValue,false,false );
		target_id.options[target_id.length] = optionItem;
	}
}

function GetInnerText_region( node ){
	 return( node.textContent || node.innerText || node.text );
}

<!-- transfer -->
function show_cities_transfer(id){
    var requestUrl;
    requestUrl = "http://www.city-discovery.com/globals/js/showCities_transfer.php?id=" + encodeURIComponent(id);
	CreateXmlHttpObj();

	if(XmlHttpObj_2){
		XmlHttpObj_2.onreadystatechange = process_cities_transfer;
		XmlHttpObj_2.open("GET", requestUrl, true);
		XmlHttpObj_2.send( null );
	}
}

function process_cities_transfer( ){
	document.searchForm.cities.options[0] = new Option('Loading please wait...','');
	if( XmlHttpObj_2.readyState == 1 ){
		document.getElementById('cities').innerHTML = "<option>Loading please wait...</option>";
	}

	if( XmlHttpObj_2.readyState == 4 ){
		if( XmlHttpObj_2.status == 200 ){			
			populate_cities_transfer( XmlHttpObj_2.responseXML.documentElement );
		}else{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj_2.status);
		}
	}
}

function populate_cities_transfer( countryNode ){
    var target_id = document.getElementById("cities");

	for( var count = target_id.options.length-1; count >-1; count-- ){
		target_id.options[count] = null;
	}

	var countryNodes = countryNode.getElementsByTagName('city_xml');
	var idValue;
	var textValue;
	var optionItem;

	for( var count = 0; count < countryNodes.length; count++ ){
   		textValue = GetInnerText_region_transfer(countryNodes[count]);
		idValue = countryNodes[count].getAttribute("id");
		optionItem = new Option( textValue,idValue,false,false );
		target_id.options[target_id.length] = optionItem;
	}
}

function GetInnerText_region_transfer( node ){
	 return( node.textContent || node.innerText || node.text );
}