
var ajax = new sack();
var ajax2 = new sack();

function getProvinces(sel,selprovincie)
{
//	alert('test1');
	var countryCode = sel.options[sel.selectedIndex].value;
	
	var provinciecode = selprovincie;

	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 = '../index/ajax_get_provinces.asp?countrycode='+countryCode+'&selectedprovincie='+provinciecode;	// 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 getProvinces2(sel,selprovincie)
{
//	alert('test1');
	var countryCode = sel;
	
	var provinciecode = selprovincie;

//	alert(countryCode+selprovincie);

//	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 = '../index/ajax_get_provinces.asp?countrycode='+countryCode+'&selectedprovincie='+provinciecode;	// 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){
		ajax2.requestFile = '../index/ajax_get_cities.asp?provincie='+provincie;	// Specifying which file to get
		ajax2.onCompletion = CreateCounsils;	// Specify function that will be executed after file has been found
		ajax2.runAJAX();		// Execute AJAX function
	}
}


function getCounsils2(country,provincie,counsil)
{
	var country = country;
	var provincie = provincie;
	var counsil = counsil;
		
	//var provincie = sel.options[sel.selectedIndex].value;
	
//	document.getElementById('signup_city').options.length = 0;	// Empty city select box
	if(provincie.length>0){
		ajax2.requestFile = '../index/ajax_get_cities.asp?provincie='+provincie+'&counsil='+counsil+'&country='+country;	// Specifying which file to get
		ajax2.onCompletion = CreateCounsils;	// Specify function that will be executed after file has been found
		ajax2.runAJAX();		// Execute AJAX function
	}
}




function CreateCounsils()
{
	var obj = document.getElementById('signup_city');
	eval(ajax2.response);	// Executing the response from Ajax as Javascript code	
}


		
