﻿// 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 is no changes are made to default config (1 room, 2 adults, no children)
	RoomValues.createPipeDelimitedStrings();
	
	// aryPostValues 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;
    }

    // populate origin and destination dropdowns
    //MOVED TO BOTTOM OF DealsDL.asp -- CommonResTool.initOriginDestination(gsOrigin, gsDestination, gsVacationType, "hotdeal");
    
    // 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 gsNumberOfTravelers has value)
    if ( gsNumberOfTravelers != "" )
    {
        //CommonResTool.initTravelers(gsNumberOfTravelers, gsAge1, gsAge2, gsAge3, gsAge4);
    }
    // populate promo code (IF gsPromotionCode has value) 
    if ( gsPromotionCode != "" )
    {
        CommonResTool.initGenericField(gsPromotionCode, "gsPromotionCode", "text");
    } 
}
        
