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