var ajax = new sack();

function getCounties(sel)
{
	var CountryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('counties').options.length = 0;	// Empty city select box
	if(CountryCode.length>0){
		ajax.requestFile = 'ajax/get_county.asp?strCmd=ilce&ccode='+CountryCode;	// Specifying which file to get
		ajax.onCompletion = createCounties;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createCounties()
{
	var obj = document.getElementById('counties');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getSubCounties(sel)
{
	var CountryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('subcounties').options.length = 0;	// Empty city select box
	if(CountryCode.length>0){
		ajax.requestFile = 'ajax/get_semt.asp?strCmd=ilce&ccode='+CountryCode;	// Specifying which file to get
		ajax.onCompletion = subcreateCounties;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function subcreateCounties()
{
	var obj = document.getElementById('subcounties');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}