// Multi Hotel Quickbook Code
// (c) 2006 Avvio.com
// Author: Stefan Wendt
// XHTML verified
function getSingleHotel()
{
	hotel=document.forms["hotel_selector"].elements["hotel"].value;

	if ( hotel == "na" )
	{
		document.getElementById('hotel_selector_box').style.background='#FFAAAA';
		alert("Please select a hotel first.");
		return(false);
	}
	if ( ( hotel == "All myhotels" ) )
	{
		document.getElementById('hotel_selector_box').style.background='#FFAAAA';
		alert("This option is only available for specific hotels. Do not select a group, please select a hotel!");
		return(false);
	}
	return(hotel);
}
function getHotel()
{
	hotel=document.forms["hotel_selector"].elements["hotel"].value;

	if ( hotel == "na" )
	{
		document.getElementById('hotel_selector_box').style.background='#FFAAAA';
		alert("Please select a hotel or a group first.");
		return(false);
	}
	
	return(hotel);
}
function submitQuickBook()
{
	hotel=getHotel();
	if ( hotel == false ) return false;

	if ( ( hotel == "All myhotels" ) )
	{
		document.forms["quickbook_portal"].elements["ci_day"].value=document.forms["quickbook"].elements["ci_day"].value;
		document.forms["quickbook_portal"].elements["ci_ym"].value=document.forms["quickbook"].elements["ci_ym"].value;
		document.forms["quickbook_portal"].elements["nights"].value=document.forms["quickbook"].elements["nights"].value;
		document.forms["quickbook_portal"].elements["location"].value=hotel;
		document.forms["quickbook_portal"].elements["location_manual"].value=hotel;
		document.forms["quickbook_portal"].submit();
	} else
	{	
		document.forms["quickbook"].elements["hotel"].value=hotel;
		document.forms["quickbook"].submit();
	}
}
function submitPromotion()
{
	hotel=getSingleHotel();
	if ( hotel == false ) return false;
	
	document.forms["promotion"].elements["hotel"].value=hotel;
	document.forms["promotion"].submit();
}
function submitLogin()
{
	hotel=getSingleHotel();
	if ( hotel == false ) return false;
	
	document.forms["login"].elements["hotel"].value=hotel;
	document.forms["login"].submit();
}

