// JavaScript Document
var strPreOption='';//append to the beginning of the city options

function UpdateCities(regionid, blAll) {
	//update the <select> of cities.
	if(blAll) strPreOption = '<option value="">All</option>';
	//ajax request
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url=strRoot+"wingman/ajax/get-cities.php";
	url=url+"?regionid="+regionid;
	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		$("#selCity").html(strPreOption+xmlHttp.responseText);
	}
}

