// Function Name: onload
// Purpose: preforms init page functionality
// Parameters: None
// Return: None
window.onload = function()
{
	document.getElementById("submitReal").style.display = "block";
	document.getElementById("submitFake").style.display = "none";
	//sets initial values for gsNumTravelers if no changes are made to default config (1 room, 2 adults, no children)
	RoomValues.createPipeDelimitedStrings();
	
	// gsXXX variables declared and defined at top of resTool.asp, prior
	// to the include declaration for this script	
	initSearchParameters();   
}


// Function Name: initSearchParameters
// Purpose: Grabs parameters that were setup through request variables and configures ResTool
// Parameters: None
// Return: None
function initSearchParameters()
{
    if(gsVacationType == "")
    {
        gsVacationType = CommonResTool.currentComponentOrder;
    }
    // OLD dropdown population
    // populate origin dropdown (or hide it if the package contains no air)
    // CommonResTool.initOrigin(gsOrigin, gsVacationType);
    // populate destination dropdown
    // CommonResTool.initDestination(gsDestination);
    
    // NEW dropdown population
    // populate origin and destination dropdowns
    // NEW
    //CommonResTool.initOriginDestination(gsOrigin, gsDestination, gsVacationType, "main");
    
    // prefill departure date text box
    CommonResTool.initDate(gsDepartureDate, "depart");
    // prefill return date text box
    CommonResTool.initDate(gsReturnDate, "return");
    // populate default number of travelers, or user selections being returned by the booking engine (IF postNumberOfTravelers has value)
    if ( gsNumberOfTravelers != "" )
    {
        CommonResTool.initTravelers(gsNumberOfTravelers, gsAge1, gsAge2, gsAge3, gsAge4);
    }
    // populate promo code (IF postPromotionCode has value) 
    if ( gsPromotionCode != "" )
    {
        CommonResTool.initGenericField(gsPromotionCode, "gsPromotionCode", "text");
    }
}


