var ajax = new sack();

function getdistrictList(sel)
{
	var cityCode = sel.options[sel.selectedIndex].value;
	document.getElementById('dhtmlgoodies_district').options.length = 0;	// Empty district select box
	if(cityCode.length>0){
		ajax.requestFile = 'ajax/getDistrict.php?cityCode='+cityCode;	// Specifying which file to get
		ajax.onCompletion = createCities;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createCities()
{
	var obj = document.getElementById('dhtmlgoodies_district');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


