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

