/****************************************************************************** * * Module: BookingPages/scripts * File: hotelSearch.js * Description: common hotel search routines * * Author: Andre Daniels * Copyright 2001. All rights reserved. * Email: andre@rezkey.com * Collaborators: Rich Loose, Juan Canales * * Completion Date: November 17, 2003 *****************************************************************************/ //set last geo item selected and post if not a city or airport function geoSelection(item) { var frm = document.forms[0]; frm.LastSelected.value=item; if(item!='City' && item!='AirportCode') { document.forms[0].action=document.forms[0].action + "#" + item + "ID"; document.forms[0].submit(); } } // post to a page that will then start a hotel search // search param tells page to search and must be set to yes // returnPage is where we redirect to whe a search fails\ // setSources tells page to set sources (and filters) for search function searchForHotels(page) { if(validateSelectedSources()) return; document.forms[0].action= page + ".aspx?search=yes&setSources=true&returnPage=" + page + ".aspx"; document.forms[0].submit(); } // back to basic search function gotoHotelSearch() { document.forms[0].action="HotelSearch.aspx?setSources=true"; document.forms[0].submit(); } //back to Advanced Search function gotoAdvancedSearch() { document.forms[0].action="AdvancedHotelSearch.aspx?setSources=true"; document.forms[0].submit(); } // check to see if valid sources are selected // CCRA specific, but all sites on 4.2 have these elements. // They are in a hidden div for Planet Hotel, AirPark, etc. // TODO: set alert by string table function validateSelectedSources() { if(document.forms[0].chkNET.checked==false && document.forms[0].chkDISCOUNT.checked==false && document.forms[0].chkALL.checked==false && document.forms[0].chkPROMO.checked==false && document.forms[0].chkCCRA.checked==false) { document.getElementById("dataSources_blinker").src="../clients/ccra/images/requiredbangfadegif.gif"; alert("Please select a program."); return true; } else { document.getElementById("dataSources_blinker").src="../clients/ccra/images/spacer.gif"; return false; } } function setSearchType(key) { if(key=="airportCode") { document.getElementById("searchAirportCode").disabled=false; //document.getElementById("searchCountry").value=""; //document.getElementById("searchState").value=""; //document.getElementById("searchCity").value=""; document.getElementById("searchCountry").disabled=true; document.getElementById("searchState").disabled=true; document.getElementById("searchCity").disabled=true; } if(key=="citySearch") { //document.getElementById("searchAirportCode").value=""; document.getElementById("searchAirportCode").disabled=true; document.getElementById("searchCountry").disabled=false; document.getElementById("searchState").disabled=false; document.getElementById("searchCity").disabled=false; } }