
var ajax = new sack();

function getProvinces(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('signup_province').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		//alleen als countrycode = NL of BE dan provincies en gemeentes tonen.
		//if(countryCode.value == "NL" or countryCode.value == "BE"){
	
		ajax.requestFile = 'ajax_get_provinces.asp?countrycode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createProvinces;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		
		//}
		
	}
}


function createProvinces()
{
	var obj = document.getElementById('signup_province');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getCounsils(sel)
{
	var provincie = sel.options[sel.selectedIndex].value;
	document.getElementById('signup_city').options.length = 0;	// Empty city select box
	if(provincie.length>0){
		ajax.requestFile = 'ajax_get_cities.asp?provincie='+provincie;	// Specifying which file to get
		ajax.onCompletion = CreateCounsils;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function CreateCounsils()
{
	var obj = document.getElementById('signup_city');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


		
