function filterCountries(RegionIndex){
	//get the option relative to the selected region
	Region = document.getElementById("regionsid").options[RegionIndex];
	//this is true is the option 'all regions' has been selected
	bolAllCountriesOn = (Region.value == "ALL");
	//get the list of options for the countries' select
	Countries = document.getElementById("countriesid");
	//delete all the countries options
	Countries.length = 0;
	//now repopulate fishing from the hidden select
	HiddenCountries = document.getElementById("hiddencountriesid");
	//if we want them all back
	if (bolAllCountriesOn) {
		Countries[0] = new Option("All countries", "ALL", true, false); 
		for (i = 0; i < HiddenCountries.length; i++) {
			Countries[i+1] = new Option(HiddenCountries[i].text, HiddenCountries[i].value, false, false);
		}
	}
	//else we have chosen a specific region
	else {
		Countries[0] = new Option("All countries in " + Region.text, "ALL", true, false);
		j = 1;	
		for (i = 0; i < HiddenCountries.length; i++) {
			if (HiddenCountries[i].getAttribute("region") == Region.value) {
				Countries[j] = new Option(HiddenCountries[i].text, HiddenCountries[i].value, false, false);
				j += 1;
			}
		}
	}
}
