var ajax = new Array();

function getProvList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	var stprov = document.getElementById('sele').value;

	document.getElementById('aj_prov').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'getProv.php?countryCode='+countryCode+'&stid='+stprov;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createProvs(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createProvs(index)
{
	var obj = document.getElementById('aj_prov');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}

