function updateHotels() {
	var FilteredHotels = new Array();
	if (document.forms['search_eres'].Region.value == "All Regions") {
		//only get hotels in the selected brand	
		for (i = 0; i < Hotels.length; i++) {
			if (Hotels[i][2] == document.forms['search_eres'].Brand.value) {
				var FilteredHotel = new Array();
				FilteredHotel = Hotels[i];
				FilteredHotels[FilteredHotels.length] = FilteredHotel;
			}
		}
	}
	if (document.forms['search_eres'].Brand.value == "All Hotel Groups") {
		//only get hotels in the selected region
		for (i = 0; i < Hotels.length; i++) {
			if (Hotels[i][3] == document.forms['search_eres'].Region.value) {
				var FilteredHotel = new Array();
				FilteredHotel = Hotels[i];
				FilteredHotels[FilteredHotels.length] = FilteredHotel;
			}
		}
	}
	if ((document.forms['search_eres'].Brand.value != "All Hotel Groups") && (document.forms['search_eres'].Region.value != "All Regions")) {
		//get hotel under the specific group and the specific region	
		for (i = 0; i < Hotels.length; i++) {
			if ((Hotels[i][2] == document.forms['search_eres'].Brand.value) && (Hotels[i][3] == document.forms['search_eres'].Region.value)) {
				var FilteredHotel = new Array();
				FilteredHotel = Hotels[i];
				FilteredHotels[FilteredHotels.length] = FilteredHotel;
			}
		}
	}
	if ((document.forms['search_eres'].Brand.value == "All Hotel Groups") && (document.forms['search_eres'].Region.value == "All Regions")) {
		//reload all the hotels
		FilteredHotels = Hotels;
	}
	reloadHotels(FilteredHotels);
}

function reloadHotels(FilteredHotels){
	document.forms['search_eres'].Hotel.options.length = 0;
	document.forms['search_eres'].Hotel.options[0] = new Option("All Hotels", "All Hotels");
	for (i = 0; i < FilteredHotels.length; i++) {
		document.forms['search_eres'].Hotel.options[i+1] = new Option(FilteredHotels[i][1], FilteredHotels[i][0]);
	}
}
