function resPanelLayer(layerName) {
	//picks a layer and shows it, hiding the other one
	if (layerName=="byBestRate") {
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById("byHotel").style.display = "none";
			document.getElementById("byBestRate").style.display = "block";
			document["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate_on" +vbgimage +".gif";
			document["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel" +vbgimage +".gif";
		} else if (document.all) {
			// this is the way old msie versions work
			document.all["byHotel"].style.display = "none";
			document.all["byBestRate"].style.display = "block";
			document.all["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate_on" +vbgimage +".gif";
			document.all["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel" +vbgimage +".gif";
		}else if (document.layers) {
			// this is the way nn4 works
			document.layers["byHotel"].style.display = "none";
			document.layers["byBestRate"].style.display = "block";
			document.layers["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate_on" +vbgimage +".gif";
			document.layers["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel" +vbgimage +".gif";
		}
	}else{
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById("byHotel").style.display = "block";
			document.getElementById("byBestRate").style.display = "none";
			document["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate" +vbgimage +".gif";
			document["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel_on" +vbgimage +".gif";
		} else if (document.all) {
			// this is the way old msie versions work
			document.all["byHotel"].style.display = "block";
			document.all["byBestRate"].style.display = "none";
			document.all["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate" +vbgimage +".gif";
			document.all["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel_on" +vbgimage +".gif";
		}else if (document.layers) {
			// this is the way nn4 works
			document.layers["byHotel"].style.display = "block";
			document.layers["byBestRate"].style.display = "none";
			document.layers["tab_byBestRate"].src = "/images/ROBE/resPanel/Tab_Search-By-Best-Rate" +vbgimage +".gif";
			document.layers["tab_byHotel"].src = "/images/ROBE/resPanel/Tab_Search-By-Hotel_on" +vbgimage +".gif";
		}
	}
}
function submitForm(whichForm) {
	if (whichForm=="xmlRequest") {
		var errs="";
		if (document.xmlRequest.hotelCode) {
			if (document.xmlRequest.hotelCode.value=="" && document.xmlRequest.region.value=="") {
				errs+="Please select a hotel or destination to search for.";
			}
		}

		if (errs!="") {
			alert("Please ensure the following elements are completed correctly"+"\n\n"+errs);
		} else {
				window.onbeforeunload = function () {
					//return "This session is expired and the history altered.";
					//	location.replace('');
				}		    
		    document.getElementById('searchButton').value='Please Wait...';
		    document.getElementById('searchButton').disabled = true;
			document.xmlRequest.submit();
		}

	} else if (whichForm=="xmlRequest28") {
		if (document.xmlRequest28.hotelCode.value=="" && document.xmlRequest28.region.value=="")
			alert("Please select a hotel or destination to search for.");
		else
		    document.getElementById('searchButton').value='Please Wait...';
		    document.getElementById('searchButton').disabled = true;
			document.xmlRequest28.submit();			
	}
}

function resetDropDownMenus(form,menu)
{
	if (form == 'xmlRequest') {
		document.xmlRequest28.hotelCode.selectedIndex=0;
		if (menu == 'hotelCode' )
			document.xmlRequest.region.selectedIndex=0;
		else
			document.xmlRequest.hotelCode.selectedIndex=0;
	}
	else {
		document.xmlRequest.hotelCode.selectedIndex=0;
		document.xmlRequest.region.selectedIndex=0;
		if (menu == 'hotelCode' )
			document.xmlRequest28.region.selectedIndex=0;
		else
			document.xmlRequest28.hotelCode.selectedIndex=0;
	}
}
