/*
 * Copyright (c) 2007 John Resig (jquery.com)
 * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Copyright (c) 2007 cody lindley
 * Copyright (c) 2007 Jörn Zaefferer
 * Copyright 2007 Yehuda Katz, Rein Henrichs
 * Copyright (c) 2007 Christian Bach
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Copyright (c) 2008, Yahoo! Inc. All rights reserved.
 * Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt
 *
 * Copyright: 2006 Mark Wubben.
 * This software is licensed and provided under the CC-GNU LGPL.
 * See <http://creativecommons.org/licenses/LGPL/2.1/>
 *
 * Copyright 2005 Joe Walker
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Copyright (c)2005-2007 Matt Kruse (javascripttoolbox.com)
 * Dual licensed under the MIT and GPL licenses.
 *
 * Copyright (C) 2008 OnSurvey Inc.
 */
/*############ Begin common/js/plug/customerSliderDefs.js ############*/
jQuery(document).ready(function(){jQuery("#pastCancellationsSlider").slider({minValue:1,maxValue:4,startValue:1,steps:4,change:function(e,ui){cxlsMonthToggle(ui.value);
}});jQuery("#pastHotelStaysSlider").slider({minValue:1,maxValue:4,startValue:1,steps:4,change:function(e,ui){staysMonthToggle(ui.value);}});jQuery("#tableEarningHistory").find("tbody").find("tr:odd").addClass("odd");jQuery("#earningHistorySlider").slider({minValue:1,maxValue:4,startValue:1,steps:4,change:function(e,ui){monthToggleEarningTab(ui.value);}});jQuery("#redemptionHistorySlider").slider({minValue:1,maxValue:4,startValue:1,steps:4,change:function(e,ui){monthToggleRedemptionTab(ui.value);}});
});
/*############ End common/js/plug/customerSliderDefs.js ############*/
/*############ Begin common/js/base.js ############*/
jQuery.noConflict();jQuery(document).ready(function($){jQuery(".jsShow").removeClass("hide");jQuery(".jsHide").hide();buttonizeAllSubmits();jQuery("a.thickbox").each(function(){var rel=jQuery(this).attr("rel");jQuery(this).attr("href",rel);});jQuery(".toggler").click(function(){var link=jQuery(this);href=link.attr("href");if(link.hasClass("collapsed")){jQuery(href).show();
link.addClass("expanded").removeClass("collapsed");}else{jQuery(href).hide();link.removeClass("expanded").addClass("collapsed");}return false;});jQuery("div.jsTabCollection").find("div.tabSection:gt(0)").hide();jQuery("div.jsTabCollection").find("ul.jsTabify li:eq(0)").addClass("on");jQuery("ul.jsTabify").addClass("ulTabs");jQuery("ul.jsTabify li a").click(function(){var onlink=jQuery(this);onlink.parents(".jsTabCollection").find("ul.jsTabify li").removeClass("on");onlink.parent("li").addClass("on");
var href=onlink.attr("href");jQuery(href).siblings("div.tabSection").hide();jQuery(href).show();return false;});});function buttonizeAllSubmits(){jQuery("input.btnSearch").each(function(){var input=jQuery(this);var txt=input.val();var click=input.attr("onclick");if(jQuery.browser.msie&&(jQuery.browser.version<=7.9)){var click=click.toString();clicklength=click.length;click=click.substring(23,clicklength-2);}input.after('<a class="btnSearch" href="#" onclick="'+click+'">'+txt+"</a>");input.addClass("hide2");
});jQuery("input.btn").each(function(){var input=jQuery(this);var txt=input.val();var click=input.attr("onclick");if(jQuery.browser.msie&&(jQuery.browser.version<=7.9)){var click=click.toString();clicklength=click.length;click=click.substring(23,clicklength-2);}input.after('<a class="btn" href="javascript:void(0)" onclick="'+click+'"><span>'+txt+"</span></a>");input.addClass("hide2");});}function openPopup(link,width,height,popupname){width=width||300;height=height||400;popupname=popupname||"popup";
if(typeof link!="string"){link=jQuery(link).attr("href");}try{window.open(link,popupname,"resizable=1,location=0,toolbar=0,scrollbars=1,width="+width+",height="+height);}catch(err){alert(err);}return false;}function clearThisField(textbox,defaultText){if(textbox.value==defaultText){textbox.value="";}}function restoreFieldText(textbox,defaultText){if(textbox.value==""){textbox.value=defaultText;}}function toggle(link){var link=jQuery(link);href=link.attr("href");if(link.hasClass("collapsed")){jQuery(href).show();
link.addClass("expanded").removeClass("collapsed");}else{jQuery(href).hide();link.removeClass("expanded").addClass("collapsed");}}var addSpecialRateCodes;
/*############ End common/js/base.js ############*/
/*############ Begin common/js/plug/account.js ############*/
var MAX_NUM_EMAIL_ADDRESSES=3;var MAX_NUM_PHONE_NUMBERS=3;var MAX_NUM_CREDIT_CARDS=10;var MAX_NUM_TRAVEL_PARTNERS=5;jQuery(document).ready(function(){jQuery("#delayMessage").hide();jQuery("#selectYourSex").hide();var myTitle=jQuery("#selectTitle").val();
handleTheSexSelect(myTitle,"0");jQuery("#selectTitle").change(function(){handleTheSexSelect(this.options[this.selectedIndex].value,"1");});jQuery("#newPasswordInputs").hide();jQuery("#newUsername").hide();jQuery("#newHhonorsPin").hide();jQuery("#createUsernamePassword").hide();jQuery("input.preferred:checked").siblings(".deleteEmail").hide();jQuery(".showForSwitchMaestro").hide();hideShowRows("email","Email",MAX_NUM_EMAIL_ADDRESSES);hideShowRows("phone","Phone",MAX_NUM_PHONE_NUMBERS);hideShowRows("payment","Payment",MAX_NUM_CREDIT_CARDS);
jQuery("a.helptip:has(span.tip)").hover(function(){jQuery(this).addClass("reveal");},function(){jQuery(this).removeClass("reveal");});jQuery("div.details").hide();jQuery("div.selectedDetails").show();jQuery("whatsThisHint").hide();jQuery(".hintContainer").hover(function(){jQuery(this).children("span.questionMarkHint").show();},function(){jQuery(this).children("span.questionMarkHint").hide();});jQuery("#travelPartner1").hide();jQuery("#travelPartner2").hide();jQuery("#travelPartner3").hide();jQuery("#travelPartner4").hide();
jQuery("#addTravelPartner2").hide();jQuery("#addTravelPartner3").hide();jQuery("#addTravelPartner4").hide();jQuery("#addTravelPartner5").hide();jQuery(".modalbody").hide();jQuery("h3.emailInterestsHeader").click(function(){emailInterests();return false;});jQuery(".togglerSlide").click(function(){var link=jQuery(this);href=link.attr("href");if(link.hasClass("collapsed")){jQuery(href).slideDown("slow");link.addClass("expanded").removeClass("collapsed");}else{jQuery(href).slideUp();link.removeClass("expanded").addClass("collapsed");
}return false;});jQuery("#enrollLanguagePreferred").change(function(){handleTheLanguagePreference(this.options[this.selectedIndex].value);});jQuery("#enrollLanguagePreferred").removeClass("hide");if(jQuery("#enrollLanguagePreferred").hasClass("emailFormLanguageSelect")){handleTheLanguagePreference(jQuery("#enrollLanguagePreferred").value);}if(jQuery("h3.emailInterestsHeader").hasClass("clear")){if(document.getElementById("unsubscribeFromMarketing").checked){disablePromos();}}});function expandAllVIP(){jQuery("#hiltonOptions").show().removeClass("collapsed").addClass("expanded");
jQuery(".hilton h2 a").removeClass("collapsed").addClass("expanded");jQuery("#embassy_suitesOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".embassy_suites h2 a").removeClass("collapsed").addClass("expanded");jQuery("#doubletreeOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".doubletree h2 a").removeClass("collapsed").addClass("expanded");jQuery("#hamptonOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".hampton h2 a").removeClass("collapsed").addClass("expanded");
jQuery("#garden_innOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".garden_inn h2 a").removeClass("collapsed").addClass("expanded");jQuery("#homewoodOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".homewood h2 a").removeClass("collapsed").addClass("expanded");jQuery("#waldorfOptions").show().removeClass("collapsed").addClass("expanded");jQuery(".waldorf h2 a").removeClass("collapsed").addClass("expanded");}function collapseAllVIP(){jQuery("#hiltonOptions").hide().removeClass("expanded").addClass("collapsed");
jQuery(".hilton h2 a").removeClass("expanded").addClass("collapsed");jQuery("#embassy_suitesOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".embassy_suites h2 a").removeClass("expanded").addClass("collapsed");jQuery("#doubletreeOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".doubletree h2 a").removeClass("expanded").addClass("collapsed");jQuery("#hamptonOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".hampton h2 a").removeClass("expanded").addClass("collapsed");
jQuery("#garden_innOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".garden_inn h2 a").removeClass("expanded").addClass("collapsed");jQuery("#homewoodOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".homewood h2 a").removeClass("expanded").addClass("collapsed");jQuery("#waldorfOptions").hide().removeClass("expanded").addClass("collapsed");jQuery(".waldorf h2 a").removeClass("expanded").addClass("collapsed");}function emailInterests(){if(jQuery("#emailInterestsToggler").hasClass("viewEmailInterests")){jQuery("div.emailInterests").slideDown();
jQuery("#emailInterestsToggler").toggleClass("closeEmailInterests").toggleClass("viewEmailInterests");}else{jQuery("div.emailInterests").slideUp();jQuery("#emailInterestsToggler").toggleClass("closeEmailInterests").toggleClass("viewEmailInterests");}}function handleTheLanguagePreference(ind){var languagePreference=jQuery("#enrollLanguagePreferred");switch(ind){case"CH":hideTheOtherLanguages();jQuery("ul.newsletterSelectCH").removeClass("hide");break;case"EN":hideTheOtherLanguages();jQuery("ul.newsletterSelectEN").removeClass("hide");
break;case"FE":hideTheOtherLanguages();jQuery("ul.newsletterSelectFE").removeClass("hide");break;case"GR":hideTheOtherLanguages();jQuery("ul.newsletterSelectGR").removeClass("hide");break;case"JA":hideTheOtherLanguages();jQuery("ul.newsletterSelectJA").removeClass("hide");break;case"SP":hideTheOtherLanguages();jQuery("ul.newsletterSelectSP").removeClass("hide");break;default:hideTheOtherLanguages();jQuery("ul.newsletterSelectNone").removeClass("hide");break;}}function hideTheOtherLanguages(){jQuery("ul.newsletterLanguageSelect").addClass("hide");
}function disablePromos(){jQuery("#unsubscribeFromMarketing").toggleClass("promosDisabled");if(jQuery("#unsubscribeFromMarketing").hasClass("promosDisabled")){jQuery("div.emailNewsletters ul li input.checkbox").attr("disabled","disabled");jQuery("div.emailInterests ul li input.checkbox").attr("disabled","disabled");}else{jQuery("div.emailNewsletters ul li input.checkbox").removeAttr("disabled");jQuery("div.emailInterests ul li input.checkbox").removeAttr("disabled");}}function showRows(number){var rows=document.getElementsByTagName("tbody");
rows=rows[0];rows=rows.getElementsByTagName("tr");if(number=="all"){number=rows.length;}for(var i=0;i<rows.length;i++){rows[i].style.display="none";}for(var i=0;i<number;i++){rows[i].style.display="";}}function showRows2(number){switch(number){case"0":showRows(0);break;case"1":showRows(3);break;case"2":showRows(5);break;case"3":showRows("all");break;}}function addFormFieldEmail(){var counterEmailId=document.getElementById("counterEmail").value;jQuery("#newEmail").append('<p id="emailRow'+counterEmailId+'" class="newEmailRow'+counterEmailId+'"><label for="newEmail'+counterEmailId+'" class="hide">Email </label><input type="text" size="20" name="newEmail" id="newEmail'+counterEmailId+'" class="text email created"> <input type="radio" id="email'+counterEmailId+'NewPreferred" name="emailPreferred" class="radio preferred" onclick="hideDeleteForPreferredEmail(this);" /><label for="email'+counterEmailId+'NewPreferred">Preferred</label> <span class="deleteEmail"><input type="checkbox" id="email'+counterEmailId+'NewDelete" class="deleteThis" onclick="toBeDeleted(this);" /><label for="email'+counterEmailId+'NewDelete" class="checkbox delete">Delete</label></span></p>');
if(!$.browser.safari){jQuery(".newEmailRow"+counterEmailId).animate({backgroundColor:"#FFFCBF"},200).animate({backgroundColor:"white"},500);}jQuery("#newEmail"+counterEmailId).focus();counterEmailId=(counterEmailId-1)+2;document.getElementById("counterEmail").value=counterEmailId;}function addFormFieldPhone(){var counterPhoneId=document.getElementById("counterPhone").value;jQuery("#newPhone").append('<p id="phoneRow'+counterPhoneId+'" class="newPhoneRow'+counterPhoneId+'"><label for="newPhone'+counterPhoneId+'" class="hide">Phone Number </label><input type="text" size="20" name="newPhone" id="newPhone'+counterPhoneId+'" class="text"> <label for="phone'+counterPhoneId+'NewSelect" class="hide">Phone Type</label><select class="select"><option selected="selected">Select</option><option>Home</option><option>Work</option><option>Mobile</option></select> <input type="radio" id="phone'+counterPhoneId+'NewPreferred" name="phonePreferred" class="radio" /><label for="phone'+counterPhoneId+'NewPreferred">Preferred</label> <span class="delete"><input type="checkbox" id="phone'+counterPhoneId+'NewDelete" class="deleteThis" onclick="toBeDeleted(this);" /><label for="phone'+counterPhoneId+'NewDelete" class="checkbox delete">Delete</label></span></p>');
jQuery(".newPhoneRow"+counterPhoneId).animate({backgroundColor:"#FFFCBF"},200).animate({backgroundColor:"white"},500);jQuery("#newPhone"+counterPhoneId).focus();counterPhoneId=(counterPhoneId-1)+2;document.getElementById("counterPhone").value=counterPhoneId;}function addFormFieldPayment(){var counterPaymentId=document.getElementById("counterPayment").value;jQuery("#newPayment").append('<p id="paymentRow'+counterPaymentId+'" class="newPaymentRow'+counterPaymentId+'"><label for="newPaymentType'+counterPaymentId+'" class="hide">Type</label><select id="newPaymentType'+counterPaymentId+'" class="select"><option selected="selected">Select</option><option>American Express</option><option>Mastercard</option><option>Visa</option><option>Discover</option><option>Carte Blanche</option><option>Diner&rsquo;s Club</option><option>HHonors Amex Swedish/Finnish Cobrand Card</option><option>Honors Plat Mastercard-HFC</option><option>HHonors Platinum Card for American Express</option><option>HHonors Visa Signature Card from Citibank</option><option>HHonors Visa Sumitomo</option><option>JAL Mileage Bank Mastercard</option><option>JCB</option></select><label for="newPaymentNumber'+counterPaymentId+'">Number </label><input type="text" id="newPaymentNumber'+counterPaymentId+'" class="text" value="" class="text" /> <label for="newPaymentExpiration'+counterPaymentId+'">Expiry (MM/YY)</label> <input type="text" id="newPaymentExpiration'+counterPaymentId+'" class="text short" maxlength="5" /> <input type="radio" id="newPayment'+counterPaymentId+'Preferred" class="radio" value="newPayment'+counterPaymentId+'Preferred" name="paymentPreferred" class="radio" /><label for="newPayment'+counterPaymentId+'Preferred">Preferred</label> <span class="delete"><input type="checkbox" id="newPayment'+counterPaymentId+'Delete" class="deleteThis" onclick="toBeDeleted(this);" /><label for="newPayment'+counterPaymentId+'Delete" class="checkbox delete">Delete</label></span></p>');
jQuery(".newPaymentRow"+counterPaymentId).animate({backgroundColor:"#FFFCBF"},200).animate({backgroundColor:"white"},500);jQuery("#newPaymentType"+counterPaymentId).focus();counterPaymentId=(counterPaymentId-1)+2;document.getElementById("counterPayment").value=counterPaymentId;}function showCreateUsernamePassword(){jQuery("#createUsernamePassword").show();jQuery("span#createUsernamePasswordLink").hide();jQuery("#createUsernameAndPasswordArea").hide();jQuery("#createUsernamePassword").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);
jQuery("#createUsername").focus();}function showChangeUsername(){jQuery("#newUsername").show();jQuery("span#changeUsernameLink").hide();jQuery("p#currentUsername").hide();jQuery("#usernameHelp").hide();jQuery("#newUsername").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);jQuery("#username").focus();document.getElementById("usernameArea").value="true";}function showSelectCountry(){jQuery("select#selectCountry").show();var currentCountryIndex=jQuery("select#selectCountry")[0].selectedIndex;
jQuery("span#changeCountryLink").hide();jQuery("p#changeCountry").append('<span id="cancelChangeCountryLink"><a href="#" onclick="cancelChangeCountry('+currentCountryIndex+'); return false;">Cancel</a></span>');jQuery("#changeCountry").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);}function cancelChangeCountry(previouslySelectedCountryIndex){jQuery("span#cancelChangeCountryLink").remove();jQuery("span#changeCountryLink").show();jQuery("select#selectCountry")[0].options[previouslySelectedCountryIndex].selected=true;
jQuery("select#selectCountry").hide();}function personalInformationUsernameChangeCancel(){jQuery("#newUsername").hide();jQuery("#createReservationUsername").val("");jQuery("#newPassword").val("");jQuery("#verifyPassword").val("");jQuery("#currentUsername").show();jQuery("#changeUsernameLink").show();document.getElementById("usernameArea").value="false";}function personalInformationCreateUsernamePasswordCancel(){jQuery("#createUsernamePassword").hide();jQuery("span#createUsernamePasswordLink").show();
jQuery("#createUsernameAndPasswordArea").show();}function personalInformationCurrentPasswordChange(){jQuery("#newPasswordInputs").show();jQuery("#currentPassword a").hide();jQuery("#currentPassword").hide();jQuery("#password").focus();jQuery("#newPasswordInputs").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);document.getElementById("passwordArea").value="true";}function personalInformationCurrentPasswordChangeCancel(){jQuery("#newPasswordInputs").hide();jQuery("#currentPassword").show();
jQuery("#currentPassword a").show();document.getElementById("passwordArea").value="false";}function personalInformationCurrentPinChange(){jQuery("#newHhonorsPin").show();jQuery("#currentPin").hide();jQuery("#newHhonorsPin").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);document.getElementById("pinArea").value="true";}function personalInformationCurrentPinChangeCancel(){jQuery("#newHhonorsPin").hide();jQuery("#currentPin").show();document.getElementById("pinArea").value="false";
}function hideDeleteForPreferredEmail(element){var $mycheckedradio=jQuery(element);jQuery(".deleteEmail").show();$mycheckedradio.siblings(".deleteEmail").hide();$mycheckedradio.siblings(".deleteEmail").children().removeAttr("checked");$mycheckedradio.parent().removeClass("toBeDeleted").removeAttr("style","background-color:pink");$mycheckedradio.siblings(".deleteEmail").children().removeAttr("onClick").attr("onClick","toBeDeleted(this)");}function toBeDeleted(element){var $mycheckbox=jQuery(element);
if($mycheckbox.attr("checked")){$mycheckbox.parent().parent().addClass("toBeDeleted").attr("style","background-color:pink;");}else{$mycheckbox.parent().parent().removeClass("toBeDeleted").removeAttr("style");}}function doubleDipAddTravelPartner(index){var nextIndex=index+1;jQuery("#travelPartner"+index).show();jQuery("#addTravelPartner"+index).hide();if(index<MAX_NUM_TRAVEL_PARTNERS){jQuery("#addTravelPartner"+nextIndex).show();}jQuery("#parterName"+index).focus();jQuery("#travelPartner"+index).animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);
}function doubleDipChangeEarningStyle(){jQuery("#delayMessage").show();alert("this should be a pop-up to third-party site for changing your earning style");}function handleTheSexSelect(ind,flag){switch(ind){case"male":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=1;break;case"female":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=2;break;case"MR":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=1;
break;case"MRS":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=2;break;case"MISS":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=2;break;case"MS":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=2;break;case"PROF":if(G_LOCALE=="de_DE"){document.getElementById("selectSex").selectedIndex=1;break;}jQuery("#selectYourSex").fadeIn();if(flag=="1"){document.getElementById("selectSex").selectedIndex=0;
}jQuery("#selectSex").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);break;case"DR":if(G_LOCALE=="de_DE"){document.getElementById("selectSex").selectedIndex=1;break;}jQuery("#selectYourSex").fadeIn();if(flag=="1"){document.getElementById("selectSex").selectedIndex=0;}jQuery("#selectSex").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);break;case"PROFF":document.getElementById("selectSex").selectedIndex=2;break;case"DRF":document.getElementById("selectSex").selectedIndex=2;
break;case"unknown":jQuery("#selectYourSex").fadeIn();document.getElementById("selectSex").selectedIndex=0;jQuery("#selectSex").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);break;case"":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=0;break;case"SELECT":jQuery("#selectYourSex").fadeOut();document.getElementById("selectSex").selectedIndex=0;break;}}function decideIfItIsSwitchMaestro(element){var myPaymentMethod=jQuery(element).val();
if(myPaymentMethod=="SW"){jQuery(element).parent().siblings(".showForSwitchMaestro").show().animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);}else{jQuery(element).parent().siblings(".showForSwitchMaestro").hide();}}function personalInformationAddNewEmail(index){var nextIndex=index+1;jQuery("#emailRow"+index).show();jQuery("#addNewEmail"+index).hide();if(index<MAX_NUM_EMAIL_ADDRESSES){jQuery("#addNewEmail"+nextIndex).show();}jQuery("#email"+index).focus();jQuery("#emailRow"+index).animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);
}function personalInformationAddNewPhone(index){var nextIndex=index+1;jQuery("#phoneRow"+index).show();jQuery("#addNewPhone"+index).hide();if(index<MAX_NUM_PHONE_NUMBERS){jQuery("#addNewPhone"+nextIndex).show();}jQuery("#phone"+index).focus();jQuery("#phoneRow"+index).animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);}function personalInformationMyCountry(){jQuery("#changeCountry").show();jQuery("#myCountry").hide();jQuery("#changeCountry select").show();jQuery("#selectCountry").animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);
}function personalInformationAddNewPayment(index){var nextIndex=index+1;jQuery("#paymentRow"+index).show();jQuery("#addNewPayment"+index+" a").hide();if(index<MAX_NUM_CREDIT_CARDS){jQuery("#addNewPayment"+nextIndex).show();}jQuery("#paymentRow"+index).animate({backgroundColor:"#FFFCBF"},0).animate({backgroundColor:"white"},1000);}function upcomingReservationsClickExpand(el){var el=jQuery(el);if(el.hasClass("selectedExpand")){el.siblings(".details").slideUp();el.siblings(".details").removeClass("selectedDetails");
el.removeClass("selectedExpand");}else{el.addClass("selectedExpand");jQuery("a.selectedExpand").siblings(".details").addClass("selectedDetails");jQuery(".selectedDetails").slideDown();}return false;}function hideShowRows(element,Element,max){var row="#"+element+"Row";var anchor="#addNew"+Element;var showIndex="-1";for(var i=0;i<max;i++){var index=element+i;if(document.getElementById(index)!=null){if(document.getElementById(index).value==""&&i>0){var hideThisRow=row+i;jQuery(hideThisRow).hide();if(showIndex=="-1"){showIndex=i;
}}var hideThisAnchor=anchor+i;jQuery(hideThisAnchor).hide();}}if(showIndex!="-1"){var showThis=anchor+showIndex;jQuery(showThis).show();}}function upcomingReservationsExpandAllUpcoming(){jQuery(".details").slideDown();jQuery(".selectedDetails").removeClass("selectedDetails");jQuery(".clickExpand").addClass("selectedExpand");return false;}function upcomingReservationsCollapseAllUpcoming(){jQuery(".selectedExpand").removeClass("selectedExpand");jQuery(".selectedDetails").removeClass("selectedDetails");
jQuery(".details").slideUp();return false;}function createSlideBar(id,month){jQuery(id).slider({minValue:1,maxValue:4,startValue:month,steps:4,change:function(e,ui){monthToggle(ui.value);}});}function buildArray(count,arrivalDate,departDate,confirmNum,cancelDate,url,rebookText,miles,folioText,folioURL,i){var tempArr=new Array(count,arrivalDate,departDate,confirmNum,cancelDate,url,rebookText,miles,folioText,folioURL);values[i]=tempArr;}function monthToggleEarningTab(months){showUpdatingMessage();addressfile=G_CONTEXT_PATH+"/com/hilton/hiway/portlets/customer/hhonors/hhonorsActivity/filterEarningHistory.do";
paramData={filteredMonths:months*3};jQuery("#earningHistoryData").load(addressfile,paramData,hideUpdatingMessage);}function showUpdatingMessage(){jQuery("#updatingBlockOverlay").show();jQuery("#updatingBlock").show();}function hideUpdatingMessage(){jQuery("#updatingBlockOverlay").hide();jQuery("#updatingBlock").hide();}function monthToggleRedemptionTab(months){showUpdatingMessage();addressfile=G_CONTEXT_PATH+"/com/hilton/hiway/portlets/customer/hhonors/hhonorsActivity/filterRedemptionHistory.do";
paramData={filteredMonths:months*3};jQuery("#redemptionHistoryData").load(addressfile,paramData,hideUpdatingMessage);}function cxlsMonthToggle(months){showUpdatingMessage();addressfile=G_CONTEXT_PATH+"/com/hilton/hiway/portlets/customer/account/pastStaysAndCancellations/filter.do";paramData={filteredMonths:months*3,portletType:"pastCancellations"};jQuery("#pastCancellationsData").load(addressfile,paramData,hideUpdatingMessage);}function staysMonthToggle(months){showUpdatingMessage();addressfile=G_CONTEXT_PATH+"/com/hilton/hiway/portlets/customer/account/pastStaysAndCancellations/filter.do";
paramData={filteredMonths:months*3,portletType:"pastStays"};jQuery("#pastStaysData").load(addressfile,paramData,ajaxPopup);}function ajaxPopup(){if(!document.getElementsByTagName){return false;}var lnks=document.getElementsByTagName("a");for(var i=0;i<lnks.length;i++){if(lnks[i].className=="popup"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){openPopup(this.getAttribute("href"));return false;};}}hideUpdatingMessage();}function checkUsername(){if(document.getElementById("createReservationUsername")!=null){var username=document.getElementById("createReservationUsername").value;
var origusername=document.getElementById("origUsername");if(origusername!=null&&origusername.value.toUpperCase()==username.toUpperCase()){return false;}if(username.length>3&&isNaN(username.charAt(0))){AccountUtils.isUserNameAlreadyInUse(username,showErrorMessage);}}}function ajaxLogin(){var username=document.getElementById("logInUserHhonors").value;var password=document.getElementById("logInPassPin").value;if(username!=null&&password!=null){AccountUtils.ajaxLogin(username,password,document.getElementById("signInRememberMe").checked);
}}function showErrorMessage(flag){var errorDiv=document.getElementById("dwrError");if(flag==true){errorDiv.className="errorListing";jQuery("#createReservationUsername").select();jQuery("#createReservationUsername").focus();}else{errorDiv.className="hide";}}function clearMessage(){var errorDiv=document.getElementById("dwrError");if(errorDiv.className=="errorListing"){errorDiv.className="hide";}}function showHelperMessageForLanguageChange(defaultValue){var newValue=jQuery("select#personalInformationDefaultLanguage").val();
jQuery("div.personalInformationDefaultLanguageChange").hide();if(defaultValue!=newValue){jQuery("#"+newValue).show();}}function formatPaymentExpField(expDateField){jQuery(expDateField).val(formatMY(jQuery(expDateField).val()));}function formatMY(str){var my=new Array();if(str.indexOf("\\")!=-1){my=str.split("\\");}else{if(str.indexOf("/")!=-1){my=str.split("/");}else{if(str.indexOf(".")!=-1){my=str.split(".");}else{if(str.indexOf("-")!=-1){my=str.split("-");}else{return str;}}}}if(my[0]!=null&&my[1]!=null){if(my[0].length<2){my[0]="0"+my[0];
}if(my[1].length<3){if(my[1].length==1){my[1]="0"+my[1];}if(my[1].charAt(0)!="9"&&my[1].charAt(0)!="8"){my[1]="20"+my[1];}else{my[1]="19"+my[1];}}var show=my[0]+"/"+my[1];return show;}else{return str;}}function setClientDate(ele){jQuery(ele).val(new Date().getTime());}function combineYearMonth(index){var m=jQuery("#expDateMonth"+index).val();var y=jQuery("#expDateYear"+index).val();jQuery("#expDate"+index).val(m+"/"+y);}function restrictDayValues(dayField,yearMonthField){var objDay=document.getElementById(dayField);
if(!objDay){return ;}var selectedDay=objDay.options[objDay.selectedIndex].value;var maxDayOptions=objDay.options.length;var objYearMonth=document.getElementById(yearMonthField);if(!objYearMonth){return ;}var ym=objYearMonth.options[objYearMonth.selectedIndex].value.split("/");var yearVal=ym[0];var monthVal=ym[1];if(maxDayOptions=="31"&&(monthVal=="1"||monthVal=="3"||monthVal=="5"||monthVal=="7"||monthVal=="8"||monthVal=="10"||monthVal=="12")){return ;}for(var loop=maxDayOptions-1;loop>=0;loop--){objDay.remove(loop);
}var dateVal=YAHOO.widget.DateMath.getDate(yearVal,(monthVal-1));var maxDateOfMonth=YAHOO.widget.DateMath.findMonthEnd(dateVal).getDate();for(var loop=1;loop<=maxDateOfMonth;loop++){objDay.options[(loop-1)]=new Option(addLeadingZero(loop)+G_JP_DATE_FORMAT_DAY_SUFFIX,loop);}if(selectedDay<=maxDateOfMonth){objDay.selectedIndex=selectedDay-1;}else{objDay.selectedIndex=maxDateOfMonth-1;}}function updateDepartureRange(checkinDayField,checkinYearMonthField,checkoutDayField,checkoutYearMonthField,isMonthChanged){var objCheckinDay=document.getElementById(checkinDayField);
var selectedCheckinDay=objCheckinDay.options[objCheckinDay.selectedIndex].value;var objCheckinYearMonth=document.getElementById(checkinYearMonthField);var selectedCheckinYearMonth=objCheckinYearMonth.options[objCheckinYearMonth.selectedIndex].value.split("/");var selectedCheckinDate=YAHOO.widget.DateMath.getDate(selectedCheckinYearMonth[0],(selectedCheckinYearMonth[1]-1),selectedCheckinDay);var objCheckoutYearMonth=document.getElementById(checkoutYearMonthField);var selectedCheckoutYearMonth=objCheckoutYearMonth.options[objCheckoutYearMonth.selectedIndex].value;
for(var loop=36;loop>=0;loop--){objCheckoutYearMonth.remove(loop);}var depRange=0;if(checkinDayField.startsWith("search")){depRange=YAHOO.search.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE;}else{depRange=YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE;}var maxCheckoutDate=YAHOO.widget.DateMath.add(selectedCheckinDate,YAHOO.widget.DateMath.DAY,depRange);var tempDate=YAHOO.widget.DateMath.findMonthStart(selectedCheckinDate);var count=0;while(tempDate<=maxCheckoutDate){var tempMonth=tempDate.getMonth()+1;
objCheckoutYearMonth.options[count]=new Option(tempDate.getFullYear()+G_JP_DATE_FORMAT_YEAR_SUFFIX+addLeadingZero(tempMonth)+G_JP_DATE_FORMAT_MONTH_SUFFIX,tempDate.getFullYear()+"/"+tempMonth);if(selectedCheckoutYearMonth==tempDate.getFullYear()+"/"+tempMonth){objCheckoutYearMonth.selectedIndex=count;}tempDate=YAHOO.widget.DateMath.add(tempDate,YAHOO.widget.DateMath.MONTH,1);count++;}if(isMonthChanged){restrictDayValues(checkinDayField,checkinYearMonthField);restrictDayValues(checkoutDayField,checkoutYearMonthField);
}}function addLeadingZero(val){val+="";if(val.length==1){return"0"+val;}return val;}
/*############ End common/js/plug/account.js ############*/
/*############ Begin common/js/plug/addressSwitcheroo.js ############*/
var addressFormPath=G_CONTEXT_PATH+"/portlets/common/address/addressForms/inc_address_";var existingAddressForms=new Array("GB","US","JP","DE","CA","AT","CH");jQuery(document).ready(function(){jQuery("#changeCountry").hide();});function handleTheAddressTypeSelect(ind){var divAddressFields=jQuery("#divAddressFields");
switch(ind){case"B":divAddressFields.removeAttr("class").addClass("addressTypeWork");jQuery(".companyParagraph").show().animate({backgroundColor:"gold"},200).animate({backgroundColor:"white"},500);break;default:divAddressFields.removeAttr("class").addClass("addressTypeHome");jQuery(".company").val("");jQuery(".companyParagraph").hide();}}function showTheAppropriateAddressFields(selectdd,callback){var addressfile=addressFormPath+"default.jsp";var divAddressFields=jQuery("#divAddressFields");var countryCode=jQuery(selectdd).val();
var us_state_val="";var ca_province_val="";if(countryCode=="US"){us_state_val=getFieldValue("state");}else{if(countryCode=="CA"){ca_province_val=getFieldValue("state");}}var paramData={street1:getFieldValue("street1"),us_state:us_state_val,ca_province:ca_province_val,state:getFieldValue("state"),street2:getFieldValue("street2"),postalCode:getFieldValue("postalCode"),company:getFieldValue("company"),city:getFieldValue("city"),street1InKatakana:getFieldValue("street1InKatakana"),street2InKatakana:getFieldValue("street2InKatakana"),cityInKatakana:getFieldValue("cityInKatakana"),stateInKatakana:getFieldValue("stateInKatakana"),companyInKatakana:getFieldValue("companyInKatakana"),addressError:getFieldValue("addressError"),invalidCharError:getFieldValue("invalidCharError"),invalidCharacterFields:getFieldValue("invalidCharacterFields"),zipError:getFieldValue("zipError"),addressErrorInvalidCharacters:getFieldValue("addressErrorInvalidCharacters"),requiredErrorPresent:getFieldValue("requiredErrorPresent")};
if(customAddressFormExists(countryCode)){addressfile=addressFormPath+countryCode+".jsp";}if(divAddressFields.hasClass("addressTypeHome")){divAddressFields.load(addressfile,paramData,function(){jQuery(".companyParagraph").hide();jQuery(".company").val("");AccountUtils.hasPostalCodeField(countryCode,showHidePostalCodeField);showHideAddress_textRequired(textRequiredSymbol_Bool);if(callback){callback();}});}else{divAddressFields.load(addressfile,paramData,function(){AccountUtils.hasPostalCodeField(countryCode,showHidePostalCodeField);
showHideAddress_textRequired(textRequiredSymbol_Bool);if(callback){callback();}});}}function getFieldValue(fieldName){var value=jQuery("#"+fieldName).val();return(value!=undefined)?value:"";}function showHidePostalCodeField(flag){if(flag){jQuery("#postalCodeInput").show();}else{jQuery("#postalCodeInput").val("").hide();}}function showHideAddress_textRequired(flag){if(flag){jQuery(".textRequired").hide();}}function customAddressFormExists(code){for(var i=0;i<existingAddressForms.length;i++){if(code==existingAddressForms[i]){return true;
}}return false;}function changeMyCountry(){jQuery("#changeCountry").show();jQuery("#myCountry").hide();jQuery("#changeCountry select").show();}function changeCountryEmailForm(){var countryCode=jQuery("#selectCountry").children("option[selected]").val();AccountUtils.hasPostalCodeField(countryCode,showHidePostalCodeField);}function populateAddress(){MappingUtils.findAddress(jQuery("#postalCode").val(),{callback:populateAddressValues});}function populateAddressValues(addressMap){if((addressMap!=undefined&&addressMap!=""&&addressMap!="null")){var addressInKanji=addressMap.Hani;
var addressInKana=addressMap.Kana;jQuery("#street1").val(addressInKanji.county);jQuery("#street2").val(addressInKanji.street2);jQuery("#city").val(addressInKanji.city);jQuery("#state").val(addressInKanji.state);jQuery("#company").val(addressInKanji.company);jQuery("#street1InKatakana").val(addressInKana.county);jQuery("#street2InKatakana").val(addressInKana.street2);jQuery("#cityInKatakana").val(addressInKana.city);jQuery("#stateInKatakana").val(addressInKana.state);jQuery("#companyInKatakana").val(addressInKana.company);
}else{jQuery("#street1").val("");jQuery("#street2").val("");jQuery("#city").val("");jQuery("#state").val("");jQuery("#company").val("");jQuery("#street1InKatakana").val("");jQuery("#street2InKatakana").val("");jQuery("#cityInKatakana").val("");jQuery("#stateInKatakana").val("");jQuery("#companyInKatakana").val("");showAddressErrorMessage(true);}}function handleProfileTypeSelect(profileType){if(profileType=="hhonors"){jQuery(".textRequired").show();}else{jQuery(".textRequired").hide();}}function showAddressErrorMessage(flag){var errorDiv=document.getElementById("dwrAddressError");
if(flag==true){errorDiv.className="errorListing";}else{errorDiv.className="hide";}}function populateAddressForWeddingEnquiry(){MappingUtils.findAddress(jQuery("#werf_postcode").val(),{callback:populateAddressValuesForWedding});}function populateAddressValuesForWedding(addressMap){if((addressMap!=undefined&&addressMap!=""&&addressMap!="null")){var addressInKanji=addressMap.Hani;jQuery("#werf_buildingNameNumber").val(addressInKanji.street2);jQuery("#werf_districtNumber").val(addressInKanji.county);
jQuery("#werf_ward").val(addressInKanji.city);jQuery("#werf_prefecture").val(addressInKanji.state);postcodeSearchFlag=false;}else{jQuery("#werf_buildingNameNumber").val("");jQuery("#werf_districtNumber").val("");jQuery("#werf_ward").val("");jQuery("#werf_prefecture").val("");showAddressErrorMessage(true);postcodeSearchFlag=true;}}
/*############ End common/js/plug/addressSwitcheroo.js ############*/
/*############ Begin common/js/plug/customerservice.js ############*/
jQuery(document).ready(function(){var myEnquiry=jQuery("select#csvEnquiryType").val();
handleTheEnquiryType(myEnquiry);jQuery("select#csvEnquiryType").change(function(){handleTheEnquiryType(this.options[this.selectedIndex].value);});jQuery("div.csvRatesClaim").hide();jQuery("#csvRatesClaimCountry").hide();jQuery("div#hiddenSubmitButton").hide();});function handleTheEnquiryType(ind){var pathToForms=G_CONTEXT_PATH+"/portlets/customer/customerService/contact/contactForms/inc_contact_";var paramData={countryCode:jQuery("#countryCode").val(),freqFlyerNumber:jQuery("#freqFlyerNumber").val(),confNum:jQuery("#confNum").val(),hotelName:jQuery("#hotelName").val(),arrDate:jQuery("#arrDate").val(),depDate:jQuery("#depDate").val(),comments:jQuery("#comments").val(),arrDateDay:jQuery("#arrDateDay").val(),arrDateYearMonth:jQuery("#arrDateYearMonth").val(),depDateDay:jQuery("#depDateDay").val(),depDateYearMonth:jQuery("#depDateYearMonth").val()};
if(ind){jQuery("#csvAddFormContent").load(pathToForms+ind+".jsp",paramData,function(){jQuery("a.thickbox").each(function(){var rel=jQuery(this).attr("rel");jQuery(this).attr("href",rel);});if("technicalSupport"==ind){executeHardwareInformation();}else{if("recentStayComments"==ind){YAHOO.customer.cal.init();jQuery("#csvConfirmationNumber").focus();if(G_LOCALE=="ja_JP"){updateDepartureRange("custCheckinDay","custCheckinYearMonth","custCheckoutDay","custCheckoutYearMonth",true);}}}jQuery("div#hiddenSubmitButton").show();
jQuery("p#natureOfEnqMsg").hide();});}else{jQuery("div#csvAddFormContent").empty();jQuery("div#hiddenSubmitButton").hide();jQuery("p#natureOfEnqMsg").show();}}function executeHardwareInformation(){var OSNumber=1;var browser=8;var compType=3;var version=navigator.appVersion.substring(0,3);var userAgent=navigator.userAgent;if(userAgent.indexOf("MSIE")!=-1){var start=navigator.appVersion.indexOf("MSIE")+5;var version=navigator.appVersion.substring(start,start+3);browser=1;}else{if(userAgent.indexOf("Firefox")!=-1){browser=2;
if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){version=new Number(RegExp.$1);}}else{if(userAgent.indexOf("Netscape")!=-1){browser=3;}else{if(userAgent.indexOf("seamonkey")!=-1){browser=4;}else{if(userAgent.indexOf("Safari")!=-1){browser=5;}else{if(userAgent.indexOf("Opera")!=-1){browser=6;}else{if(userAgent.indexOf("WebTV")!=-1){browser=7;}else{browser=8;}}}}}}}if(userAgent.indexOf("Win")!=-1){if(userAgent.indexOf("NT")!=-1){var winVersion=userAgent.substring(userAgent.indexOf("NT")+3,userAgent.indexOf("NT")+6);
if(winVersion>5.1){OSNumber=1;}if(winVersion==5.2){OSNumber=2;}if(winVersion==5.1){OSNumber=3;}if(winVersion<5.1){OSNumber=4;}if(winVersion==4){OSNumber=5;}}else{if(userAgent.indexOf("98")!=-1){OSNumber=6;}else{if(userAgent.indexOf("95")!=-1){OSNumber=7;}else{OSNumber=11;}}}compType=1;}else{if(userAgent.indexOf("Mac")!=-1){OSNumber=1;compType=2;}else{if(userAgent.indexOf("Linux")!=-1){OSNumber=1;}else{if(userAgent.indexOf("SCO")!=-1){OSNumber=2;}else{OSNumber=3;}}}}document.getElementById("csvComputerType").selectedIndex=compType;
var osTag=changeOSType();document.getElementById(osTag).selectedIndex=OSNumber;document.getElementById("csvBrowserName").selectedIndex=browser;document.getElementById("csvBrowserVersion").value=version;}function changeOSType(){jQuery("#csvOperatingSystem").hide();jQuery("#csvWindowsOperatingSystem").hide();jQuery("#csvMacOperatingSystem").hide();jQuery("#csvUnixOperatingSystem").hide();var ind=jQuery("select#csvComputerType").val();switch(ind){case"PC":jQuery("#csvWindowsOperatingSystem").show();
document.getElementById("csvWindowsOperatingSystem").selectedIndex=0;return"csvWindowsOperatingSystem";break;case"Apple":jQuery("#csvMacOperatingSystem").show();document.getElementById("csvMacOperatingSystem").selectedIndex=0;return"csvMacOperatingSystem";break;case"Unix":jQuery("#csvUnixOperatingSystem").show();document.getElementById("csvUnixOperatingSystem").selectedIndex=0;return"csvUnixOperatingSystem";break;}jQuery("#csvOperatingSystem").show();document.getElementById("csvOperatingSystem").selectedIndex=0;
return"csvOperatingSystem";}function csvBestRatesClaimForm(){jQuery("div.csvRatesClaim").show();jQuery("div.csvBestRatesInfo").hide();}function csvBestRatesClaimInfo(){jQuery("div.csvRatesClaim").hide();jQuery("div.csvBestRatesInfo").show();}function csvRatesClaimChangeMyCountry(){jQuery("#csvRatesClaimCountry").show();jQuery("#csvRatesClaimMyCountry").hide();jQuery("select#csvRatesClaimSelectCountry").animate({backgroundColor:"gold"},0).animate({backgroundColor:"white"},1000);return false;}function limitText(limitField){var limitNum=2000;
var remainingChar=limitNum-limitField.value.length;document.getElementById("remainingCharacters").innerHTML=remainingChar;}function chooseStay(confirmationNumber,arrivalDate,departDate,hotelName,hotelCity,bookedAmount,currencyCode,lengthOfStay,numberOfGuests){jQuery("#csvConfirmationNumber").val(confirmationNumber);jQuery("#custCheckin").val(arrivalDate);jQuery("#custCheckout").val(departDate);if(G_LOCALE=="ja_JP"){var arrArray=arrivalDate.split("/");jQuery("#custCheckinDay").attr("selectedIndex",arrArray[1]-1);
var arrYearMonthBox=document.getElementById("custCheckinYearMonth");var arrMon=arrArray[0];var arrYMCombo=arrArray[2]+"/"+arrMon;if(arrMon.startsWith("0")){arrYMCombo=arrArray[2]+"/"+arrMon.substr(1,1);}if(arrYearMonthBox){for(var y=0;y<arrYearMonthBox.options.length;y++){if(arrYearMonthBox.options[y].value==arrYMCombo){arrYearMonthBox.selectedIndex=y;break;}}}var depArray=departDate.split("/");jQuery("#custCheckoutDay").attr("selectedIndex",depArray[1]-1);var depYearMonthBox=document.getElementById("custCheckoutYearMonth");
if(depYearMonthBox!=null){updateDepartureRange("custCheckinDay","custCheckinYearMonth","custCheckoutDay","custCheckoutYearMonth",true);var depMon=depArray[0];var depYMCombo=depArray[2]+"/"+depMon;if(depMon.startsWith("0")){depYMCombo=depArray[2]+"/"+depMon.substr(1,1);}for(var y=0;y<depYearMonthBox.options.length;y++){if(depYearMonthBox.options[y].value==depYMCombo){depYearMonthBox.selectedIndex=y;break;}}}else{restrictDayValues("custCheckinDay","custCheckinYearMonth");}}jQuery("#csvHotelName").val(hotelName);
jQuery("#csvRatesClaimHotelLocation").val(hotelCity);jQuery("#csvRatesClaimRoomBookAmount").val(bookedAmount);jQuery("#csvRatesClaimRoomBookedCurrency").val(currencyCode);jQuery("#csvRatesClaimNightsBooked").val(lengthOfStay);jQuery("#csvRatesClaimNumberOfGuests").val(numberOfGuests);return false;}function chooseHotel(hotelName,hotelCity){jQuery("#csvHotelName").val(hotelName);jQuery("#csvRatesClaimHotelLocation").val(hotelCity);return false;}String.prototype.startsWith=function(str){return(this.match("^"+str)==str);
}
/*############ End common/js/plug/customerservice.js ############*/
/*############ Begin common/js/plug/faq.js ############*/
;jQuery(document).ready(function(){jQuery(".faqShortAnswer").hide();jQuery(".faqShortAnswerContainer").hover(function(){jQuery(this).children().children(".faqShortAnswerPop").removeClass("hide");},function(){jQuery(this).children().children(".faqShortAnswerPop").addClass("hide");});});function faqToggler(el){var el=jQuery(el);if(jQuery(el).parent().hasClass("faqQuestionClicked")){jQuery(el).siblings(".faqShortAnswer").slideUp();
jQuery(el).parent().removeClass("faqQuestionClicked");}else{jQuery(el).parent().addClass("faqQuestionClicked");jQuery(el).siblings(".faqShortAnswer").slideDown();}}
/*############ End common/js/plug/faq.js ############*/
/*############ Begin common/js/plug/sonar.js ############*/
jQuery(document).ready(function(){var sonarContainer=jQuery("div.sonarContainer");var sonarElements=jQuery("div.sonarContainer").children();var sonarFirst=jQuery("div.sonarContainer").children(":first");var sonarLast=jQuery("div.sonarContainer").children(":last");
var sonarCurrent=jQuery("div.sonarContainer").children("current");sonarElements.hide();sonarFirst.show();});var sonarTimer=setInterval("showNextSonarElement();",10000);function showNextSonarElement(){if(jQuery("div.sonarContainer").children(":visible").is(":last-child")){jQuery("div.sonarContainer").children(":last-child").hide();jQuery("div.sonarContainer").children(":first-child").fadeIn("fast");}else{jQuery("div.sonarContainer").children(":visible").hide().next().fadeIn("fast");}}function showNextSonarElementLink(){if(jQuery("div.sonarContainer").children(":visible").is(":last-child")){jQuery("div.sonarContainer").children(":last-child").hide();
jQuery("div.sonarContainer").children(":first-child").fadeIn("fast");}else{jQuery("div.sonarContainer").children(":visible").hide().next().fadeIn("fast");}clearInterval(sonarTimer);sonarTimer=setInterval("showNextSonarElement();",10000);}function showPrevSonarElement(){if(jQuery("div.sonarContainer").children(":visible").is(":first-child")){jQuery("div.sonarContainer").children(":first-child").hide();jQuery("div.sonarContainer").children(":last-child").fadeIn("fast");}else{jQuery("div.sonarContainer").children(":visible").hide().prev().fadeIn("fast");
}}function showPrevSonarElementLink(){if(jQuery("div.sonarContainer").children(":visible").is(":first-child")){jQuery("div.sonarContainer").children(":first-child").hide();jQuery("div.sonarContainer").children(":last-child").fadeIn("fast");}else{jQuery("div.sonarContainer").children(":visible").hide().prev().fadeIn("fast");}clearInterval(sonarTimer);sonarTimer=setInterval("showNextSonarElement();",10000);}
/*############ End common/js/plug/sonar.js ############*/
/*############ Begin common/js/plug/footer.js ############*/
jQuery(document).ready(function(){SetupTooltips();
var footerSearch=jQuery("input:text#footerSearch");footerSearch.each(function(){if(this.value==""){this.value=this.title;}});footerSearch.focus(function(){if(this.value==this.title){this.value="";}});footerSearch.blur(function(){if(this.value==""){this.value=this.title;}});jQuery(document).keydown(function(e){if(e.which==27){footerSearch.blur();}});});function showBrands(){jQuery("#brandSelections").show();}ShowTooltip=function(e){var text=jQuery(this).next(".show-tooltip-text");if(text.attr("class")!="show-tooltip-text"){return false;
}text.fadeIn();return false;};HideTooltip=function(e){var text=jQuery(this).next(".show-tooltip-text");if(text.attr("class")!="show-tooltip-text"){return false;}text.fadeOut();};SetupTooltips=function(){jQuery(".show-tooltip").each(function(){jQuery(this).after(jQuery("<div></div>").attr("class","show-tooltip-text").html(jQuery(this).attr("title")).wrapInner("<p></p>")).attr("title","");}).hover(ShowTooltip,HideTooltip);jQuery(".show-tooltip-text").prepend('<div class="poptop"></div>').append('<div class="popbottom"></div>');
}
/*############ End common/js/plug/footer.js ############*/
/*############ Begin common/js/plug/footerPullDown.js ############*/
;function goToAndClose(){jQuery("#brandSelections").hide();jQuery("#brandPulldownLink").removeClass("brandPulldownLinkOpened").addClass("brandPulldownLinkClosed");}jQuery(document).keydown(function(e){if(e.which==27){jQuery("#brandSelections").hide();jQuery("#brandPulldownLink").removeClass("brandPulldownLinkOpened").addClass("brandPulldownLinkClosed");}});jQuery(document).ready(function(){var brandDropDownParent=jQuery("#hiltonBrandMenu");
var findBrandDropDown=false;brandDropDownParent.click(function(){findBrandDropDown=true;});jQuery(".brandPulldownLinkOpened").click(function(){jQuery("#brandSelections").hide();jQuery("#brandPulldownLink").removeClass("brandPulldownLinkOpened").addClass("brandPulldownLinkClosed");findBrandDropDown=false;});jQuery(document).click(function(){if(!findBrandDropDown){jQuery("#brandSelections").hide();jQuery("#brandPulldownLink").removeClass("brandPulldownLinkOpened").addClass("brandPulldownLinkClosed");
findBrandDropDown=false;}else{findBrandDropDown=false;}});});function brandMenuToggler(){if(jQuery("#brandPulldownLink").hasClass("brandPulldownLinkClosed")){jQuery("#brandSelections").show();jQuery("#brandPulldownLink").addClass("brandPulldownLinkOpened").removeClass("brandPulldownLinkClosed");}else{jQuery("#brandSelections").hide();jQuery("#brandPulldownLink").removeClass("brandPulldownLinkOpened").addClass("brandPulldownLinkClosed");}}
/*############ End common/js/plug/footerPullDown.js ############*/
/*############ Begin common/js/plug/help.js ############*/
var helpMe=false;
jQuery(document).ready(function($){$(".helpPop").siblings("span.helpInfo").toggleClass("helpFocusBox");$(".helpFocusBox").children("span").addClass("helpFocusText");var helpMeClickOff=$(".helpRow");$(".helpFocusBox").hide();$(".helpPop").focus(function(){$(".helpFocusBox").fadeOut();$(this).siblings(".helpFocusBox").fadeIn();});$(".whatsThisHint").wrap('<span class="hintContainer"></span>').before('<span class="hintLauncher">What\'s this?</span>');$(".hintContainer").hover(function(){$(this).addClass("reveal");
},function(){$(this).removeClass("reveal");});helpMeClickOff.click(function(){helpMe=true;});$(document).click(function(){if(!helpMe){$(".helpFocusBox").fadeOut();helpMe=false;}else{helpMe=false;}});});
/*############ End common/js/plug/help.js ############*/
/*############ Begin common/js/plug/vipInHotelBenefits.js ############*/
jQuery(document).ready(function($){$("#doubletreeOptions").hide();$("#embassy_suitesOptions").hide();$("#hamptonOptions").hide();$("#garden_innOptions").hide();$("#homewoodOptions").hide();
$("#waldorfOptions").hide();});function handleEMOptions(maxChkd){var optionTwo=document.getElementById("EM_radio_option_6");var ctr=0;jQuery;if(optionTwo!=null){if(optionTwo.checked){countEMOptions(maxChkd);jQuery("#EM_radio_13").attr("disabled","disabled");jQuery("#EM_radio_14").attr("disabled","disabled");jQuery("#EM_radio_15").attr("disabled","disabled");}else{var i=6;for(i=6;i<=12;i++){var checkId="#EM_check_"+i;jQuery(checkId).attr("disabled","disabled");}jQuery("#EM_radio_13").removeAttr("disabled");
jQuery("#EM_radio_14").removeAttr("disabled");jQuery("#EM_radio_15").removeAttr("disabled");}}}function countEMOptions(maxChkd){var enabledCtr=0;for(i=6;i<=12;i++){var checkId="EM_check_"+i;if(document.getElementById(checkId).checked){enabledCtr++;}}if(enabledCtr==maxChkd){for(i=6;i<=12;i++){var checkId="#EM_check_"+i;if(!jQuery(checkId).attr("checked")){jQuery(checkId).attr("disabled","disabled");}else{jQuery(checkId).removeAttr("disabled");}}}else{enableAll("#EM_check_");}}function enableAll(n){var i=6;
for(i=6;i<=12;i++){var checkId=n+i;jQuery(checkId).removeAttr("disabled");}}
/*############ End common/js/plug/vipInHotelBenefits.js ############*/
/*############ Begin common/js/plug/tablesort.js ############*/
if(document.ELEMENT_NODE==null){document.ELEMENT_NODE=1;document.TEXT_NODE=3;}function getTextValue(el){var i;var s;s="";for(i=0;i<el.childNodes.length;i++){if(el.childNodes[i].nodeType==document.TEXT_NODE){s+=el.childNodes[i].nodeValue;}else{if(el.childNodes[i].nodeType==document.ELEMENT_NODE&&el.childNodes[i].tagName=="BR"){s+=" ";
}else{s+=getTextValue(el.childNodes[i]);}}}return normalizeString(s);}function compareValues(v1,v2){var objRegExp=/,/g;var f1,f2;f1=parseInt(v1.replace(objRegExp,""));f2=parseInt(v2.replace(objRegExp,""));if(!isNaN(f1)&&!isNaN(f2)){v1=f1;v2=f2;}if(v1==v2){return 0;}if(v1>v2){return 1;}return -1;}function compareDates(v1,v2){DATE_RE=/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;dt1=0;dt2=0;mtch=v1.match(DATE_RE);y=mtch[3];d=mtch[2];m=mtch[1];if(m.length==1){m="0"+m;}if(d.length==1){d="0"+d;}dt1=y+m+d;
mtch=v2.match(DATE_RE);y=mtch[3];d=mtch[2];m=mtch[1];if(m.length==1){m="0"+m;}if(d.length==1){d="0"+d;}dt2=y+m+d;if(dt1==dt2){return 0;}if(dt1<dt2){return -1;}return 1;}var whtSpEnds=new RegExp("^\\s*|\\s*$","g");var whtSpMult=new RegExp("\\s\\s+","g");function normalizeString(s){s=s.replace(whtSpMult," ");s=s.replace(whtSpEnds,"");return s;}var rowClsNm="alternateRow";var colClsNm="sortedColumn";var rowTest=new RegExp(rowClsNm,"gi");var colTest=new RegExp(colClsNm,"gi");function makePretty(tblEl,col){var i,j;
var rowEl,cellEl;for(i=0;i<tblEl.rows.length;i++){rowEl=tblEl.rows[i];rowEl.className=rowEl.className.replace(rowTest,"");if(i%2!=0){rowEl.className+=" "+rowClsNm;}rowEl.className=normalizeString(rowEl.className);for(j=2;j<tblEl.rows[i].cells.length;j++){cellEl=rowEl.cells[j];cellEl.className=cellEl.className.replace(colTest,"");if(j==col){cellEl.className+=" "+colClsNm;}cellEl.className=normalizeString(cellEl.className);}}var el=tblEl.parentNode.tHead;rowEl=el.rows[el.rows.length-1];for(i=2;i<rowEl.cells.length;
i++){cellEl=rowEl.cells[i];cellEl.className=cellEl.className.replace(colTest,"");if(i==col){cellEl.className+=" "+colClsNm;}cellEl.className=normalizeString(cellEl.className);}}function setRanks(tblEl,col,rev){var i=0;var incr=1;if(tblEl.reverseSort[col]){rev=!rev;}if(rev){incr=-1;i=tblEl.rows.length-1;}var count=1;var rank=count;var curVal;var lastVal=null;while(col>1&&i>=0&&i<tblEl.rows.length){curVal=getTextValue(tblEl.rows[i].cells[col]);if(lastVal!=null&&compareValues(curVal,lastVal)!=0){rank=count;
}tblEl.rows[i].rank=rank;lastVal=curVal;count++;i+=incr;}}
/*############ End common/js/plug/tablesort.js ############*/
/*############ Begin common/js/plug/tablesort_hhact.js ############*/
function sortTable(id,col,rev){var tblEl=document.getElementById(id);var DATE_RE=/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;if(tblEl.reverseSort==null){tblEl.reverseSort=new Array();tblEl.lastColumn=-1;}if(tblEl.reverseSort[col]==null){tblEl.reverseSort[col]=rev;}if(col==tblEl.lastColumn){tblEl.reverseSort[col]=!tblEl.reverseSort[col];
}tblEl.lastColumn=col;lastSortedColRedemption=col;lastSortedOrderRedemption=tblEl.reverseSort[col];var oldDsply=tblEl.style.display;tblEl.style.display="none";var tmpEl;var i,j;var minVal,minIdx;var testVal;var cmp;for(i=0;i<tblEl.rows.length-1;i++){minIdx=i;minVal=getTextValue(tblEl.rows[i].cells[col]);for(j=i+1;j<tblEl.rows.length;j++){testVal=getTextValue(tblEl.rows[j].cells[col]);if(!testVal.match(DATE_RE)){cmp=compareValues(minVal,testVal);}else{cmp=compareDates(minVal,testVal);}if(tblEl.reverseSort[col]){cmp=-cmp;
}if(cmp==0&&col!=1){cmp=compareValues(getTextValue(tblEl.rows[minIdx].cells[1]),getTextValue(tblEl.rows[j].cells[1]));}if(cmp>0){minIdx=j;minVal=testVal;}}if(minIdx>i){tmpEl=tblEl.removeChild(tblEl.rows[minIdx]);tblEl.insertBefore(tmpEl,tblEl.rows[i]);}}tblEl.style.display=oldDsply;return false;}
/*############ End common/js/plug/tablesort_hhact.js ############*/
/*############ Begin common/js/plug/tablesort_stays.js ############*/
function sortStaysTable(id,col,rev){var tblEl=document.getElementById(id);
var DATE_RE=/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;if(tblEl.reverseSort==null){tblEl.reverseSort=new Array();tblEl.lastColumn=-1;}if(tblEl.reverseSort[col]==null){tblEl.reverseSort[col]=rev;}if(col==tblEl.lastColumn){tblEl.reverseSort[col]=!tblEl.reverseSort[col];}if(tblEl.lastColumn==1){for(i=0;i<tblEl.rows.length;i++){rowEl=tblEl.rows[i];rowEl.cells[1].innerHTML=rowEl.cells[0].innerHTML;}}tblEl.lastColumn=col;lastSortedColStays=col;lastSortedOrderStays=tblEl.reverseSort[col];var oldDsply=tblEl.style.display;
tblEl.style.display="none";var tmpEl;var i,j;var minVal,minIdx;var testVal;var cmp;for(i=0;i<tblEl.rows.length-1;i++){minIdx=i;minVal=getTextValue(tblEl.rows[i].cells[col]);for(j=i+1;j<tblEl.rows.length;j++){testVal=getTextValue(tblEl.rows[j].cells[col]);if(!testVal.match(DATE_RE)){cmp=compareValues(minVal,testVal);}else{cmp=compareDates(minVal,testVal);}if(tblEl.reverseSort[col]){cmp=-cmp;}if(cmp==0){cmp=compareDates(getTextValue(tblEl.rows[minIdx].cells[2]),getTextValue(tblEl.rows[j].cells[2]));
cmp=-cmp;}if(cmp>0){minIdx=j;minVal=testVal;}}if(minIdx>i){tmpEl=tblEl.removeChild(tblEl.rows[minIdx]);tblEl.insertBefore(tmpEl,tblEl.rows[i]);}}if(col==1){setGroupings(tblEl,col,rev);}tblEl.style.display=oldDsply;return false;}function setGroupings(tblEl,col,rev){var i=0;var incr=1;if(tblEl.reverseSort[col]){rev=!rev;}if(rev){incr=-1;i=tblEl.rows.length-1;}var curVal;var lastVal="";var rowEl,cellEl;for(i=0;i<tblEl.rows.length;i++){rowEl=tblEl.rows[i];cellEl=rowEl.cells[1];curVal=getTextValue(cellEl);
if(compareValues(curVal,lastVal)==0){while(cellEl.lastChild!=null){cellEl.removeChild(cellEl.lastChild);}}else{lastVal=curVal;}}}
/*############ End common/js/plug/tablesort_stays.js ############*/
/*############ Begin common/js/sifr/sifr.js ############*/
var parseSelector=(function(){var SEPERATOR=/\s*,\s*/;var WHITESPACE=/\s*([\s>+~(),]|^|$)\s*/g;var IMPLIED_ALL=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var STANDARD_SELECT=/^[^\s>+~]/;var STREAM=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function parseSelector(selector,node){node=node||document.documentElement;
var argSelectors=selector.split(SEPERATOR),result=[];for(var i=0;i<argSelectors.length;i++){var nodes=[node],stream=toStream(argSelectors[i]);for(var j=0;j<stream.length;){var token=stream[j++],filter=stream[j++],args="";if(stream[j]=="("){while(stream[j++]!=")"&&j<stream.length){args+=stream[j];}args=args.slice(0,-1);}nodes=select(nodes,token,filter,args);}result=result.concat(nodes);}return result;}function toStream(selector){var stream=selector.replace(WHITESPACE,"$1").replace(IMPLIED_ALL,"$1*$2");
if(STANDARD_SELECT.test(stream)){stream=" "+stream;}return stream.match(STREAM)||[];}function select(nodes,token,filter,args){return(parseSelector.selectors[token])?parseSelector.selectors[token](nodes,filter,args):[];}var util={toArray:function(enumerable){var a=[];for(var i=0;i<enumerable.length;i++){a.push(enumerable[i]);}return a;}};var dom={isTag:function(node,tag){return(tag=="*")||(tag.toLowerCase()==node.nodeName.toLowerCase());},previousSiblingElement:function(node){do{node=node.previousSibling;
}while(node&&node.nodeType!=1);return node;},nextSiblingElement:function(node){do{node=node.nextSibling;}while(node&&node.nodeType!=1);return node;},hasClass:function(name,node){return(node.className||"").match("(^|\\s)"+name+"(\\s|$)");},getByTag:function(tag,node){return node.getElementsByTagName(tag);}};var selectors={"#":function(nodes,filter){for(var i=0;i<nodes.length;i++){if(nodes[i].getAttribute("id")==filter){return[nodes[i]];}}return[];}," ":function(nodes,filter){var result=[];for(var i=0;
i<nodes.length;i++){result=result.concat(util.toArray(dom.getByTag(filter,nodes[i])));}return result;},">":function(nodes,filter){var result=[];for(var i=0,node;i<nodes.length;i++){node=nodes[i];for(var j=0,child;j<node.childNodes.length;j++){child=node.childNodes[j];if(child.nodeType==1&&dom.isTag(child,filter)){result.push(child);}}}return result;},".":function(nodes,filter){var result=[];for(var i=0,node;i<nodes.length;i++){node=nodes[i];if(dom.hasClass([filter],node)){result.push(node);}}return result;
},":":function(nodes,filter,args){return(parseSelector.pseudoClasses[filter])?parseSelector.pseudoClasses[filter](nodes,args):[];}};parseSelector.selectors=selectors;parseSelector.pseudoClasses={};parseSelector.util=util;parseSelector.dom=dom;return parseSelector;})();var sIFR=new function(){var SIFR=this;var CSS_ACTIVE="sIFR-active";var CSS_UNLOADING="sIFR-unloading";var CSS_REPLACED="sIFR-replaced";var CSS_FLASH="sIFR-flash";var CSS_IGNORE="sIFR-ignore";var CSS_ALTERNATE="sIFR-alternate";var CSS_CLASS="sIFR-class";
var CSS_LAYOUT="sIFR-layout";var CSS_FIX_FOCUS="sIFR-fixfocus";var CSS_DUMMY="sIFR-dummy";var CSS_ZOOM_DETECT="sIFR-zoomdetect";var MIN_FONT_SIZE=6;var MAX_FONT_SIZE=126;var MIN_FLASH_VERSION=8;var PREFETCH_COOKIE="SIFR-PREFETCHED";var DEFAULT_RATIOS=[];var FLASH_PADDING_BOTTOM=5;var VERSION="361";this.isActive=false;this.isEnabled=true;this.preserveSingleWhitespace=false;this.fixWrap=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];
this.fromLocal=false;this.forceClear=false;this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.callbacks=[];var elementCount=0;var hasPrefetched=false,isInitialized=false;var dom=new function(){var XHTML_NS="http://www.w3.org/1999/xhtml";this.getBody=function(){var nodes=document.getElementsByTagName("body");if(nodes.length==1){return nodes[0];}return null;};this.addClass=function(name,node){if(node){node.className=((node.className||"")==""?"":node.className+" ")+name;
}};this.removeClass=function(name,node){if(node){node.className=node.className.replace(new RegExp("(^|\\s)"+name+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1");}};this.hasClass=function(name,node){return new RegExp("(^|\\s)"+name+"(\\s|$)").test(node.className);};this.hasOneOfClassses=function(names,node){for(var i=0;i<names.length;i++){if(this.hasClass(names[i],node)){return true;}}return false;};this.create=function(name){if(document.createElementNS){return document.createElementNS(XHTML_NS,name);
}return document.createElement(name);};this.nodeFromHtml=function(html){var temp=this.create("div");temp.innerHTML=html;return temp.firstChild;};this.getComputedStyle=function(node,property){var result;if(document.defaultView&&document.defaultView.getComputedStyle){result=document.defaultView.getComputedStyle(node,null)[property];}else{if(node.currentStyle){result=node.currentStyle[property];}}return result||"";};this.getStyleAsInt=function(node,property,requirePx){var value=this.getComputedStyle(node,property);
if(requirePx&&!/px$/.test(value)){return 0;}value=parseInt(value);return isNaN(value)?0:value;};this.getWidthFromStyle=function(node){var width=this.getStyleAsInt(node,"width",ua.ie);if(width==0){var paddingRight=this.getStyleAsInt(node,"paddingRight",true);var paddingLeft=this.getStyleAsInt(node,"paddingLeft",true);var borderRight=this.getStyleAsInt(node,"borderRightWidth",true);var borderLeft=this.getStyleAsInt(node,"borderLeftWidth",true);width=node.offsetWidth-paddingLeft-paddingRight-borderLeft-borderRight;
}return width;};this.getHeightFromStyle=function(node){var height=this.getStyleAsInt(node,"height",ua.ie);if(height==0){var paddingTop=this.getStyleAsInt(node,"paddingTop",true);var paddingBottom=this.getStyleAsInt(node,"paddingBottom",true);var borderTop=this.getStyleAsInt(node,"borderTopHeight",true);var borderBottom=this.getStyleAsInt(node,"borderBottomHeight",true);height=node.offsetHeight-paddingBottom-paddingTop-borderBottom-borderTop;}return height;};this.blurElement=function(element){if(ua.gecko){element.blur();
return ;}var input=dom.create("input");input.style.width="0px";input.style.height="0px";element.parentNode.appendChild(input);input.focus();input.blur();input.parentNode.removeChild(input);};this.getDimensions=function(node){var width=node.offsetWidth;var height=node.offsetHeight;if(width==0||height==0){for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];if(child.nodeType!=1){continue;}width=Math.max(width,child.offsetWidth);height=Math.max(height,child.offsetHeight);}}return{width:width,height:height};
};this.contentIsLink=function(node){var linkFound=false;for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];if(child.nodeType==3&&!child.nodeValue.match(/^\s*$/)){return false;}else{if(child.nodeType!=1){continue;}}var isLink=child.nodeName.toLowerCase()=="a";if(!isLink){return false;}else{linkFound=true;}}return linkFound;};var dom=this;this.swf={create:function(builder,fixFocus,id,width,height,src,vars,wmode,backgroundColor){var obj=builder.object(fixFocus,id,src,width,height);
return builder.params(obj,"flashvars",vars,"wmode",wmode,"bgcolor",backgroundColor,"allowScriptAccess","always","quality","best");},ie:{object:function(fixFocus,id,src,width,height){return'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+id+'" width="'+width+'" height="'+height+'" class="'+CSS_FLASH+'"><param name="movie" value="'+src+'"></param></object><script event=FSCommand(info,args) for='+id+">"+id+"_DoFSCommand(info, args);<\/script>";},params:function(obj){var params="";
for(var i=1;i<arguments.length;i+=2){params+='<param name="'+arguments[i]+'" value="'+arguments[i+1]+'"></param>';}return obj.replace(/(<\/object>)/,params+"$1");},insert:function(node,flash){node.innerHTML=flash;}},other:{object:function(fixFocus,id,src,width,height){var obj=dom.create("object");var attrs=["type","application/x-shockwave-flash","id",id,"name",id,"data",src,"width",width,"height",height];while(attrs.length){obj.setAttribute(attrs.shift(),attrs.shift());}obj.className=CSS_FLASH;if(!fixFocus){return{root:obj,obj:obj};
}var node=dom.create("div");node.className=CSS_FIX_FOCUS;node.appendChild(obj);return{root:node,obj:obj};},params:function(obj){for(var i=1;i<arguments.length;i+=2){if(arguments[i]=="name"){continue;}var param=dom.create("param");param.setAttribute("name",arguments[i]);param.setAttribute("value",arguments[i+1]);obj.obj.appendChild(param);}return obj.root;},insert:function(node,flash){while(node.firstChild){node.removeChild(node.firstChild);}node.appendChild(flash);}}};};this.dom=dom;var ua=new function(){var ua=navigator.userAgent.toLowerCase();
var product=(navigator.product||"").toLowerCase();this.macintosh=ua.indexOf("mac")>-1;this.windows=ua.indexOf("windows")>-1;this.quicktime=false;this.opera=ua.indexOf("opera")>-1;this.konqueror=product.indexOf("konqueror")>-1;this.ie=false
/*@cc_on || true @*/
;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(ua)
/*@cc_on && @_jscript_version >= 5.5 @*/
;this.ieWin=this.ie&&this.windows
/*@cc_on && @_jscript_version >= 5.1 @*/
;this.windows=this.windows&&(!this.ie||this.ieWin);
this.ieMac=this.ie&&this.macintosh
/*@cc_on && @_jscript_version < 5.1 @*/
;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=ua.indexOf("safari")>-1;this.webkit=ua.indexOf("applewebkit")>-1&&!this.konqueror;this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&product=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(ua)?parseFloat(RegExp.$1):0;this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(ua)?parseFloat(RegExp.$2):0;this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(ua)?parseFloat(RegExp.$1):0;
this.geckoBuildDate=this.gecko&&/.*gecko\/(\d{8}).*/.exec(ua)?parseFloat(RegExp.$1):0;this.konquerorMajor=this.konqueror&&/.*konqueror\/(\d).*/.exec(ua)?parseFloat(RegExp.$1):0;this.konquerorMinor=this.konqueror&&/.*khtml\/\d\.(\d).*/.exec(ua)?parseFloat(RegExp.$1):0;this.konquerorSmall=this.konqueror&&/.*khtml\/\d\.\d\.(\d).*/.exec(ua)?parseFloat(RegExp.$1):0;this.flashVersion=0;if(this.ieWin){var axo;var stop=false;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
this.flashVersion=6;axo.AllowScriptAccess="always";}catch(e){stop=this.flashVersion==6;}if(!stop){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}}if(!stop&&axo){this.flashVersion=parseFloat(/([\d,?]+)/.exec(axo.GetVariable("$version"))[1].replace(/,/g,"."));}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var flashPlugin=navigator.plugins["Shockwave Flash"];this.flashVersion=parseFloat(/(\d+\.?\d*)/.exec(flashPlugin.description)[1]);var i=0;while(this.flashVersion>=MIN_FLASH_VERSION&&i<navigator.mimeTypes.length){var mime=navigator.mimeTypes[i];
if(mime.type=="application/x-shockwave-flash"&&mime.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=0;this.quicktime=true;}i++;}}}this.flash=this.flashVersion>=MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||document.defaultView&&document.defaultView.getComputedStyle&&(!this.gecko||this.geckoBuildDate>=20030624);this.requiresPrefetch=this.ieWin||this.khtml;this.fixFocus=this.gecko&&this.windows&&this.geckoBuildDate>20061206;
this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=525||this.konqueror&&this.konquerorMajor>3||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkit<523;this.properDocument=typeof (document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&(!this.opera)&&(!this.webkit||this.webkitVersion>=412)&&(!this.konqueror)&&this.computedStyleSupport&&(!this.gecko||this.geckoBuildDate>20040804);};this.ua=ua;
var util=new function(){var UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};var SINGLE_WHITESPACE=" ";function capitalize($){return $.toUpperCase();}this.normalize=function(str){if(SIFR.preserveSingleWhitespace){return str.replace(/\s/g,SINGLE_WHITESPACE);}return str.replace(/(\n|\r)+/g,SINGLE_WHITESPACE).replace(/(\s)\s+/g,"$1").replace(/\xA0/,SINGLE_WHITESPACE);};this.textTransform=function(type,str){switch(type){case"uppercase":str=str.toUpperCase();
break;case"lowercase":str=str.toLowerCase();break;case"capitalize":var strCopy=str;str=str.replace(/^\w|\s\w/g,capitalize);if(str.indexOf("function capitalize")!=-1){var substrs=strCopy.replace(/(^|\s)(\w)/g,"$1$1$2$2").split(/^\w|\s\w/g);str="";for(var i=0;i<substrs.length;i++){str+=substrs[i].charAt(0).toUpperCase()+substrs[i].substring(1);}}break;}return str;};this.toHexString=function(str){if(typeof (str)!="string"||!str.charAt(0)=="#"||str.length!=4&&str.length!=7){return str;}str=str.replace(/#/,"");
if(str.length==3){str=str.replace(/(.)(.)(.)/,"$1$1$2$2$3$3");}return"0x"+str;};this.toJson=function(obj){var json="";switch(typeof (obj)){case"string":json='"'+obj+'"';break;case"number":case"boolean":json=obj.toString();break;case"object":json=[];for(var prop in obj){if(obj[prop]==Object.prototype[prop]){continue;}json.push('"'+prop+'":'+util.toJson(obj[prop]));}json="{"+json.join(",")+"}";break;}return json;};this.convertCssArg=function(arg){if(!arg){return{};}if(typeof (arg)=="object"){if(arg.constructor==Array){arg=arg.join("");
}else{return arg;}}var obj={};var rules=arg.split("}");for(var i=0;i<rules.length;i++){var $=rules[i].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!$||$.length!=3){continue;}if(!obj[$[1]]){obj[$[1]]={};}var properties=$[2].split(";");for(var j=0;j<properties.length;j++){var $2=properties[j].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!$2||$2.length!=3){continue;}obj[$[1]][$2[1]]=$2[2].replace(/\s+$/,"");}}return obj;};this.extractFromCss=function(css,selector,property,remove){var value=null;if(css&&css[selector]&&css[selector][property]){value=css[selector][property];
if(remove){delete css[selector][property];}}return value;};this.cssToString=function(arg){var css=[];for(var selector in arg){var rule=arg[selector];if(rule==Object.prototype[selector]){continue;}css.push(selector,"{");for(var property in rule){if(rule[property]==Object.prototype[property]){continue;}var value=rule[property];if(UNIT_REMOVAL_PROPERTIES[property]){value=parseInt(value,10);}css.push(property,":",value,";");}css.push("}");}return css.join("");};this.bind=function(scope,method){return function(){scope[method].apply(scope,arguments);
};};this.escape=function(str){return escape(str).replace(/\+/g,"%2B");};this.copyProperties=function(from,to){for(var property in from){if(to[property]===undefined){to[property]=from[property];}}return to;};this.domain=function(){var domain="";try{domain=document.domain;}catch(e){}return domain;};this.domainMatches=function(domain,match){if(match=="*"||match==domain){return true;}var wildcard=match.lastIndexOf("*");if(wildcard>-1){match=match.substr(wildcard+1);var matchPosition=domain.lastIndexOf(match);
if(matchPosition>-1&&(matchPosition+match.length)==domain.length){return true;}}return false;};this.uriEncode=function(s){return encodeURI(decodeURIComponent(s));};};this.util=util;var hacks={};hacks.fragmentIdentifier=new function(){this.fix=true;var cachedTitle;this.cache=function(){cachedTitle=document.title;};function doFix(){document.title=cachedTitle;}this.restore=function(){if(this.fix){setTimeout(doFix,0);}};};this.hacks={fragmentIdentifier:hacks.fragmentIdentifier};hacks.pageLoad=new function(){var dummy=null;
function pollLoad(){try{if(ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left");}}catch(e){return setTimeout(pollLoad,10);}afterDomLoad();}function afterDomLoad(){if(SIFR.useStyleCheck){checkStyle();}else{if(!ua.mustCheckStyle){fire(null,true);}}}function checkStyle(){dummy=dom.create("div");dummy.className=CSS_DUMMY;dom.getBody().appendChild(dummy);pollStyle();}function pollStyle(){if(dom.getComputedStyle(dummy,"marginLeft")=="42px"){afterStyle();
}else{setTimeout(pollStyle,10);}}function afterStyle(){if(dummy&&dummy.parentNode){dummy.parentNode.removeChild(dummy);}dummy=null;fire(null,true);}function fire(evt,preserveReplacements){SIFR.initialize(preserveReplacements);if(evt&&evt.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",fire,false);}if(window.removeEventListener){window.removeEventListener("load",fire,false);}}}this.attach=function(){if(window.addEventListener){window.addEventListener("load",fire,false);
}else{window.attachEvent("onload",fire);}if(!SIFR.useDomLoaded||ua.forcePageLoad||ua.ie&&window.top!=window){return ;}if(ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",afterDomLoad,false);}else{if(ua.ie||ua.khtml){pollLoad();}}};};hacks.zoom=new function(){var element,lastOffset;function detect(){if(element.offsetLeft!=lastOffset){lastOffset=element.offsetLeft;resize(null,true);}}this.init=function(){if(!ua.ie||ua.ieVersion<7){return ;}element=dom.create("div");element.className=CSS_ZOOM_DETECT;
element.style.cssText="display:block;width:auto;position:absolute;left:10%;top:-100px;";dom.getBody().appendChild(element);lastOffset=element.offsetLeft;setInterval(detect,200);};};this.errors={fire:function(id){if(this[id+"Alert"]){alert(this[id+"Alert"]);}throw new Error(this[id]);},isFile:"sIFR: Did not activate because the page is being loaded from the filesystem.",isFileAlert:"Hi!\n\nThanks for using sIFR on your page. Unfortunately sIFR couldn't activate, because it was loaded directly from your computer.\nDue to Flash security restrictions, you need to load sIFR through a web server.\n\nWe apologize for the inconvenience.",getSource:"sIFR: Could not determine appropriate source"};
var replaceKwargsStore={kwargs:[],replaceAll:function(preserve){for(var i=0;i<this.kwargs.length;i++){SIFR.replace(this.kwargs[i]);}if(!preserve){this.kwargs=[];}}};function isValidDomain(){if(SIFR.domains.length==0){return true;}var domain=util.domain();for(var i=0;i<SIFR.domains.length;i++){var match=SIFR.domains[i];if(util.domainMatches(domain,match)){return true;}}return false;}function isFile(){if(!SIFR.fromLocal&&document.location.protocol=="file:"){if(SIFR.debug){SIFR.errors.fire("isFile");
}return true;}return false;}function resize(evt,force){var viewport=force?{}:resize.viewport;resize.viewport={width:window.innerWidth||document.documentElement.clientWidth||dom.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||dom.getBody().clientHeight};if(viewport&&resize.viewport.width==viewport.width&&resize.viewport.height==viewport.height){return ;}if(resize.timer){clearTimeout(resize.timer);}resize.timer=setTimeout(function(){delete resize.timer;for(var i=0;
i<SIFR.callbacks.length;i++){SIFR.callbacks[i].resize();}},200);}function scale(){for(var i=0;i<SIFR.callbacks.length;i++){SIFR.callbacks[i].call("scale");}}this.activate=function(){if(!ua.supported||!this.isEnabled||this.isActive||!isValidDomain()||isFile()){return ;}if(arguments.length>0){this.prefetch.apply(this,arguments);}this.isActive=true;this.setFlashClass();hacks.fragmentIdentifier.fix=ua.ieWin&&hacks.fragmentIdentifier.fix&&window.location.hash!="";if(hacks.fragmentIdentifier.fix){hacks.fragmentIdentifier.cache();
}if(!this.autoInitialize){return ;}hacks.pageLoad.attach();if(ua.ie){window.attachEvent("onunload",function(){dom.addClass(CSS_UNLOADING,document.documentElement);});}};this.setFlashClass=function(){if(this.hasFlashClassSet){return ;}dom.addClass(CSS_ACTIVE,dom.getBody()||document.documentElement);this.hasFlashClassSet=true;};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return ;}dom.removeClass(CSS_ACTIVE,dom.getBody());dom.removeClass(CSS_ACTIVE,document.documentElement);this.hasFlashClassSet=false;
};this.initialize=function(preserveReplacements){if(!this.isActive||!this.isEnabled){return ;}if(isInitialized){if(!preserveReplacements){replaceKwargsStore.replaceAll(false);}return ;}isInitialized=true;replaceKwargsStore.replaceAll(preserveReplacements);if(SIFR.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",resize,false);window.addEventListener("scroll",scale,false);}else{window.attachEvent("onresize",resize);window.attachEvent("onscroll",scale);}hacks.zoom.init();
}clearPrefetch();};function getSource(src){if(typeof (src)!="string"){if(src.src){src=src.src;}if(typeof (src)!="string"){var versions=[];for(var version in src){if(src[version]!=Object.prototype[version]){versions.push(version);}}versions.sort().reverse();var result="";var i=-1;while(!result&&++i<versions.length){if(parseFloat(versions[i])<=ua.flashVersion){result=src[versions[i]];}}src=result;}}if(!src&&SIFR.debug){SIFR.errors.fire("getSource");}if(ua.ie&&src.charAt(0)=="/"){src=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+src;
}return src;}this.prefetch=function(){if((!ua.requiresPrefetch&&!this.isActive)||!ua.supported||!this.isEnabled||!isValidDomain()){return ;}if(this.setPrefetchCookie&&new RegExp(";?"+PREFETCH_COOKIE+"=true;?").test(document.cookie)){return ;}try{hasPrefetched=true;if(ua.ieWin){prefetchIexplore(arguments);}else{prefetchLight(arguments);}if(this.setPrefetchCookie){document.cookie=PREFETCH_COOKIE+"=true;path="+this.cookiePath;}}catch(e){if(SIFR.debug){throw e;}}};function prefetchIexplore(args){for(var i=0;
i<args.length;i++){document.write('<script defer type="sifr/prefetch" src="'+getSource(args[i])+'"><\/script>');}}function prefetchLight(args){for(var i=0;i<args.length;i++){new Image().src=getSource(args[i]);}}function clearPrefetch(){if(!ua.ieWin||!hasPrefetched){return ;}try{var nodes=document.getElementsByTagName("script");for(var i=nodes.length-1;i>=0;i--){var node=nodes[i];if(node.type=="sifr/prefetch"){node.parentNode.removeChild(node);}}}catch(e){}}function getRatio(size,ratios){for(var i=0;
i<ratios.length;i+=2){if(size<=ratios[i]){return ratios[i+1];}}return ratios[ratios.length-1]||1;}function getFilters(obj){var filters=[];for(var filter in obj){if(obj[filter]==Object.prototype[filter]){continue;}var properties=obj[filter];filter=[filter.replace(/filter/i,"")+"Filter"];for(var property in properties){if(properties[property]==Object.prototype[property]){continue;}filter.push(property+":"+util.escape(util.toJson(util.toHexString(properties[property]))));}filters.push(filter.join(","));
}return util.escape(filters.join(";"));}function calculate(node){var lineHeight,lines;if(!ua.ie){lineHeight=dom.getStyleAsInt(node,"lineHeight");lines=Math.floor(dom.getStyleAsInt(node,"height")/lineHeight);}else{if(ua.ie){var fontSize=dom.getComputedStyle(node,"fontSize");if(fontSize.indexOf("px")>0){lineHeight=parseInt(fontSize);}else{var html=node.innerHTML;node.style.visibility="visible";node.style.overflow="visible";node.style.position="static";node.style.zoom="normal";node.style.writingMode="lr-tb";
node.style.width=node.style.height="auto";node.style.maxWidth=node.style.maxHeight=node.style.styleFloat="none";var rectNode=node;var hasLayout=node.currentStyle.hasLayout;if(hasLayout){node.innerHTML='<div class="'+CSS_LAYOUT+'">X<br />X<br />X</div>';rectNode=node.firstChild;}else{node.innerHTML="X<br />X<br />X";}var rects=rectNode.getClientRects();lineHeight=rects[1].bottom-rects[1].top;lineHeight=Math.ceil(lineHeight*0.8);if(hasLayout){node.innerHTML='<div class="'+CSS_LAYOUT+'">'+html+"</div>";
rectNode=node.firstChild;}else{node.innerHTML=html;}rects=rectNode.getClientRects();lines=rects.length;if(hasLayout){node.innerHTML=html;}node.style.visibility=node.style.width=node.style.height=node.style.maxWidth=node.style.maxHeight=node.style.overflow=node.style.styleFloat=node.style.position=node.style.zoom=node.style.writingMode="";}}}return{lineHeight:lineHeight,lines:lines};}this.replace=function(kwargs,mergeKwargs){if(!ua.supported){return ;}if(mergeKwargs){kwargs=util.copyProperties(kwargs,mergeKwargs);
}if(!isInitialized){return replaceKwargsStore.kwargs.push(kwargs);}if(SIFR.onReplacementStart){SIFR.onReplacementStart(kwargs);}var nodes=kwargs.elements;if(!nodes&&parseSelector){nodes=parseSelector(kwargs.selector);}if(nodes.length==0){return ;}var src=getSource(kwargs.src);var css=util.convertCssArg(kwargs.css);var filters=getFilters(kwargs.filters);var forceClear=(kwargs.forceClear==null)?SIFR.forceClear:kwargs.forceClear;var fitExactly=(kwargs.fitExactly==null)?SIFR.fitExactly:kwargs.fitExactly;
var forceWidth=fitExactly||(kwargs.forceWidth==null?SIFR.forceWidth:kwargs.forceWidth);var preventWrap=!!(kwargs.preventWrap&&!kwargs.forceSingleLine);var leading=parseInt(util.extractFromCss(css,".sIFR-root","leading"))||0;var fontSize=util.extractFromCss(css,".sIFR-root","font-size",true)||0;var backgroundColor=util.extractFromCss(css,".sIFR-root","background-color",true)||"#FFFFFF";var kerning=util.extractFromCss(css,".sIFR-root","kerning",true)||"";var gridFitType=kwargs.gridFitType||util.extractFromCss(css,".sIFR-root","text-align")=="right"?"subpixel":"pixel";
var textTransform=SIFR.forceTextTransform?util.extractFromCss(css,".sIFR-root","text-transform",true)||"none":"none";var opacity=util.extractFromCss(css,".sIFR-root","opacity",true)||"100";var cursor=util.extractFromCss(css,".sIFR-root","cursor",true)||"default";var pixelFont=kwargs.pixelFont||false;var ratios=kwargs.ratios||DEFAULT_RATIOS;var tuneHeight=parseInt(kwargs.tuneHeight)||0;var events=!!kwargs.onRelease||!!kwargs.onRollOver||!!kwargs.onRollOut;if(parseInt(fontSize).toString()!=fontSize&&fontSize.indexOf("px")==-1){fontSize=0;
}else{fontSize=parseInt(fontSize);}if(parseFloat(opacity)<1){opacity=100*parseFloat(opacity);}var cssText="";if(fitExactly){util.extractFromCss(css,".sIFR-root","text-align",true);}if(!kwargs.modifyCss){cssText=util.cssToString(css);}var wmode=kwargs.wmode||"";if(!wmode){if(kwargs.transparent){wmode="transparent";}else{if(kwargs.opaque){wmode="opaque";}}}if(wmode=="transparent"){if(!ua.transparencySupport){wmode="opaque";}else{backgroundColor="transparent";}}for(var i=0;i<nodes.length;i++){var node=nodes[i];
if(dom.hasOneOfClassses([CSS_REPLACED,CSS_IGNORE,CSS_ALTERNATE],node)){continue;}var dimensions=dom.getDimensions(node);var height=dimensions.height;var width=dimensions.width;var display=dom.getComputedStyle(node,"display");if(!height||!width||display==null||display=="none"){continue;}if(forceClear&&ua.gecko){node.style.clear="both";}var html=null;if(SIFR.fixWrap&&ua.ie&&display=="block"){html=node.innerHTML;node.innerHTML="X";}width=dom.getWidthFromStyle(node);if(html&&SIFR.fixWrap&&ua.ie){node.innerHTML=html;
}var lineHeight,lines;if(!fontSize){var calculation=calculate(node);lineHeight=Math.min(MAX_FONT_SIZE,Math.max(MIN_FONT_SIZE,calculation.lineHeight));if(pixelFont){lineHeight=Math.max(8,8*Math.round(lineHeight/8));}lines=calculation.lines;if(isNaN(lines)||!isFinite(lines)||lines==0){lines=1;}if(lines>1&&leading){height+=Math.round((lines-1)*leading);}}else{lineHeight=fontSize;lines=1;}height=Math.round(lines*lineHeight);if(forceClear&&ua.gecko){node.style.clear="";}var alternate=dom.create("span");
alternate.className=CSS_ALTERNATE;var contentNode=node.cloneNode(true);node.parentNode.appendChild(contentNode);for(var j=0,l=contentNode.childNodes.length;j<l;j++){alternate.appendChild(contentNode.childNodes[j].cloneNode(true));}if(kwargs.modifyContent){kwargs.modifyContent(contentNode,kwargs.selector);}if(kwargs.modifyCss){cssText=kwargs.modifyCss(css,contentNode,kwargs.selector);}var fixHover=SIFR.fixHover&&dom.contentIsLink(contentNode);var content=handleContent(contentNode,textTransform,kwargs.uriEncode);
contentNode.parentNode.removeChild(contentNode);if(kwargs.modifyContentString){content.text=kwargs.modifyContentString(content.text,kwargs.selector);}if(content.text==""){continue;}var renderHeight=Math.round(lines*getRatio(lineHeight,ratios)*lineHeight)+FLASH_PADDING_BOTTOM+tuneHeight;var forcedWidth=forceWidth?width:"100%";var vars=["content="+util.escape(content.text),"antialiastype="+(kwargs.antiAliasType||""),"width="+width,"height="+height,"renderheight="+renderHeight,"fitexactly="+fitExactly,"tunewidth="+(kwargs.tuneWidth||0),"tuneheight="+tuneHeight,"offsetleft="+(kwargs.offsetLeft||""),"offsettop="+(kwargs.offsetTop||""),"thickness="+(kwargs.thickness||""),"sharpness="+(kwargs.sharpness||""),"kerning="+kerning,"gridfittype="+gridFitType,"flashfilters="+filters,"opacity="+opacity,"blendmode="+(kwargs.blendMode||""),"size="+lineHeight,"css="+util.escape(cssText),"selectable="+(kwargs.selectable==null?"true":kwargs.selectable),"fixhover="+fixHover,"preventwrap="+preventWrap,"forcesingleline="+(kwargs.forceSingleLine===true),"link="+util.escape(content.primaryLink[0]||""),"target="+util.escape(content.primaryLink[1]||""),"events="+events,"cursor="+cursor,"version="+VERSION];
var encodedVars=encodeVars(vars);var callbackName="sIFR_callback_"+elementCount++;var callbackInfo=new CallbackInfo(callbackName,vars,forceWidth,{onReplacement:kwargs.onReplacement,onRollOver:kwargs.onRollOver,onRollOut:kwargs.onRollOut,onRelease:kwargs.onRelease});window[callbackName+"_DoFSCommand"]=(function(callbackInfo){return function(info,arg){callbackInfo.handle(info,arg);};})(callbackInfo);alternate.setAttribute("id",callbackName+"_alternate");var builder=ua.ie?dom.swf.ie:dom.swf.other;var flash=dom.swf.create(builder,ua.fixFocus&&kwargs.fixFocus,callbackName,forcedWidth,renderHeight,src,encodedVars,wmode,backgroundColor);
builder.insert(node,flash);callbackInfo.html=flash;SIFR.callbacks.push(callbackInfo);if(kwargs.selector){if(!SIFR.callbacks[kwargs.selector]){SIFR.callbacks[kwargs.selector]=[callbackInfo];}else{SIFR.callbacks[kwargs.selector].push(callbackInfo);}}node.appendChild(alternate);dom.addClass(CSS_REPLACED,node);}hacks.fragmentIdentifier.restore();};this.getCallbackByFlashElement=function(node){for(var i=0;i<SIFR.callbacks.length;i++){if(SIFR.callbacks[i].id==node.getAttribute("id")){return SIFR.callbacks[i];
}}};this.redraw=function(){for(var i=0;i<SIFR.callbacks.length;i++){SIFR.callbacks[i].resetMovie();}};function encodeVars(vars){return vars.join("&").replace(/%/g,"%25");}function handleContent(source,textTransform,uriEncode){uriEncode=uriEncode||util.uriEncode;var stack=[],content=[],primaryLink=[];var nodes=source.childNodes;var i=0;while(i<nodes.length){var node=nodes[i];if(node.nodeType==3){var text=util.normalize(node.nodeValue);text=util.textTransform(textTransform,text);text=text.replace(/</g,"&lt;");
content.push(text);}if(node.nodeType==1){var attributes=[];var nodeName=node.nodeName.toLowerCase();var className=node.className||"";if(/\s+/.test(className)){if(className.indexOf(CSS_CLASS)>-1){className=className.match("(\\s|^)"+CSS_CLASS+"-([^\\s$]*)(\\s|$)")[2];}else{className=className.match(/^([^\s]+)/)[1];}}if(className!=""){attributes.push('class="'+className+'"');}if(nodeName=="a"){var href=uriEncode(node.getAttribute("href")||"");var target=node.getAttribute("target")||"";attributes.push('href="'+href+'"','target="'+target+'"');
if(primaryLink.length==0){primaryLink=[href,target];}}content.push("<"+nodeName+(attributes.length>0?" ":"")+attributes.join(" ")+">");if(node.hasChildNodes()){stack.push(i);i=0;nodes=node.childNodes;continue;}else{if(!/^(br|img)$/i.test(node.nodeName)){content.push("</",node.nodeName.toLowerCase(),">");}}}if(stack.length>0&&!node.nextSibling){do{i=stack.pop();nodes=node.parentNode.parentNode.childNodes;node=nodes[i];if(node){content.push("</",node.nodeName.toLowerCase(),">");}}while(i==nodes.length-1&&stack.length>0);
}i++;}return{text:content.join("").replace(/\n|\r/g,""),primaryLink:primaryLink};}function CallbackInfo(id,vars,forceWidth,events){this.id=id;this.vars=vars;this._events=events;this._forceWidth=forceWidth;this._firedReplacementEvent=!(events.onReplacement!=null);this.html=null;}CallbackInfo.prototype.getFlashElement=function(){return document.getElementById(this.id);};CallbackInfo.prototype.available=function(){var flashNode=this.getFlashElement();return flashNode&&flashNode.parentNode;};CallbackInfo.prototype.handle=function(info,arg){if(!this.available()){return ;
}switch(/(FSCommand\:)?(.+)/.exec(info)[2]){case"resize":var flashNode=this.getFlashElement();var $=arg.split(/\:|,/);flashNode.setAttribute($[0],$[1]);if($.length>2){flashNode.style[$[2]]=$[3]+"px";}if(ua.khtml){var repaint=flashNode.offsetHeight;}if(!this._firedReplacementEvent){this._events.onReplacement(this);this._firedReplacementEvent=true;}break;case"resetmovie":this.resetMovie();break;case"blur":dom.blurElement(this.getFlashElement());break;case"event":if(this._events[arg]){this._events[arg](this);
}break;default:if(this.debugHandler&&/(FSCommand\:)?debug/.test(info)){this.debugHandler(info,arg);}}};CallbackInfo.prototype.call=function(type,value){if(!this.available()){return false;}var flashNode=this.getFlashElement();try{flashNode.SetVariable("callbackType",type);flashNode.SetVariable("callbackValue",value);flashNode.SetVariable("callbackTrigger",true);}catch(e){return false;}return true;};CallbackInfo.prototype.replaceText=function(content,alternate){var escapedContent=util.escape(content);
this.updateVars("content",escapedContent);if(this.call("replacetext",escapedContent)){var node=this.getAlternate();if(alternate){while(node.firstChild){node.removeChild(node.firstChild);}for(var i=0;i<alternate.length;i++){node.appendChild(alternate[i]);}}else{try{node.innerHTML=content;}catch(e){}}return true;}return false;};CallbackInfo.prototype.updateVars=function(name,value){for(var i=0;i<this.vars.length;i++){if(this.vars[i].split("=")[0]==name){this.vars[i]=name+"="+value;break;}}};CallbackInfo.prototype.resetMovie=function(){if(!this.available()){return ;
}var flashNode=this.getFlashElement();var node=flashNode.parentNode;var vars=encodeVars(this.vars);if(ua.ie){this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+vars);node.replaceChild(dom.nodeFromHtml(this.html),flashNode);}else{var params=this.html.getElementsByTagName("param");for(var i=0;i<params.length;i++){if(params[i].getAttribute("name")=="flashvars"){params[i].setAttribute("value",vars);break;}}node.replaceChild(this.html.cloneNode(true),flashNode);}};CallbackInfo.prototype.resize=function(){if(!this.available()){return ;
}var flashNode=this.getFlashElement();var ancestor=this.getAncestor();var minHeight=dom.getHeightFromStyle(ancestor);var currentWidth=flashNode.offsetWidth;var originalWidth=flashNode.getAttribute("width");var originalHeight=flashNode.getAttribute("height");flashNode.style.width="0px";flashNode.style.height="0px";ancestor.style.minHeight=minHeight+"px";var nodes=this.getAlternate().childNodes;var clones=[];for(var i=0;i<nodes.length;i++){var node=nodes[i].cloneNode(true);clones.push(node);ancestor.appendChild(node);
}var width=dom.getWidthFromStyle(ancestor);for(var i=0;i<clones.length;i++){ancestor.removeChild(clones[i]);}flashNode.style.width=flashNode.style.height=ancestor.style.minHeight="";flashNode.setAttribute("width",this._forceWidth?width:originalWidth);flashNode.setAttribute("height",originalHeight);if(width!=currentWidth){this.call("resize",width);}else{this.call("scale");}};CallbackInfo.prototype.changeCSS=function(css){css=util.escape(util.cssToString(util.convertCssArg(css)));this.updateVars("css",css);
return this.call("changecss",css);};CallbackInfo.prototype.getAlternate=function(){return document.getElementById(this.id+"_alternate");};CallbackInfo.prototype.getAncestor=function(){var ancestor=this.getFlashElement().parentNode;return !dom.hasClass(CSS_FIX_FOCUS,ancestor)?ancestor:ancestor.parentNode;};};
/*############ End common/js/sifr/sifr.js ############*/
/*############ Begin common/js/sifr/sifr-config.js ############*/
var univers={src:G_SIFR_UNIVERS,ratios:[7,1.32,11,1.31,13,1.24,14,1.25,19,1.23,27,1.2,34,1.19,42,1.18,47,1.17,48,1.18,69,1.17,74,1.16,75,1.17,1.16]};
var fedrasans={src:G_SIFR_SANS};var universGI={src:G_SIFR_UNIVERS,ratios:[7,1.32,11,1.31,13,1.24,14,1.25,19,1.23,27,1.2,34,1.19,42,1.18,47,1.17,48,1.18,69,1.17,74,1.16,75,1.17,1.16]};sIFR.useStyleCheck=true;sIFR.activate(univers);sIFR.activate(universGI);sIFR.replace(univers,{selector:"h1.sifrHI",css:[".sIFR-root { text-align: left; font-weight: bold; color: #ffffff; }"],wmode:"transparent"});sIFR.replace(universGI,{selector:"h1.sifrGI",css:[".sIFR-root { color: #666666; font-size:24px; }"],wmode:"transparent"});
sIFR.replace(fedrasans,{selector:"h3.fedrasans",css:[".sIFR-root { color: #FFFFFF; }"],wmode:"transparent"});var sifrCss=".sIFR-root { color: #C60751; font-size:32px; }";if(G_LOCALE=="de_DE"){sifrCss=".sIFR-root { color: #C60751; font-size:28px; }";}sIFR.replace(fedrasans,{selector:"h2.fedrasans",css:[sifrCss],wmode:"transparent"});
/*############ End common/js/sifr/sifr-config.js ############*/
/*############ Begin common/js/plug/upcoming_reservations.js ############*/
jQuery(document).ready(function($){$("div.details").hide();
$("div.selectedDetails").show();$("a.clickExpand").click(function(){if($(this).hasClass("selectedExpand")){$(this).siblings(".details").slideUp();$(this).siblings(".details").removeClass("selectedDetails");$(this).removeClass("selectedExpand");}else{$(this).addClass("selectedExpand");$("a.selectedExpand").siblings(".details").addClass("selectedDetails");$(".selectedDetails").slideDown();}return false;});$("#expandAllUpcoming").click(function(){$(".details").slideDown();$(".selectedDetails").removeClass("selectedDetails");
$("a.clickExpand").addClass("selectedExpand");return false;});$("#collapseAllUpcoming").click(function(){$("a.selectedExpand").removeClass("selectedExpand");$("div.selectedDetails").removeClass("selectedDetails");$(".details").slideUp();return false;});$("#stayHotel1").addClass("selectedExpand");$("#stayHotel1").siblings(".details").show().addClass("selectedDetails");});
/*############ End common/js/plug/upcoming_reservations.js ############*/
/*############ Begin common/js/plug/enrollment.js ############*/
jQuery(document).ready(function(){var joinHiltonHHonorsOptions=jQuery("#joinHiltonHHonorsOptions");
var createReservationProfileOptions=jQuery("#createReservationProfileOptions");if(!document.getElementById("createReservationProfileRadio")){return ;}if(document.getElementById("createReservationProfileRadio").checked==false){createReservationProfileOptions.hide();createReservationProfileOptions.removeClass("enrollCurrent");}else{createReservationProfileOptions.addClass("enrollCurrent");}if(document.getElementById("hiltonHhonorsRadio").checked==false){joinHiltonHHonorsOptions.hide();joinHiltonHHonorsOptions.removeClass("enrollCurrent");
}else{joinHiltonHHonorsOptions.addClass("enrollCurrent");}jQuery("#hiltonHhonorsRadio").click(function(){joinHiltonHHonorsOptions.slideDown();joinHiltonHHonorsOptions.addClass("enrollCurrent");if(createReservationProfileOptions.hasClass("enrollCurrent")){createReservationProfileOptions.slideUp();createReservationProfileOptions.removeClass("enrollCurrent");}});jQuery("#createReservationProfileRadio").click(function(){createReservationProfileOptions.slideDown();createReservationProfileOptions.addClass("enrollCurrent");
if(joinHiltonHHonorsOptions.hasClass("enrollCurrent")){joinHiltonHHonorsOptions.slideUp();joinHiltonHHonorsOptions.removeClass("enrollCurrent");}});});
/*############ End common/js/plug/enrollment.js ############*/
/*############ Begin common/js/plug/double_dip_earning_options.js ############*/
jQuery(document).ready(function($){$("#travelPartner1").show();$("#addTravelPartner2").show();$("#travelPartner2").hide();$("#travelPartner3").hide();$("#travelPartner4").hide();$("#travelPartner5").hide();
$("#addTravelPartner3").hide();$("#addTravelPartner4").hide();$("#addTravelPartner5").hide();showNonEmptyPartners();$("#delayMessage").hide();$("#changeEarningStyle").click(function(){$("#delayMessage").show();alert("this should be a pop-up to third-party site for changing your earning style");});});function toBeDeleted(element){var $mycheckbox=jQuery(element);$mycheckbox.parent().parent().attr("style","background-color:pink;").addClass("toBeDeleted");$mycheckbox.removeAttr("onClick").attr("onClick","notToBeDeleted(this);");
}function notToBeDeleted(element){var $myuncheckbox=jQuery(element);$myuncheckbox.parent().parent().removeAttr("style","background-color:pink;").removeClass("toBeDeleted");$myuncheckbox.removeAttr("onClick").attr("onClick","toBeDeleted(this);");}function showNonEmptyPartners(){var txtElement=document.getElementById("partnerNumber2");if(txtElement&&txtElement.value!=null&&txtElement.value.length>0){jQuery("#travelPartner2").show();jQuery("#addTravelPartner2").hide();jQuery("#addTravelPartner3").show();
}var txtElement1=document.getElementById("partnerNumber3");if(txtElement&&txtElement1.value!=null&&txtElement1.value.length>0){jQuery("#travelPartner3").show();jQuery("#addTravelPartner3").hide();jQuery("#addTravelPartner4").show();}txtElement=document.getElementById("partnerNumber4");if(txtElement&&txtElement.value!=null&&txtElement.value.length>0){jQuery("#travelPartner4").show();jQuery("#addTravelPartner4").hide();jQuery("#addTravelPartner5").show();}txtElement=document.getElementById("partnerNumber5");
if(txtElement&&txtElement.value!=null&&txtElement.value.length>0){jQuery("#travelPartner5").show();jQuery("#addTravelPartner5").hide();}}
/*############ End common/js/plug/double_dip_earning_options.js ############*/
/*############ Begin common/js/plug/global.js ############*/
function addLoadEvent(func){jQuery(document).ready(function($){func();});}function getId(strId){return document.getElementById(strId);}function getElementsByClassName(className,tag,elm){var testClass=new RegExp("(^|\\s)"+className+"(\\s|$)");
var tag=tag||"*";var elm=elm||document;var elements=(tag=="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag);var returnElements=[];var current;var length=elements.length;for(var i=0;i<length;i++){current=elements[i];if(testClass.test(current.className)){returnElements.push(current);}}return returnElements;}function addClassName(oElm,strClassName){var strCurrentClass=oElm.className;if(!new RegExp(strClassName,"i").test(strCurrentClass)){oElm.className=strCurrentClass+((strCurrentClass.length>0)?" ":"")+strClassName;
}}function removeClassName(oElm,strClassName){var oClassToRemove=new RegExp((strClassName+"s?"),"i");oElm.className=oElm.className.replace(oClassToRemove,"").replace(/^\s?|\s?$/g,"");}function ce(tag,name){if(name&&window.ActiveXObject){element=document.createElement("<"+tag+' name="'+name+'">');}else{element=document.createElement(tag);element.setAttribute("name",name);}return element;}function popupFamilyPolicy(winURL){window.open(winURL,"popupfamilypolicy","resizable=1,location=0,toolbar=0,scrollbars=1,width=300,height=400");
}function popupChargeDetails(winURL){window.open(winURL,"popupchargedetails","resizable=1,location=0,toolbar=0,scrollbars=1,width=400,height=400");}function popupRoomDetails(winURL){window.open(winURL,"popupRoomDetails","resizable=1,location=0,toolbar=0,scrollbars=1,width=400,height=400");}function popupTaxAndRateDetails(winURL){window.open(winURL,"popupTaxAndRateDetails","resizable=1,location=0,toolbar=0,scrollbars=1,width=400,height=400");}function popupPlanDetails(winURL){window.open(winURL,"popupPlanDetails","resizable=1,location=0,toolbar=0,scrollbars=1,width=400,height=400");
}function popupRoomPlanDetails(winURL){window.open(winURL,"popupRoomPlanDetails","resizable=1,location=0,toolbar=0,scrollbars=1,width=650,height=400");}function popupPurchasePoints(winURL){window.open(winURL,"popupPurchasePoints","resizable=1,location=0,toolbar=0,scrollbars=1,width=730,height=500");}function prepareLinks(){if(!document.getElementsByTagName){return false;}var lnks=document.getElementsByTagName("a");for(var i=0;i<lnks.length;i++){if(lnks[i].className=="popup"){addClassName(lnks[i],"pops");
if(!lnks[i].onclick){lnks[i].onclick=function(){openPopup(this.getAttribute("href"));return false;};}}if(lnks[i].className=="famPolicyLink"){addClassName(lnks[i],"pops");lnks[i].onclick=function(event){popupFamilyPolicy(this.getAttribute("href"));return false;};}if(lnks[i].className=="popupChargeDetails"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupChargeDetails(this.getAttribute("href"));return false;};}if(lnks[i].className=="popupRoomDetails"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupRoomDetails(this.getAttribute("href"));
return false;};}if(lnks[i].className=="popupTaxAndRateDetails"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupTaxAndRateDetails(this.getAttribute("href"));return false;};}if(lnks[i].className=="popupPlanDetails"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupPlanDetails(this.getAttribute("href"));return false;};}if(lnks[i].className=="popupRoomPlanDetails"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupRoomPlanDetails(this.getAttribute("href"));return false;
};}if(lnks[i].className=="popupPurchasePoints"){addClassName(lnks[i],"pops");lnks[i].onclick=function(){popupPurchasePoints(this.getAttribute("href"));return false;};}if(lnks[i].className=="view3DvirtualTour"){lnks[i].onclick=function(){popupRoomDetails(this.getAttribute("href"));return false;};}}}addLoadEvent(prepareLinks);function globalshow(el,blockorinline){var el=getId(el);el.style.display=blockorinline;}function globalhide(el){var el=getId(el);el.style.display="none";}jQuery(document).ready(function(){});
function limitText(textArea,limitCountSpan,limitNum){var limitField=jQuery(textArea);var limitCount=jQuery("#"+limitCountSpan);if(limitField.length==0){return ;}if(limitField.val().length>limitNum){limitField.val(limitField.val().substring(0,limitNum));}limitCount.html(Number(limitNum)-Number(limitField.val().length));if(limitNum-limitField.val().length==0){limitCount.html("0");}}function calculateNumberOfNights(startDate,endDate){if(startDate!=null&&endDate!=null){var non=0;if(endDate.isBefore(startDate)){var swapDate=startDate;
startDate=endDate;endDate=swapDate;}if(startDate.isBefore(endDate)){while(startDate.isBefore(endDate)&&non<2000){non++;startDate=startDate.add("d",1);}}return non;}return null;}function chomp(text){return text.replace(/(\n|\r)+$/,"");}function submitFormByAnchor(anchor){anchor=jQuery(anchor);var href=anchor.attr("href");anchor.attr("href","#");submitFormByElementAndURL(anchor,href);}function submitFormByElementAndURL(element,url){var form=findParent(element,"form");form.attr("method","POST");form.attr("action",url);
form.submit();}function findParent(element,parentTagName){var parentArray=jQuery(element).parents();for(var i=0;i<parentArray.size();i++){var parent=parentArray[i];if(parent.tagName.toLowerCase()==parentTagName.toLowerCase()){return jQuery(parent);}}return jQuery();}
/*############ End common/js/plug/global.js ############*/
/*############ Begin common/js/plug/hotel_search_widget.js ############*/
jQuery(window).load(function(){var codePromo=jQuery("#specialCodePromotion");var codeGroup=jQuery("#specialCodeGroup");
var codeCorp=jQuery("#specialCodeCorporate");var codeTravel=jQuery("#specialCodeTravelAgent");if(codePromo.length&&codeGroup.length&&codeCorp.length&&codeTravel.length){if(codePromo.val().length==0&&codeGroup.val().length==0&&codeCorp.val().length==0&&codeTravel.val().length==0){jQuery("#searchWidgetOptionalFields").hide();}else{if(addSpecialRateCodes!=undefined){jQuery("#showOrHideSpecialRateCodes").text(addSpecialRateCodes).addClass("expanded").removeClass("collapsed");}}}jQuery("#fsRoomsHHonors").hide();
jQuery("#fsFlexibleNumberOfNights").hide();showAppropriateNumberOfRoomRows(jQuery("#numberOfRooms"));var roomsInd=jQuery("#numberOfRooms").val();showAppropriateNumberOfRoomRows(roomsInd);rewardSearchResetToOneRoomAndOtherToggles(jQuery("#checkRewardSearch")[0]);jQuery(".togglerHider").click(function(){widgetDivId=jQuery(this).attr("rel");jQuery("#"+widgetDivId).show();jQuery(this).parent().parent().hide();return false;});jQuery(".jpSearchWidget").searchwidget({backText:G_SEARCHWIDGET_BACK,selectText:G_SEARCHWIDGET_SELECT,topDestinationsText:G_SEARCHWIDGET_TOPDESTINATIONS,cancelText:G_SEARCHWIDGET_CANCEL,allCitiesText:G_SEARCHWIDGET_ALLCITIES,brandCode:G_BRAND});
});function showAppropriateNumberOfRoomRows(ind){var ind=jQuery("#numberOfRooms").val();if(ind<5){jQuery(".roomNumberLabel,.colNumberOfChildren,.colNumberOfAdults,#fsSpecialAccounts,.searchToggler").show();jQuery("#tableRoomQuantity tbody tr").slice(0,ind).css("display","");jQuery("#tableRoomQuantity tbody tr").slice(ind).css("display","none");jQuery(".roomNumberLabel").show();if(ind==1){jQuery(".roomNumberLabel").hide();}}if(ind>=5){jQuery("#tableRoomQuantity tbody tr").slice(1).css("display","none");
jQuery(".roomNumberLabel,.colNumberOfChildren,.colNumberOfAdults,#fsSpecialAccounts,.searchToggler").hide();}}function blurCheckForLength(){var fsCheckRememberMe=jQuery("#fsCheckRememberMe");var codeCorporate=jQuery("#specialCodeCorporate");var codeTravelAgent=jQuery("#specialCodeTravelAgent");var hasFocus=false;if(hasFocus||(codeCorporate.val().length!=0)||(codeTravelAgent.val().length!=0)){fsCheckRememberMe.css("visibility","visible");}else{fsCheckRememberMe.css("visibility","hidden");jQuery("#checkRememberSpecialCodes").removeAttr("checked");
}}function rewardSearchResetToOneRoomAndOtherToggles(checkbox){if(jQuery(checkbox).attr("checked")){jQuery("#numberOfRooms").val(1);showAppropriateNumberOfRoomRows();jQuery("#fsSpecialCodeCorporate,#fsSpecialCodeTravelAgent,.colNumberOfRooms").hide();jQuery("#fsRoomsHHonors").show();}else{jQuery("#fsSpecialCodeCorporate,#fsSpecialCodeTravelAgent,.colNumberOfRooms").show();jQuery("#fsRoomsHHonors").hide();}}function toggleFieldsBasedOnFixedOrFlexibleDates(checkbox){if(jQuery(checkbox).attr("checked")){jQuery("#fsCheckout,p#numberOfNights").hide();
jQuery("#fsFlexibleNumberOfNights").show();jQuery('label[for="checkin"]').text("Arriving Around");}else{jQuery("#fsCheckout,p#numberOfNights").show();jQuery("#fsFlexibleNumberOfNights").hide();jQuery('label[for="checkin"]').text("Arrival");}}function toggleOptionalFields(link,txt1,txt2){var $jlink=jQuery(link);href=$jlink.attr("href");if($jlink.hasClass("collapsed")){jQuery(href).show();$jlink.addClass("expanded").removeClass("collapsed");$jlink.text(txt2);}else{jQuery(href).hide();$jlink.removeClass("expanded").addClass("collapsed");
$jlink.text(txt1);}}function toggleTheBrandSearchWidget(toggler){var toggler=jQuery(toggler);if(toggler.hasClass("clickableHeaderCollapsed")){toggler.removeClass("clickableHeaderCollapsed");toggler.addClass("clickableHeaderExpanded");jQuery("#header #bsw").addClass("expandedHeaderBSW");jQuery(".allButHeader").show();}else{toggler.addClass("clickableHeaderCollapsed");toggler.removeClass("clickableHeaderExpanded");jQuery("#header #bsw").removeClass("expandedHeaderBSW");jQuery(".allButHeader").hide();
}}function submitHotelSearchWidgetForm(){if(!jQuery("#searchWidgetOptionalFields").is(":visible")){jQuery("#specialCodePromotion,#specialCodeGroup,#specialCodeCorporate,#specialCodeTravelAgent").val("");}jQuery("#bswWaiting").removeClass("hide2");var ie7ImgSrc=jQuery("#bswWaiting img").attr("src");jQuery(".hotelSearchWidgetForm").submit();jQuery("#bswWaiting img").attr("src",ie7ImgSrc);}function submitEventBSWForm(){jQuery("#bswWaiting").show().css("visibility","visible");}
/*############ End common/js/plug/hotel_search_widget.js ############*/
/*############ Begin common/js/plug/yuiCal_customer.js ############*/
YAHOO.namespace("customer.cal");
YAHOO.customer.cal.CAL_CONFIG={DATE_FORMAT_STRING:G_DATE_FORMAT_SHORT,START_WEEKDAY:0,ARRIVAL_TITLE:G_CAL_ARRIVAL,DEPARTURE_TITLE:G_CAL_DEPARTURE,MONTHS_LONG:G_MONTHS,WEEKDAYS_SHORT:G_CAL_SHORT_WEEKDAYS,YUI_DATE_FORMAT_STRING:"MM/dd/yyyy",YUI_PAGE_DATE_FORMAT_STRING:"MM/yyyy",SOFT_SELECT_CLASS:"softSelectedDate",CHECKIN_CAL_ID:"custCheckinCal",CHECKIN_CAL_CONTAINER:"custCal1Container",CHECKIN_CAL_ICON:"custIcoCalCheckIn",CHECKIN_TEXT_BOX:"custCheckin",CHECKIN_SELECT_BOX_YM:"custCheckinYearMonth",CHECKIN_SELECT_BOX_D:"custCheckinDay",CHECKIN_DAY_NAME_LABEL:"dpCheckinDayOfWeekLabel",CHECKIN_FIELDSET:"fsCheckin",CHECKIN_CAL_OPEN:false,CHECKOUT_CAL_ID:"custCheckoutCal",CHECKOUT_CAL_CONTAINER:"custCal2Container",CHECKOUT_CAL_ICON:"custIcoCalCheckOut",CHECKOUT_TEXT_BOX:"custCheckout",CHECKOUT_SELECT_BOX_YM:"custCheckoutYearMonth",CHECKOUT_SELECT_BOX_D:"custCheckoutDay",CHECKOUT_DAY_NAME_LABEL:"dpCheckoutDayOfWeekLabel",CHECKOUT_FIELDSET:"fsCheckout",CHECKOUT_CAL_OPEN:false,DATES_FIELDSET:"fsDates",NUMBER_OF_NIGHTS_P:"numberOfNights",NUMBER_OF_NIGHTS_SPAN:"numberOfNightsSpan",NIGHT_STAY_TEXT:"nightStayText",ZERO_NIGHT_STAY_TEXT:"zeroNightStayText",DEPARTURE_FROM_ARRIVAL_RANGE:90,REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE:9,REWARDS_CHECKBOX:"rewardBooking",ARRIVAL_FROM_TODAY_RANGE:-365,ARRIVAL_TO_TODAY_RANGE:729};
YAHOO.customer.cal.ERROR_CONFIG={ERROR_LIST_ID:"datesErrorList",ERROR_ARRIVAL_DATE_EMPTY:"arrivalDateFieldEmpty",ERROR_ARRIVAL_DATE_EARLIER:"arrivalDateEarlierThanToday",ERROR_ARRIVAL_DATE_INVALID:"arrivalDateNotValid",ERROR_ARRIVAL_DATE_TOO_FAR:"reservationBeyondTwoYears",ERROR_DEPARTURE_DATE_EMPTY:"departureDateFieldEmpty",ERROR_DEPARTURE_DATE_BEFORE:"departureBeforeArrival",ERROR_DEPARTURE_DATE_INVALID:"departureDateNotValid",ERROR_DEPARTURE_TOO_FAR:"departureDateTooFar",ERROR_DEPARTURE_HHONORS_RANGE:"hhonorsRewardRange",CHECKIN_ERROR_CLASS:"arrivalError",CHECKOUT_ERROR_CLASS:"departureError"};
Date.preferAmericanFormat=false;Date.dayNames=G_WEEKDAYS;YAHOO.customer.cal.init=function(){var minArrivalDate=new Date().add("d",YAHOO.customer.cal.CAL_CONFIG.ARRIVAL_FROM_TODAY_RANGE);var minDepartureDate=new Date().add("d",YAHOO.customer.cal.CAL_CONFIG.ARRIVAL_FROM_TODAY_RANGE);var maxArrivalDate=new Date().add("d",YAHOO.customer.cal.CAL_CONFIG.ARRIVAL_TO_TODAY_RANGE);var maxDepartureDate=maxArrivalDate.add("d",YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);YAHOO.customer.cal.checkinCal=new YAHOO.widget.CalendarGroup(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_CONTAINER,{MULTI_SELECT:false,PAGES:2,CLOSE:true,IFRAME:true,MINDATE:minArrivalDate,MAXDATE:maxArrivalDate,TITLE:YAHOO.customer.cal.CAL_CONFIG.ARRIVAL_TITLE,START_WEEKDAY:YAHOO.customer.cal.CAL_CONFIG.START_WEEKDAY,MONTHS_LONG:YAHOO.customer.cal.CAL_CONFIG.MONTHS_LONG,WEEKDAYS_SHORT:YAHOO.customer.cal.CAL_CONFIG.WEEKDAYS_SHORT});
YAHOO.customer.cal.checkoutCal=new YAHOO.widget.CalendarGroup(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_CONTAINER,{MULTI_SELECT:false,PAGES:2,CLOSE:true,IFRAME:true,MINDATE:minDepartureDate,MAXDATE:maxDepartureDate,TITLE:YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_TITLE,START_WEEKDAY:YAHOO.customer.cal.CAL_CONFIG.START_WEEKDAY,MONTHS_LONG:YAHOO.customer.cal.CAL_CONFIG.MONTHS_LONG,WEEKDAYS_SHORT:YAHOO.customer.cal.CAL_CONFIG.WEEKDAYS_SHORT});YAHOO.customer.cal.checkinCal.render();
YAHOO.customer.cal.checkoutCal.render();YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ICON,"click",YAHOO.customer.cal.checkinCal.show,YAHOO.customer.cal.checkinCal,true);YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX,"click",YAHOO.customer.cal.checkinCal.show,YAHOO.customer.cal.checkinCal,true);YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ICON,"click",YAHOO.customer.cal.checkoutCal.show,YAHOO.customer.cal.checkoutCal,true);
YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX,"click",YAHOO.customer.cal.checkoutCal.show,YAHOO.customer.cal.checkoutCal,true);if(G_LOCALE=="ja_JP"){YAHOO.util.Event.addListener([YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D],"change",YAHOO.customer.cal.updateCalendar,YAHOO.customer.cal.checkinCal,true);YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX,"focus",YAHOO.customer.cal.updateCalendar,YAHOO.customer.cal.checkinCal,true);
YAHOO.util.Event.addListener([YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D],"change",YAHOO.customer.cal.updateCalendar,YAHOO.customer.cal.checkoutCal,true);YAHOO.util.Event.addListener(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX,"focus",YAHOO.customer.cal.updateCalendar,YAHOO.customer.cal.checkoutCal,true);}YAHOO.customer.cal.checkoutCal.beforeShowEvent.subscribe(YAHOO.customer.cal.hideOtherCalendar,YAHOO.customer.cal.checkoutCal,true);
YAHOO.customer.cal.checkoutCal.beforeShowEvent.subscribe(YAHOO.customer.cal.addSoftSelectedDate,YAHOO.customer.cal.checkoutCal,true);YAHOO.customer.cal.checkoutCal.changePageEvent.subscribe(YAHOO.customer.cal.addSoftSelectedDate,YAHOO.customer.cal.checkoutCal,true);YAHOO.customer.cal.checkoutCal.hideEvent.subscribe(YAHOO.customer.cal.removeSoftSelectedDate,YAHOO.customer.cal.checkoutCal,true);YAHOO.customer.cal.checkoutCal.selectEvent.subscribe(YAHOO.customer.cal.writeFromCalendarToTextBox,YAHOO.customer.cal.checkoutCal,true);
if(G_LOCALE=="ja_JP"){YAHOO.customer.cal.checkoutCal.selectEvent.subscribe(YAHOO.customer.cal.writeFromCalendarToSelectBox,YAHOO.customer.cal.checkoutCal,true);}YAHOO.customer.cal.checkinCal.beforeShowEvent.subscribe(YAHOO.customer.cal.hideOtherCalendar,YAHOO.customer.cal.checkinCal,true);YAHOO.customer.cal.checkinCal.beforeShowEvent.subscribe(YAHOO.customer.cal.addSoftSelectedDate,YAHOO.customer.cal.checkinCal,true);YAHOO.customer.cal.checkinCal.changePageEvent.subscribe(YAHOO.customer.cal.addSoftSelectedDate,YAHOO.customer.cal.checkinCal,true);
YAHOO.customer.cal.checkinCal.hideEvent.subscribe(YAHOO.customer.cal.removeSoftSelectedDate,YAHOO.customer.cal.checkinCal,true);YAHOO.customer.cal.checkinCal.selectEvent.subscribe(YAHOO.customer.cal.writeFromCalendarToTextBox,YAHOO.customer.cal.checkinCal,true);if(G_LOCALE=="ja_JP"){YAHOO.customer.cal.checkinCal.selectEvent.subscribe(YAHOO.customer.cal.writeFromCalendarToSelectBox,YAHOO.customer.cal.checkinCal,true);}YAHOO.customer.cal.checkinCal.selectEvent.subscribe(YAHOO.customer.cal.autoIncrementCheckoutDate,YAHOO.customer.cal.checkinCal,true);
YAHOO.customer.cal.checkinCal.selectEvent.subscribe(YAHOO.customer.cal.adjustCheckoutCalRange,YAHOO.customer.cal.checkoutCal,true);YAHOO.customer.cal.selectDateAndPage(YAHOO.customer.cal.checkoutCal,YAHOO.customer.cal.getCheckoutDate());YAHOO.customer.cal.selectDateAndPage(YAHOO.customer.cal.checkinCal,YAHOO.customer.cal.getCheckinDate());};YAHOO.util.Event.onDOMReady(YAHOO.customer.cal.init);YAHOO.customer.cal.updateCalendar=function(type,args,obj){var selDay=null;var selYear=null;var newDate=new Date();
var day=null;var year=null;var month=null;var changedElement=YAHOO.util.Event.getTarget(type);if(changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM||changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D){selDay=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D);selYear=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);day=parseInt(selDay.options[selDay.selectedIndex].value);var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");
if(yearMonth.length>1){year=yearMonth[0];month=yearMonth[1];}}else{if(changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM||changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D){selDay=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);selYear=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);day=parseInt(selDay.options[selDay.selectedIndex].value);var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");
if(yearMonth.length>1){year=yearMonth[0];month=yearMonth[1];}}else{if(changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX||changedElement.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX){var dateValue=document.getElementById(changedElement.id).value;if(dateValue!=null){var dateObj=Date.parseString(dateValue,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING);year=dateObj.getFullYear();month=dateObj.getMonth()+1;day=dateObj.getDate();}}}}if(!isNaN(day)&&!isNaN(year)&&!isNaN(month)){var date=month+"/"+day+"/"+year;
this.select(date);this.cfg.setProperty("pagedate",month+"/"+year);this.render();}};YAHOO.customer.cal.validateCheckoutDate=function(type,args,obj){var checkoutString=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val();if(chomp(checkoutString)==""){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_EMPTY,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID);return false;}else{if(Date.isValid(checkoutString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING)){var departureDate=Date.parseString(checkoutString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING);
jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val(departureDate.format(YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING));var arrivalDate=YAHOO.customer.cal.getCheckinDate();if(arrivalDate==null){return false;}var maxDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);if(jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.REWARDS_CHECKBOX).attr("checked")){maxDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",YAHOO.customer.cal.CAL_CONFIG.REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE);
}if(departureDate.isBefore(arrivalDate)){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_BEFORE,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID);return false;}else{if(departureDate.isAfter(maxDepartureDate)){if(jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.REWARDS_CHECKBOX).attr("checked")){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_DEPARTURE_HHONORS_RANGE,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID);}else{var nightsAway=calculateNumberOfNights(arrivalDate,departureDate);
YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_DEPARTURE_TOO_FAR,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID,nightsAway);}return false;}}YAHOO.customer.cal.clearDepartureErrors();YAHOO.customer.cal.checkoutCal.select(departureDate);YAHOO.customer.cal.selectDateAndPage(YAHOO.customer.cal.checkoutCal,departureDate);return true;}}YAHOO.customer.cal.clearDepartureErrors();YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_INVALID,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID);
return false;};YAHOO.customer.cal.validateCheckinDate=function(type,args,obj){var checkinString=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val();if(chomp(checkinString)==""){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_EMPTY,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;}else{if(Date.isValid(checkinString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING)){var arrivalDate=Date.parseString(checkinString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING);
jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val(arrivalDate.format(YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING));var today=new Date().clearTime();var maxArrivalDate=new Date().add("d",YAHOO.customer.cal.CAL_CONFIG.ARRIVAL_FROM_TODAY_RANGE).clearTime();if(arrivalDate.isBefore(today)){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_EARLIER,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;}else{if(arrivalDate.isAfter(maxArrivalDate)){YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_TOO_FAR,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID);
return false;}}YAHOO.customer.cal.clearArrivalErrors();YAHOO.customer.cal.checkinCal.select(arrivalDate);YAHOO.customer.cal.selectDateAndPage(YAHOO.customer.cal.checkinCal,arrivalDate);return true;}}YAHOO.customer.cal.clearArrivalErrors();YAHOO.customer.cal.calErrorHandler(YAHOO.customer.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_INVALID,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;};YAHOO.customer.cal.updateDayDisplay=function(type,args,obj){var jsDate=null;var labelField=null;if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){jsDate=YAHOO.customer.cal.getCheckinDate();
labelField=YAHOO.customer.cal.CAL_CONFIG.CHECKIN_DAY_NAME_LABEL;}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){jsDate=YAHOO.customer.cal.getCheckoutDate();labelField=YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL;}}return YAHOO.customer.cal.updateDayDisplayText(jsDate,labelField);};YAHOO.customer.cal.updateNumberOfNightsDisplayText=function(type,args,obj){return YAHOO.customer.cal.updateNumberOfNightsText(YAHOO.customer.cal.getCheckinDate(),YAHOO.customer.cal.getCheckoutDate());
};YAHOO.customer.cal.hideOtherCalendar=function(type,args,obj){if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_OPEN=true;YAHOO.customer.cal.checkoutCal.hide();}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN=true;YAHOO.customer.cal.checkinCal.hide();}}};YAHOO.customer.cal.removeSoftSelectedDate=function(type,args,obj){var calContainer=null;if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){calContainer=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_CONTAINER);
}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){calContainer=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_CONTAINER);}}var h=calContainer.find("."+YAHOO.customer.cal.CAL_CONFIG.SOFT_SELECT_CLASS);h.removeClass(YAHOO.customer.cal.CAL_CONFIG.SOFT_SELECT_CLASS);return true;};YAHOO.customer.cal.addSoftSelectedDate=function(type,args,obj){var jsDate=null;if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){jsDate=YAHOO.customer.cal.getCheckoutDate();}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){jsDate=YAHOO.customer.cal.getCheckinDate();
}}if(jsDate==null){return true;}var year=jsDate.format("yyyy");var month=jsDate.format("M");var day=jsDate.format("d");var dateSelectorString=".y"+year+" .m"+month+" .d"+day;jQuery(dateSelectorString).addClass(YAHOO.customer.cal.CAL_CONFIG.SOFT_SELECT_CLASS);return true;};YAHOO.customer.cal.autoIncrementCheckoutDate=function(type,args,obj){var arrivalDate=YAHOO.customer.cal.getCheckinDate();var departureDate=YAHOO.customer.cal.getCheckoutDate();if(arrivalDate==null){return false;}if(departureDate==null||arrivalDate.isAfter(departureDate)){var newDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",1);
jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val(newDepartureDate.format(YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING));YAHOO.customer.cal.selectDateAndPage(YAHOO.customer.cal.checkoutCal,newDepartureDate);YAHOO.customer.cal.updateDayDisplayText(newDepartureDate,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL);if(G_LOCALE=="ja_JP"){var yearMonthBox=null;var dayBox=null;var dateField=null;yearMonthBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);
dayBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);var maxDateMonth=yearMonthBox.options[(yearMonthBox.length-1)].value.split("/");var maxYear;var maxMonth;if(maxDateMonth.length>1){maxYear=maxDateMonth[0];maxMonth=maxDateMonth[1];}var maxDateDay=dayBox.options[(dayBox.length-1)].value.split(G_JP_DATE_FORMAT_DAY_SUFFIX);maxDateDay=maxDateDay[0];var maxStringDate=createDate(maxYear,addZero(maxMonth),maxDateDay);var maxSelectableDate=Date.parseString(maxStringDate,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING);
if(maxSelectableDate.isBefore(newDepartureDate)){newDepartureDate=maxSelectableDate;}var year=newDepartureDate.getFullYear();var month=newDepartureDate.getMonth()+1;var day=newDepartureDate.getDate();dayBox.selectedIndex=day-1;for(var y=0;y<yearMonthBox.options.length;y++){if(yearMonthBox.options[y].value==(year+"/"+month)){yearMonthBox.selectedIndex=y;break;}}}}return true;};YAHOO.customer.cal.adjustCheckoutCalRange=function(type,args,obj){var arrivalDate=YAHOO.customer.cal.getCheckinDate();var departureDate=YAHOO.customer.cal.getCheckoutDate();
if(arrivalDate==null){return false;}obj.cfg.setProperty("MINDATE",arrivalDate);var maxDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);if(departureDate!=null&&departureDate.isAfter(maxDepartureDate)){departureDate=maxDepartureDate;obj.select(maxDepartureDate);obj.cfg.setProperty("PAGEDATE",departureDate.format(YAHOO.customer.cal.CAL_CONFIG.YUI_PAGE_DATE_FORMAT_STRING));}obj.cfg.setProperty("MAXDATE",maxDepartureDate);var dateValue=arrivalDate;
var year=arrivalDate.getFullYear();var month=(arrivalDate.getMonth()+1);var maxDateOfMonth=YAHOO.widget.DateMath.findMonthEnd(dateValue).getDate();obj.render();return true;};YAHOO.customer.cal.writeFromCalendarToSelectBox=function(type,args,obj){var dates=args[0];var date=dates[0];var year=date[0];var month=date[1];var day=date[2];var jsDate=new Date();jsDate.setFullYear(date[0],date[1]-1,date[2]);var yearMonthBox=null;var dayBox=null;var dateField=null;if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.customer.cal.clearArrivalErrors();
dateField=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX);yearMonthBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);dayBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D);}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.customer.cal.clearDepartureErrors();dateField=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX);yearMonthBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);
dayBox=document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);}}dayBox.selectedIndex=day-1;for(var y=0;y<yearMonthBox.options.length;y++){if(yearMonthBox.options[y].value==(year+"/"+month)){yearMonthBox.selectedIndex=y;break;}}if(document.getElementById(YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM)!=null){updateDepartureRange(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D,YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM,true);
}else{restrictDayValues(YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D,YAHOO.customer.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);}obj.hide();};YAHOO.customer.cal.writeFromCalendarToTextBox=function(type,args,obj){var dates=args[0];var date=dates[0];var jsDate=new Date();jsDate.setFullYear(date[0],date[1]-1,date[2]);var yearMonthBox=null;var dayBox=null;var dateField=null;if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.customer.cal.clearArrivalErrors();dateField=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX);
}else{if(obj.id==YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.customer.cal.clearDepartureErrors();dateField=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX);}}dateField.val(jsDate.format(YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING));obj.hide();};YAHOO.customer.cal.getCheckinDate=function(){var checkinDateString=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val();if(Date.isValid(checkinDateString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING)){return Date.parseString(checkinDateString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING).clearTime();
}return null;};YAHOO.customer.cal.getCheckoutDate=function(){var checkoutDateString=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val();if(Date.isValid(checkoutDateString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING)){return Date.parseString(checkoutDateString,YAHOO.customer.cal.CAL_CONFIG.DATE_FORMAT_STRING).clearTime();}return null;};YAHOO.customer.cal.updateNumberOfNightsText=function(arrivalDate,departureDate){if(arrivalDate==null||departureDate==null){jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("");
return false;}var nightDifference=calculateNumberOfNights(arrivalDate,departureDate);if(nightDifference<0){return false;}var nightStayTextInput=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NIGHT_STAY_TEXT);var zeroNightStayTextInput=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.ZERO_NIGHT_STAY_TEXT);if(nightStayTextInput.length<0||zeroNightStayTextInput.length<0){return ;}if(nightDifference>0){jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("<span id='"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_SPAN+"'></span> "+nightStayTextInput.val());
jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_SPAN).html(nightDifference);}else{if(nightDifference==0){jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html(zeroNightStayTextInput.val());}else{jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("");}}return true;};YAHOO.customer.cal.updateDayDisplayText=function(jsDate,labelFieldId){if(jsDate==null){jQuery("#"+labelFieldId).html("");return false;}jQuery("#"+labelFieldId).html(jsDate.getDayName());return true;
};YAHOO.customer.cal.selectDateAndPage=function(yuiCal,jsDate){if(jsDate!=null){yuiCal.cfg.setProperty("PAGEDATE",jsDate.format(YAHOO.customer.cal.CAL_CONFIG.YUI_PAGE_DATE_FORMAT_STRING));yuiCal.cfg.setProperty("SELECTED",jsDate.format(YAHOO.customer.cal.CAL_CONFIG.YUI_DATE_FORMAT_STRING));}yuiCal.render();};YAHOO.customer.cal.clearArrivalErrors=function(){jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_DAY_NAME_LABEL).show();jQuery("#"+YAHOO.customer.cal.ERROR_CONFIG.ERROR_LIST_ID).children("ul").children("li."+YAHOO.customer.cal.ERROR_CONFIG.CHECKIN_ERROR_CLASS).hide();
jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKIN_FIELDSET).removeClass("inline error");YAHOO.customer.cal.checkAndHandleNoErrors();};YAHOO.customer.cal.clearDepartureErrors=function(){jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL).show();jQuery("#"+YAHOO.customer.cal.ERROR_CONFIG.ERROR_LIST_ID).children("ul").children("li."+YAHOO.customer.cal.ERROR_CONFIG.CHECKOUT_ERROR_CLASS).hide();jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_FIELDSET).removeClass("inline error");YAHOO.customer.cal.checkAndHandleNoErrors();
};YAHOO.customer.cal.checkAndHandleNoErrors=function(){var datesFs=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.DATES_FIELDSET);var errorList=jQuery("#"+YAHOO.customer.cal.ERROR_CONFIG.ERROR_LIST_ID);var numNightsP=jQuery("#"+YAHOO.customer.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P);if(datesFs.find(".inline.error").length<=0){errorList.hide();numNightsP.show();}};YAHOO.customer.cal.calErrorHandler=function(errorName,calId,param){};YAHOO.customer.cal.adjustDepartureCalRange=function(checkbox){if(YAHOO.customer.cal.getCheckinDate()==null){return ;
}var departureDate=YAHOO.customer.cal.getCheckoutDate();var maxDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",YAHOO.customer.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);if(jQuery(checkbox).attr("checked")){maxDepartureDate=YAHOO.customer.cal.getCheckinDate().add("d",YAHOO.customer.cal.CAL_CONFIG.REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE);}if(departureDate.isAfter(maxDepartureDate)){departureDate=YAHOO.customer.cal.getCheckinDate().add("d",1);YAHOO.customer.cal.checkoutCal.cfg.setProperty("SELECTED",departureDate.format(YAHOO.customer.cal.CAL_CONFIG.YUI_DATE_FORMAT_STRING));
}YAHOO.customer.cal.updateNumberOfNightsText(YAHOO.customer.cal.getCheckinDate(),departureDate);YAHOO.customer.cal.checkoutCal.cfg.setProperty("MAXDATE",maxDepartureDate);YAHOO.customer.cal.checkoutCal.render();};jQuery(document).ready(function(){jQuery(document).click(function(){if(!YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_OPEN&&YAHOO.customer.cal.checkinCal!=null){YAHOO.customer.cal.checkinCal.hide();}if(!YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN&&YAHOO.customer.cal.checkoutCal!=null){YAHOO.customer.cal.checkoutCal.hide();
}YAHOO.customer.cal.CAL_CONFIG.CHECKIN_CAL_OPEN=false;YAHOO.customer.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN=false;});});
/*############ End common/js/plug/yuiCal_customer.js ############*/
/*############ Begin common/js/plug/yuiCal_search.js ############*/
YAHOO.namespace("search.cal");YAHOO.search.cal.CAL_CONFIG={DATE_FORMAT_STRING:G_DATE_FORMAT_SHORT,START_WEEKDAY:0,ARRIVAL_TITLE:G_CAL_ARRIVAL,DEPARTURE_TITLE:G_CAL_DEPARTURE,MONTHS_LONG:G_MONTHS,WEEKDAYS_SHORT:G_CAL_SHORT_WEEKDAYS,YUI_DATE_FORMAT_STRING:"MM/dd/yyyy",YUI_PAGE_DATE_FORMAT_STRING:"MM/yyyy",SOFT_SELECT_CLASS:"softSelectedDate",CHECKIN_CAL_ID:"searchCheckinCal",CHECKIN_CAL_CONTAINER:"searchCheckinCalContainer",CHECKIN_CAL_ICON:"searchIcoCalCheckIn",CHECKIN_TEXT_BOX:"searchCheckin",CHECKIN_SELECT_BOX_YM:"searchCheckinYearMonth",CHECKIN_SELECT_BOX_D:"searchCheckinDay",CHECKIN_DAY_NAME_LABEL:"searchCheckinDayOfWeekLabel",CHECKIN_FIELDSET:"fsCheckin",CHECKIN_CAL_OPEN:false,CHECKOUT_CAL_ID:"searchCheckoutCal",CHECKOUT_CAL_CONTAINER:"searchCheckoutCalContainer",CHECKOUT_CAL_ICON:"searchIcoCalCheckOut",CHECKOUT_TEXT_BOX:"searchCheckout",CHECKOUT_SELECT_BOX_YM:"searchCheckoutYearMonth",CHECKOUT_SELECT_BOX_D:"searchCheckoutDay",CHECKOUT_DAY_NAME_LABEL:"searchCheckoutDayOfWeekLabel",CHECKOUT_FIELDSET:"fsCheckout",CHECKOUT_CAL_OPEN:false,DATES_FIELDSET:"fsDates",NUMBER_OF_NIGHTS_P:"numberOfNights",NUMBER_OF_NIGHTS_SPAN:"numberOfNightsSpan",NIGHT_STAY_TEXT:"nightStayText",ZERO_NIGHT_STAY_TEXT:"zeroNightStayText",DEPARTURE_FROM_ARRIVAL_RANGE:90,REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE:90,REWARDS_CHECKBOX:"checkRewardSearch",ARRIVAL_FROM_TODAY_RANGE:729};
YAHOO.search.cal.ERROR_CONFIG={ERROR_LIST_ID:"datesErrorList",ERROR_ARRIVAL_DATE_EMPTY:"arrivalDateFieldEmpty",ERROR_ARRIVAL_DATE_EARLIER:"arrivalDateEarlierThanToday",ERROR_ARRIVAL_DATE_INVALID:"arrivalDateNotValid",ERROR_ARRIVAL_DATE_TOO_FAR:"reservationBeyondTwoYears",ERROR_DEPARTURE_DATE_EMPTY:"departureDateFieldEmpty",ERROR_DEPARTURE_DATE_BEFORE:"departureBeforeArrival",ERROR_DEPARTURE_DATE_INVALID:"departureDateNotValid",ERROR_DEPARTURE_TOO_FAR:"departureDateTooFar",ERROR_DEPARTURE_HHONORS_RANGE:"hhonorsRewardRange",CHECKIN_ERROR_CLASS:"arrivalError",CHECKOUT_ERROR_CLASS:"departureError"};
Date.preferAmericanFormat=false;Date.dayNames=G_WEEKDAYS;YAHOO.search.cal.init=function(){var minArrivalDate=new Date();var minDepartureDate=new Date();var maxArrivalDate=new Date().add("d",YAHOO.search.cal.CAL_CONFIG.ARRIVAL_FROM_TODAY_RANGE);var maxDepartureDate=new Date().add("d",YAHOO.search.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);var selectedDepartureDate=new Date().add("d",1);YAHOO.search.cal.checkinCal=new YAHOO.widget.CalendarGroup(YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID,YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_CONTAINER,{MULTI_SELECT:false,PAGES:2,CLOSE:true,IFRAME:true,MINDATE:minArrivalDate,MAXDATE:maxArrivalDate,TITLE:YAHOO.search.cal.CAL_CONFIG.ARRIVAL_TITLE,START_WEEKDAY:YAHOO.search.cal.CAL_CONFIG.START_WEEKDAY,MONTHS_LONG:YAHOO.search.cal.CAL_CONFIG.MONTHS_LONG,WEEKDAYS_SHORT:YAHOO.search.cal.CAL_CONFIG.WEEKDAYS_SHORT});
YAHOO.search.cal.checkoutCal=new YAHOO.widget.CalendarGroup(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_CONTAINER,{MULTI_SELECT:false,PAGES:2,CLOSE:true,IFRAME:true,MINDATE:minDepartureDate,MAXDATE:maxDepartureDate,TITLE:YAHOO.search.cal.CAL_CONFIG.DEPARTURE_TITLE,START_WEEKDAY:YAHOO.search.cal.CAL_CONFIG.START_WEEKDAY,MONTHS_LONG:YAHOO.search.cal.CAL_CONFIG.MONTHS_LONG,WEEKDAYS_SHORT:YAHOO.search.cal.CAL_CONFIG.WEEKDAYS_SHORT});YAHOO.search.cal.checkinCal.render();
YAHOO.search.cal.checkoutCal.render();YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ICON,"click",YAHOO.search.cal.checkinCal.show,YAHOO.search.cal.checkinCal,true);YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ICON,"click",YAHOO.search.cal.checkoutCal.show,YAHOO.search.cal.checkoutCal,true);YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX,"click",YAHOO.search.cal.checkinCal.show,YAHOO.search.cal.checkinCal,true);YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX,"click",YAHOO.search.cal.checkoutCal.show,YAHOO.search.cal.checkoutCal,true);
if(G_LOCALE=="ja_JP"){YAHOO.util.Event.addListener([YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM,YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D],"change",YAHOO.search.cal.validateCheckinDate,YAHOO.search.cal.checkinCal,true);YAHOO.util.Event.addListener([YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D],"change",YAHOO.search.cal.validateCheckoutDate,YAHOO.search.cal.checkoutCal,true);}else{YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX,"change",YAHOO.search.cal.validateCheckoutDate);
YAHOO.util.Event.addListener(YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX,"change",YAHOO.search.cal.validateCheckinDate);}YAHOO.search.cal.checkoutCal.beforeShowEvent.subscribe(YAHOO.search.cal.hideOtherCalendar,YAHOO.search.cal.checkoutCal,true);YAHOO.search.cal.checkoutCal.beforeShowEvent.subscribe(YAHOO.search.cal.addSoftSelectedDate,YAHOO.search.cal.checkoutCal,true);YAHOO.search.cal.checkoutCal.changePageEvent.subscribe(YAHOO.search.cal.addSoftSelectedDate,YAHOO.search.cal.checkoutCal,true);
YAHOO.search.cal.checkoutCal.hideEvent.subscribe(YAHOO.search.cal.removeSoftSelectedDate,YAHOO.search.cal.checkoutCal,true);if(G_LOCALE=="ja_JP"){YAHOO.search.cal.checkoutCal.selectEvent.subscribe(YAHOO.search.cal.writeFromCalendarToSelectBox,YAHOO.search.cal.checkoutCal,true);}YAHOO.search.cal.checkoutCal.selectEvent.subscribe(YAHOO.search.cal.writeFromCalendarToTextBox,YAHOO.search.cal.checkoutCal,true);YAHOO.search.cal.checkoutCal.selectEvent.subscribe(YAHOO.search.cal.updateDayDisplay,YAHOO.search.cal.checkoutCal,true);
YAHOO.search.cal.checkoutCal.selectEvent.subscribe(YAHOO.search.cal.updateNumberOfNightsDisplayText,YAHOO.search.cal.checkoutCal,true);YAHOO.search.cal.checkinCal.beforeShowEvent.subscribe(YAHOO.search.cal.hideOtherCalendar,YAHOO.search.cal.checkinCal,true);YAHOO.search.cal.checkinCal.beforeShowEvent.subscribe(YAHOO.search.cal.addSoftSelectedDate,YAHOO.search.cal.checkinCal,true);YAHOO.search.cal.checkinCal.changePageEvent.subscribe(YAHOO.search.cal.addSoftSelectedDate,YAHOO.search.cal.checkinCal,true);
YAHOO.search.cal.checkinCal.hideEvent.subscribe(YAHOO.search.cal.removeSoftSelectedDate,YAHOO.search.cal.checkinCal,true);if(G_LOCALE=="ja_JP"){YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.writeFromCalendarToSelectBox,YAHOO.search.cal.checkinCal,true);}YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.writeFromCalendarToTextBox,YAHOO.search.cal.checkinCal,true);YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.autoIncrementCheckoutDate,YAHOO.search.cal.checkinCal,true);
YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.updateDayDisplay,YAHOO.search.cal.checkinCal,true);YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.updateNumberOfNightsDisplayText,YAHOO.search.cal.checkinCal,true);YAHOO.search.cal.checkinCal.selectEvent.subscribe(YAHOO.search.cal.adjustCheckoutCalRange,YAHOO.search.cal.checkoutCal,true);YAHOO.search.cal.updateDayDisplayText(YAHOO.search.cal.getCheckinDate(),YAHOO.search.cal.CAL_CONFIG.CHECKIN_DAY_NAME_LABEL);YAHOO.search.cal.updateDayDisplayText(YAHOO.search.cal.getCheckoutDate(),YAHOO.search.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL);
YAHOO.search.cal.updateNumberOfNightsText(YAHOO.search.cal.getCheckinDate(),YAHOO.search.cal.getCheckoutDate());YAHOO.search.cal.selectDateAndPage(YAHOO.search.cal.checkoutCal,YAHOO.search.cal.getCheckoutDate());YAHOO.search.cal.selectDateAndPage(YAHOO.search.cal.checkinCal,YAHOO.search.cal.getCheckinDate());};YAHOO.util.Event.onDOMReady(YAHOO.search.cal.init);YAHOO.search.cal.updateCalendar=function(type,args,obj){var selDay=null;var selYear=null;var newDate=new Date();var day=null;var year=null;
var month=null;var changedElement=YAHOO.util.Event.getTarget(type);if(changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM||changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D){selDay=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D);selYear=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);day=parseInt(selDay.options[selDay.selectedIndex].value);var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");if(yearMonth.length>1){year=yearMonth[0];
month=yearMonth[1];}}else{if(changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM||changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D){selDay=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);selYear=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);day=parseInt(selDay.options[selDay.selectedIndex].value);var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");if(yearMonth.length>1){year=yearMonth[0];
month=yearMonth[1];}}else{if(changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX||changedElement.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX){var dateValue=document.getElementById(changedElement.id).value;if(dateValue!=null){var dateObj=Date.parseString(dateValue,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);year=dateObj.getFullYear();month=dateObj.getMonth()+1;day=dateObj.getDate();}}}}if(!isNaN(day)&&!isNaN(year)&&!isNaN(month)){var date=month+"/"+day+"/"+year;this.select(date);
this.cfg.setProperty("pagedate",month+"/"+year);this.render();}};addZero=function(val){val=val+"";val=StringUtils.trim(val);if(val.length==1){val="0"+val;}return val;};YAHOO.search.cal.validateCheckoutDate=function(type,args,obj){var checkoutString=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val();if(G_LOCALE=="ja_JP"){selDay=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);selYear=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);
day=selDay.options[selDay.selectedIndex].value.split(G_JP_DATE_FORMAT_DAY_SUFFIX);day=day[0];var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");if(yearMonth.length>1){year=yearMonth[0];month=yearMonth[1];}if(!isNaN(day)&&!isNaN(year)&&!isNaN(month)){month=addZero(month);day=addZero(day);var date=createDate(year,addZero(month),addZero(day));}checkoutString=date;}if(chomp(checkoutString)==""){YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_EMPTY,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID);
return false;}else{if(Date.isValid(checkoutString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING)){var departureDate=Date.parseString(checkoutString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val(departureDate.format(YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING));var arrivalDate=YAHOO.search.cal.getCheckinDate();if(arrivalDate==null){return false;}var maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);
if(jQuery("#"+YAHOO.search.cal.CAL_CONFIG.REWARDS_CHECKBOX).attr("checked")){maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE);}if(departureDate.isBefore(arrivalDate)){YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_BEFORE,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID);return false;}else{if(departureDate.isAfter(maxDepartureDate)){if(jQuery("#"+YAHOO.search.cal.CAL_CONFIG.REWARDS_CHECKBOX).attr("checked")){YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_DEPARTURE_HHONORS_RANGE,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID);
}else{var nightsAway=calculateNumberOfNights(arrivalDate,departureDate);YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_DEPARTURE_TOO_FAR,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID,nightsAway);}return false;}}YAHOO.search.cal.checkoutCal.select(departureDate);YAHOO.search.cal.selectDateAndPage(YAHOO.search.cal.checkoutCal,departureDate);return true;}}YAHOO.search.cal.clearDepartureErrors();YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_DEPARTURE_DATE_INVALID,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID);
return false;};YAHOO.search.cal.validateCheckinDate=function(type,args,obj){var checkinString=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val();if(G_LOCALE=="ja_JP"){selDay=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D);selYear=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);day=selDay.options[selDay.selectedIndex].value.split(G_JP_DATE_FORMAT_DAY_SUFFIX);day=day[0];var yearMonth=selYear.options[selYear.selectedIndex].value.split("/");
if(yearMonth.length>1){year=yearMonth[0];month=yearMonth[1];}if(!isNaN(day)&&!isNaN(year)&&!isNaN(month)){day=addZero(day);month=addZero(month);var date=createDate(year,addZero(month),addZero(day));}checkinString=date;}if(chomp(checkinString)==""){return false;}else{if(Date.isValid(checkinString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING)){var arrivalDate=Date.parseString(checkinString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val(arrivalDate.format(YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING));
var today=new Date().clearTime();var maxArrivalDate=new Date().add("d",YAHOO.search.cal.CAL_CONFIG.ARRIVAL_FROM_TODAY_RANGE).clearTime();if(arrivalDate.isBefore(today)){YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_EARLIER,YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;}else{if(arrivalDate.isAfter(maxArrivalDate)){YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_TOO_FAR,YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;
}}YAHOO.search.cal.checkinCal.select(arrivalDate);YAHOO.search.cal.selectDateAndPage(YAHOO.search.cal.checkinCal,arrivalDate);return true;}}YAHOO.search.cal.clearArrivalErrors();YAHOO.search.cal.calErrorHandler(YAHOO.search.cal.ERROR_CONFIG.ERROR_ARRIVAL_DATE_INVALID,YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID);return false;};YAHOO.search.cal.updateDayDisplay=function(type,args,obj){var jsDate=null;var labelField=null;if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){jsDate=YAHOO.search.cal.getCheckinDate();
labelField=YAHOO.search.cal.CAL_CONFIG.CHECKIN_DAY_NAME_LABEL;}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){jsDate=YAHOO.search.cal.getCheckoutDate();labelField=YAHOO.search.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL;}}return YAHOO.search.cal.updateDayDisplayText(jsDate,labelField);};YAHOO.search.cal.updateNumberOfNightsDisplayText=function(type,args,obj){return YAHOO.search.cal.updateNumberOfNightsText(YAHOO.search.cal.getCheckinDate(),YAHOO.search.cal.getCheckoutDate());};YAHOO.search.cal.hideOtherCalendar=function(type,args,obj){if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_OPEN=true;
YAHOO.search.cal.checkoutCal.hide();}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN=true;YAHOO.search.cal.checkinCal.hide();}}};YAHOO.search.cal.removeSoftSelectedDate=function(type,args,obj){var calContainer=null;if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){calContainer=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_CONTAINER);}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){calContainer=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_CONTAINER);
}}var h=calContainer.find("."+YAHOO.search.cal.CAL_CONFIG.SOFT_SELECT_CLASS);h.removeClass(YAHOO.search.cal.CAL_CONFIG.SOFT_SELECT_CLASS);return true;};YAHOO.search.cal.addSoftSelectedDate=function(type,args,obj){var jsDate=null;if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){jsDate=YAHOO.search.cal.getCheckoutDate();}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){jsDate=YAHOO.search.cal.getCheckinDate();}}if(jsDate==null){return true;}var year=jsDate.format("yyyy");var month=jsDate.format("M");
var day=jsDate.format("d");var dateSelectorString=".y"+year+" .m"+month+" .d"+day;jQuery(dateSelectorString).addClass(YAHOO.search.cal.CAL_CONFIG.SOFT_SELECT_CLASS);return true;};YAHOO.search.cal.autoIncrementCheckoutDate=function(type,args,obj){var arrivalDate=YAHOO.search.cal.getCheckinDate();var departureDate=YAHOO.search.cal.getCheckoutDate();if(arrivalDate==null||departureDate==null){return false;}if(arrivalDate.isAfter(departureDate)){var newDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",1);
jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val(newDepartureDate.format(YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING));YAHOO.search.cal.clearDepartureErrors();if(G_LOCALE=="ja_JP"){var yearMonthBox=null;var dayBox=null;var dateField=null;yearMonthBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);dayBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);var maxDateMonth=yearMonthBox.options[(yearMonthBox.length-1)].value.split("/");
var maxYear;var maxMonth;if(maxDateMonth.length>1){maxYear=maxDateMonth[0];maxMonth=maxDateMonth[1];}var maxDateDay=dayBox.options[(dayBox.length-1)].value.split(G_JP_DATE_FORMAT_DAY_SUFFIX);maxDateDay=maxDateDay[0];var maxStringDate=createDate(maxYear,addZero(maxMonth),maxDateDay);var maxSelectableDate=Date.parseString(maxStringDate,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);if(maxSelectableDate.isBefore(newDepartureDate)){newDepartureDate=maxSelectableDate;}var year=newDepartureDate.getFullYear();
var month=newDepartureDate.getMonth()+1;var day=newDepartureDate.getDate();dayBox.selectedIndex=day-1;for(var y=0;y<yearMonthBox.options.length;y++){if(yearMonthBox.options[y].value==(year+"/"+month)){yearMonthBox.selectedIndex=y;break;}}}YAHOO.search.cal.selectDateAndPage(YAHOO.search.cal.checkoutCal,newDepartureDate);YAHOO.search.cal.updateDayDisplayText(newDepartureDate,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL);}return true;};YAHOO.search.cal.adjustCheckoutCalRange=function(type,args,obj){var arrivalDate=YAHOO.search.cal.getCheckinDate();
var departureDate=YAHOO.search.cal.getCheckoutDate();if(G_LOCALE=="ja_JP"){updateDepartureRange(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D,YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D,YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);}if(arrivalDate==null){return false;}obj.cfg.setProperty("MINDATE",arrivalDate);var maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);if(jQuery("#"+YAHOO.search.cal.CAL_CONFIG.REWARDS_CHECKBOX).attr("checked")){maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE);
}if(departureDate.isAfter(maxDepartureDate)){departureDate=maxDepartureDate;obj.select(maxDepartureDate);}obj.cfg.setProperty("MAXDATE",maxDepartureDate);var dateValue=arrivalDate;var year=arrivalDate.getFullYear();var month=(arrivalDate.getMonth()+1);var maxDateOfMonth=YAHOO.widget.DateMath.findMonthEnd(dateValue).getDate();obj.cfg.setProperty("PAGEDATE",departureDate.format(YAHOO.search.cal.CAL_CONFIG.YUI_PAGE_DATE_FORMAT_STRING));obj.render();if(G_LOCALE=="ja_JP"){var checkoutDayObj=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);
var yearMonthCheckOutObj=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);var maxDateMonth=yearMonthCheckOutObj.options[(yearMonthCheckOutObj.length-1)].value.split("/");var maxYear;var maxMonth;if(maxDateMonth.length>1){maxYear=maxDateMonth[0];maxMonth=maxDateMonth[1];}var maxDateDay=checkoutDayObj.options[(checkoutDayObj.length-1)].value.split(G_JP_DATE_FORMAT_DAY_SUFFIX);maxDateDay=maxDateDay[0];var maxStringDate=createDate(maxYear,addZero(maxMonth),"01");var maxSelectableDate=Date.parseString(maxStringDate,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);
var maxSelectableDD=YAHOO.widget.DateMath.findMonthEnd(maxSelectableDate).getDate();maxStringDate=createDate(maxYear,addZero(maxMonth),maxSelectableDD);maxSelectableDate=Date.parseString(maxStringDate,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);if(maxSelectableDate.isBefore(departureDate)){departureDate=maxSelectableDate;obj.select(departureDate);obj.cfg.setProperty("PAGEDATE",departureDate.format(YAHOO.search.cal.CAL_CONFIG.YUI_PAGE_DATE_FORMAT_STRING));obj.render();}checkOutMonth=(departureDate.getMonth()+1);
checkOutDaySelected=departureDate.getDate();var checkOutDateValue=departureDate;var maxDateOfCheckOutMonth=YAHOO.widget.DateMath.findMonthEnd(checkOutDateValue).getDate();if(dateValue.isBefore(checkOutDateValue)){month=checkOutMonth+"";}else{if(selectedDay==maxDateOfMonth){month=parseInt(parseInt(month)+1)+"";}else{month=month+"";}}var checkOutDate=createDate(year,addZero(month),"01");var checkOutDateValue=Date.parseString(checkOutDate,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);var maxDateOfCheckOutMonth=YAHOO.widget.DateMath.findMonthEnd(checkOutDateValue).getDate();
if(checkoutDayObj.length!=maxDateOfCheckOutMonth){for(var loop=31;loop>=0;loop--){checkoutDayObj.remove(loop);}for(var loop=1;loop<=maxDateOfCheckOutMonth;loop++){checkoutDayObj.options[loop-1]=new Option(addZero(loop)+G_JP_DATE_FORMAT_DAY_SUFFIX,loop);}}if(checkOutDaySelected<=maxDateOfCheckOutMonth){checkoutDayObj.selectedIndex=checkOutDaySelected-1;}else{checkoutDayObj.selectedIndex=maxDateOfCheckOutMonth-1;}}return true;};YAHOO.search.cal.writeFromCalendarToSelectBox=function(type,args,obj){var dates=args[0];
var date=dates[0];var year=date[0];var month=date[1];var day=date[2];var jsDate=new Date();jsDate.setFullYear(date[0],date[1]-1,date[2]);var yearMonthBox=null;var dayBox=null;var dateField=null;if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.search.cal.clearArrivalErrors();dateField=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX);yearMonthBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_YM);dayBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKIN_SELECT_BOX_D);
}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.search.cal.clearDepartureErrors();dateField=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX);yearMonthBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_YM);dayBox=document.getElementById(YAHOO.search.cal.CAL_CONFIG.CHECKOUT_SELECT_BOX_D);}}var strMonth=month+"";var selectedDate=createDate(year,addZero(strMonth),"01");var dateValue=Date.parseString(selectedDate,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING);
var maxDateOfMonth=YAHOO.widget.DateMath.findMonthEnd(dateValue).getDate();if(dayBox.length!=maxDateOfMonth){for(var loop=31;loop>=0;loop--){dayBox.remove(loop);}for(var loop=1;loop<=maxDateOfMonth;loop++){dayBox.options[loop-1]=new Option(addZero(loop)+G_JP_DATE_FORMAT_DAY_SUFFIX,loop);}}dayBox.selectedIndex=day-1;for(var y=0;y<yearMonthBox.options.length;y++){if(yearMonthBox.options[y].value==(year+"/"+month)){yearMonthBox.selectedIndex=y;break;}}obj.hide();};YAHOO.search.cal.writeFromCalendarToTextBox=function(type,args,obj){var dates=args[0];
var date=dates[0];var jsDate=new Date();jsDate.setFullYear(date[0],date[1]-1,date[2]);var yearMonthBox=null;var dayBox=null;var dateField=null;if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_ID){YAHOO.search.cal.clearArrivalErrors();dateField=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX);}else{if(obj.id==YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_ID){YAHOO.search.cal.clearDepartureErrors();dateField=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX);}}dateField.val(jsDate.format(YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING));
obj.hide();};YAHOO.search.cal.getCheckinDate=function(){var checkinDateString=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_TEXT_BOX).val();if(Date.isValid(checkinDateString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING)){return Date.parseString(checkinDateString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING).clearTime();}return null;};YAHOO.search.cal.getCheckoutDate=function(){var checkoutDateString=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_TEXT_BOX).val();if(Date.isValid(checkoutDateString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING)){return Date.parseString(checkoutDateString,YAHOO.search.cal.CAL_CONFIG.DATE_FORMAT_STRING).clearTime();
}return null;};YAHOO.search.cal.updateNumberOfNightsText=function(arrivalDate,departureDate){if(arrivalDate==null||departureDate==null){jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("");return false;}var nightDifference=calculateNumberOfNights(arrivalDate,departureDate);if(nightDifference<0){return false;}var nightStayTextInput=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NIGHT_STAY_TEXT);var zeroNightStayTextInput=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.ZERO_NIGHT_STAY_TEXT);if(nightStayTextInput.length<0||zeroNightStayTextInput.length<0){return ;
}if(nightDifference>0){jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("<span id='"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_SPAN+"'></span> "+nightStayTextInput.val());jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_SPAN).html(nightDifference);}else{if(nightDifference==0){jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html(zeroNightStayTextInput.val());}else{jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P).html("");}}return true;};YAHOO.search.cal.updateDayDisplayText=function(jsDate,labelFieldId){if(jsDate==null){jQuery("#"+labelFieldId).html("");
return false;}jQuery("#"+labelFieldId).html(jsDate.getDayName());return true;};YAHOO.search.cal.selectDateAndPage=function(yuiCal,jsDate){yuiCal.cfg.setProperty("PAGEDATE",jsDate.format(YAHOO.search.cal.CAL_CONFIG.YUI_PAGE_DATE_FORMAT_STRING));yuiCal.cfg.setProperty("SELECTED",jsDate.format(YAHOO.search.cal.CAL_CONFIG.YUI_DATE_FORMAT_STRING));yuiCal.render();};YAHOO.search.cal.clearArrivalErrors=function(){jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_DAY_NAME_LABEL).show();jQuery("#"+YAHOO.search.cal.ERROR_CONFIG.ERROR_LIST_ID).children("ul").children("li."+YAHOO.search.cal.ERROR_CONFIG.CHECKIN_ERROR_CLASS).hide();
jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKIN_FIELDSET).removeClass("inline error");YAHOO.search.cal.checkAndHandleNoErrors();};YAHOO.search.cal.clearDepartureErrors=function(){jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_DAY_NAME_LABEL).show();jQuery("#"+YAHOO.search.cal.ERROR_CONFIG.ERROR_LIST_ID).children("ul").children("li."+YAHOO.search.cal.ERROR_CONFIG.CHECKOUT_ERROR_CLASS).hide();jQuery("#"+YAHOO.search.cal.CAL_CONFIG.CHECKOUT_FIELDSET).removeClass("inline error");YAHOO.search.cal.checkAndHandleNoErrors();
};YAHOO.search.cal.checkAndHandleNoErrors=function(){var datesFs=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.DATES_FIELDSET);var errorList=jQuery("#"+YAHOO.search.cal.ERROR_CONFIG.ERROR_LIST_ID);var numNightsP=jQuery("#"+YAHOO.search.cal.CAL_CONFIG.NUMBER_OF_NIGHTS_P);if(datesFs.find(".inline.error").length<=0){errorList.hide();numNightsP.show();}};YAHOO.search.cal.calErrorHandler=function(errorName,calId,param){};YAHOO.search.cal.adjustDepartureCalRange=function(checkbox){if(YAHOO.search.cal.getCheckinDate()==null){return ;
}var departureDate=YAHOO.search.cal.getCheckoutDate();var maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.DEPARTURE_FROM_ARRIVAL_RANGE);if(jQuery(checkbox).attr("checked")){maxDepartureDate=YAHOO.search.cal.getCheckinDate().add("d",YAHOO.search.cal.CAL_CONFIG.REWARDS_DEPARTURE_FROM_ARRIVAL_RANGE);}if(departureDate.isAfter(maxDepartureDate)){departureDate=YAHOO.search.cal.getCheckinDate().add("d",1);YAHOO.search.cal.checkoutCal.cfg.setProperty("SELECTED",departureDate.format(YAHOO.search.cal.CAL_CONFIG.YUI_DATE_FORMAT_STRING));
}YAHOO.search.cal.updateNumberOfNightsText(YAHOO.search.cal.getCheckinDate(),departureDate);YAHOO.search.cal.checkoutCal.cfg.setProperty("MAXDATE",maxDepartureDate);YAHOO.search.cal.checkoutCal.render();};jQuery(document).ready(function(){jQuery(document).click(function(){if(!YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_OPEN&&YAHOO.search.cal.checkinCal!=null){YAHOO.search.cal.checkinCal.hide();}if(!YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN&&YAHOO.search.cal.checkoutCal!=null){YAHOO.search.cal.checkoutCal.hide();
}YAHOO.search.cal.CAL_CONFIG.CHECKIN_CAL_OPEN=false;YAHOO.search.cal.CAL_CONFIG.CHECKOUT_CAL_OPEN=false;});});function createDate(year,month,day){var dateObj=new Date();dateObj.setFullYear(year);dateObj.setMonth(month-1);dateObj.setDate(day);var selectedDate=dateObj.format(G_DATE_FORMAT_SHORT);return selectedDate;}
/*############ End common/js/plug/yuiCal_search.js ############*/
/*############ Begin common/js/plug/sayt.js ############*/
(function($){$.fn.sayt=function(opts){var opts=$.extend({},$.fn.sayt.defaults,opts);
return this.each(function(){var $this=$(this);$this.attr("autocomplete","off");$this.autocomplete({getList:function(input){var q=$this.val().toLowerCase();q=jQuery.trim(q);if(q.length<opts.min||q.length>opts.max){$("body").trigger("off.autocomplete");return ;}var p=$.extend({q:q},opts.params);if(p.clazz){p["class"]=opts.params.clazz;delete p.clazz;}jQuery.getJSON(opts.url,p,function(data){input.trigger("updateList",[data]);});},match:function(typed){return true;},insertText:function(suggestionsResponse){return suggestionsResponse.Display;
},template:function(suggestionsResponse){return"<li class='"+suggestionsResponse.Class+"'>"+suggestionsResponse.Display+"</li>";}});});};$.fn.sayt.defaults={url:G_CONTEXT_PATH+"/sayt/",min:2,max:12,params:{}};})(jQuery);jQuery(document).ready(function($){$("#locsearch").sayt({url:G_SAYT,params:{locale:G_LOCALE}});$("#hotelSearchOneBox").sayt({url:G_SAYT,params:{locale:G_LOCALE}});$("#hotelSearchOneBoxCity").sayt({url:G_SAYT,params:{clazz:"c",locale:G_LOCALE}});$("#hotelSearchOneBoxAirport").sayt({url:G_SAYT,params:{clazz:"a",locale:G_LOCALE}});
});
/*############ End common/js/plug/sayt.js ############*/
/*############ Begin hiway/en_GB/js/plug/onsite.js ############*/
var onImagesPath=onSurveyImage;var onSecureImagePath=onSurveyImage;var onErrorPath=error404page;var onCookieDomain=G_DOMAIN;var onCookieName="OnSiteHilton";var onBulletPath="http://onsite.hilton-research.com/images/hilton_uks.gif";var onCookiePath="/";var onCookieDuration=null;var onPopFreq=tempSurveyFreq;var onPopDelay=2000;var onPagePop=true;var onRun=false;var onFlashParam='<param name="play" value="true" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="allowScriptAccess" value="always" />';
function onClientWidth(){return typeof (window.innerWidth)=="number"?window.innerWidth:dD.documentElement&&dD.documentElement.clientWidth?dD.documentElement.clientWidth:dD.body&&dD.body.clientWidth?dD.body.clientWidth:0;}function onClientHeight(){return typeof (window.innerWidth)=="number"?window.innerHeight:dD.documentElement&&dD.documentElement.clientHeight?dD.documentElement.clientHeight:dD.body&&dD.body.clientHeight?dD.body.clientHeight:0;}function onScrollX(){return typeof (window.pageXOffset)=="number"?window.pageXOffset:dD.body&&dD.body.scrollLeft?dD.body.scrollLeft:dD.documentElement&&dD.documentElement.scrollLeft?dD.documentElement.scrollLeft:0;
}function onScrollY(){return typeof (window.pageYOffset)=="number"?window.pageYOffset:dD.body&&dD.body.scrollTop?dD.body.scrollTop:dD.documentElement&&dD.documentElement.scrollTop?dD.documentElement.scrollTop:0;}function ONS_getObj(n){return dD.getElementById?dD.getElementById(n):dD.all?dD.all[n]:dD.layers[n];}function ONS_chkIndex(v1){var onsi=v1.split("/");if((onsi[3]=="")||(typeof (onsi[4])=="undefined"&&onsi[3].indexOf("index")!=-1)){return true;}return false;}function ONS_getRandom(){return Math.random();
}function ONS_getSiteID(v1){var siteID=ONS_getCookie("SiteID");if(siteID==null){var t=new Date();siteID=Math.floor(Math.random()*10000000000000)+""+t.getTime();ONS_setCookie("SiteID",siteID,onCookieDuration,24);}return siteID;}function ONS_getURL(v1,v2){if((v1==null)||(v1=="")){return"NONE";}v1=v1.toString().toLowerCase();return v1.substring(0,(pos=v1.indexOf(v2))>0?pos:v1.length);}function ONS_getParameter(pl,pStr){if((pl==null)||(pl=="")){return false;}pl=pl.toString().toLowerCase();pStr=pStr+"=";
var bpos=pl.indexOf(pStr);if(bpos!=-1){bpos+=pStr.length;var epos=pl.indexOf("&",bpos);if(epos==-1){epos=pl.length;}return unescape(pl.substring(bpos,epos));}return"";}function ONS_getCookie(n){var name=n+"=",ca=dD.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(name)==0){return c.substring(name.length,c.length);}}return null;}function ONS_setCookie(n,v,d,h){var t=new Date(),g=v.toString().toLowerCase();t.setTime(t.getTime()+(d*h*60*60*1000));
var exp=d?";expires="+t.toGMTString():"";if(v!=""){v=v.toString().replace(/[!<}#;]/g,"");}if(d==null){dD.cookie=n+"="+v+(onCookieDomain?"; domain="+onCookieDomain:"")+";path="+onCookiePath;}else{dD.cookie=n+"="+v+exp+(onCookieDomain?";domain="+onCookieDomain:"")+";path="+onCookiePath;}}function ONS_SiteTrack(){onSiteCount=ONS_getCookie("OnSiteNum");if((onSiteCount=="")||(onSiteCount==null)){onSiteCount="0";}ONS_SiteSave();}function ONS_PopSurvey(v1){onSStage=ONS_getCookie(onCookieName+"S");if(onSStage<8&&onSStage!=null){if(onTracking){onChildWin=window.open(v1+"?onsid="+onSiteID+"&lang="+onKey,"On2Survey",onWSetting);
ONS_SiteSave("End");}else{onChildWin=window.open(v1+"?3q=1&onsid="+onSiteID+"&lang="+onKey+"&loc="+escape(onLocation),"On2Survey",onSSetting);ONS_setCookie(onCookieName+"S",9,null,2);}}ONS_setCookie(onCookieName,0,onCookieDuration,24);if(onTracking){ONS_setCookie(onCookieName+"SV",3,90,24);}ONS_setCookie(onCookieName+"S","",-1,24);ONS_setCookie(onCookieName+"C","",-1,24);ONS_IconHide("OnSiteFloatIcon");return false;}function ONS_SubmitInfo(v1,v2,v3,v4){var strparam="onsid="+v1;var onPValue=new Image();
strparam=strparam+"&onifo="+escape(v3);strparam=strparam+"&onend="+v4;strparam=strparam+"&rf="+escape(ONS_getCookie(onCookieName+"C"));strparam=strparam+"&ul="+navigator.userLanguage;strparam=strparam+"&sl="+navigator.systemLanguage;strparam=strparam+"&lang="+onKey;strparam=strparam+"&stype="+onSurveyType;if(onLocation.indexOf("https")==-1){onPValue.src=onServerPath+"?"+strparam;}else{onPValue.src=onServerSPath+"?"+strparam;}}function ONS_SiteSave(n){onTStage=ONS_getCookie(onCookieName+"S");var t=new Date();
var onSTime=Date.UTC(t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());var onSData=(onSData=ONS_getCookie("ONSData"))?onSData:"";var onSInfo=(onSInfo=ONS_getCookie("ONSInfo"))?onSInfo:"";var onSINum=(onSINum=ONS_getCookie("ONSINum"))?onSINum:0;var r1=onSInfo.substring(onSInfo.lastIndexOf("^")+1,onSInfo.length);if(onTStage<8&&onTStage!=null){if(n=="End"){ONS_setCookie("ONSInfo","",-1,24);ONS_setCookie("ONSData","",-1,24);ONS_setCookie("ONSINum","",-1,24);ONS_setCookie(onCookieName+"S",9,null,2);
onSData=onSData+"999"+onSInfo.substring(onSInfo.indexOf("^"),onSInfo.lastIndexOf("^")+1)+((onSTime-r1)/1000)+"^";ONS_SubmitInfo(onSiteID,onLocation,onSData,"true");}else{onSINum=parseInt(onSINum)+1;if(r1!=""){onSData=onSData+onSInfo.substring(0,onSInfo.lastIndexOf("^")+1)+((onSTime-r1)/1000)+"^";}onSInfo=onSINum+"^"+onLocation+"^"+onSTime;ONS_setCookie("ONSInfo",onSInfo,null,null);ONS_setCookie("ONSData",onSData,null,null);ONS_setCookie("ONSINum",onSINum,null,null);if(onSData.length>=500){ONS_SubmitInfo(onSiteID,onLocation,onSData,"false");
ONS_setCookie("ONSData",onSData="",null,null);}}}}function ONS_Tags(){var onTagSyntax=[["","","Provide<BR>Feedback"],["",""],["",""],["",""],["","","&#12450;&#12531;&#12465;&#12540;&#12488;&#12395;&#31572;&#12360;&#12427;"],["","","Umfrage starten"]];var onMsgText="";var onMsgButt="";var onMsgFoot="";var newObj;var onFlashObj='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" pluginspage="http://www.macromedia.com/shockwave/download/" width="290" height="165" id="popup" align="middle"><param name="movie" value="'+onImagesPath+"popup"+onKey+'.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'+onFlashParam+'<embed src="'+onImagesPath+"popup"+onKey+'.swf" FlashVars="onKey='+onKey+"&onImagesPath="+onImagesPath+'" quality="high" wmode="transparent" width="290" height="165" name="popup" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" /></object>';
var onIconObj='<A href="'+onSurveyPath+'" target="OnSiteSurvey" onClick="return ONS_PopSurvey(this.href);" style="color:#0860a8;text-decoration:none" onmouseout="this.style.textDecoration=\'none\'" onmouseover="this.style.textDecoration=\'underline\'"><IMG src="'+onImagesPath+'icon.gif" border="0" style="opacity:0.6;filter:alpha(opacity=70)" alt="Click here to provide feedback!"><BR>'+onTagSyntax[onKey][2]+"</A>";if(!blnSecureSite){newObj=dD.createElement("DIV");newObj.setAttribute("id","OnSiteFloatWin");
dD.body.appendChild(newObj);onObj=ONS_getObj("OnSiteFloatWin");onObj.style.display="none";onObj.style.width=onFloatWidth+px;onObj.style.backgroundColor="transparent";onObj.style.position="absolute";onObj.style.zIndex="10001";dD.getElementById("OnSiteFloatWin").innerHTML=onFlashObj;}newObj=dD.createElement("DIV");newObj.setAttribute("id","OnSiteFloatIcon");dD.body.appendChild(newObj);onObj=ONS_getObj("OnSiteFloatIcon");onObj.style.display="none";onObj.style.width="60"+px;onObj.style.backgroundColor="transparent";
onObj.style.position="absolute";onObj.style.zIndex="10001";onObj.style.fontSize="8pt";onObj.style.fontFamily="verdana";onObj.style.textAlign="center";dD.getElementById("OnSiteFloatIcon").innerHTML=onIconObj;return true;}function ONS_FloatHide(v1){onTracking=false;ONS_InitTrack();if(eval(onObj)&&onObj.id=="OnSiteFloatWin"){onObj.style.display="none";}return ;}function ONS_FloatHide2(){if(eval(onObj)&&onObj.id=="OnSiteFloatWin"){onObj.style.display="none";}return ;}function ONS_InitTrack(){ONS_FloatHide2();
if(!ONS_getCookie(onCookieName+"S")){if(onTracking){ONS_setCookie(onCookieName,1,onCookieDuration,24);}else{ONS_setCookie(onCookieName,2,onCookieDuration,24);}ONS_setCookie(onCookieName+"S",1,null,2);ONS_IconInit("OnSiteFloatIcon");}return ;}function ONS_FloatInit(id){onObj=ONS_getObj(id);onObj.style.left=250+px;onObj.style.top=20+px;onObj.style.display="block";return ;}function ONS_IconFloat(iX,iY,id){var L=ONS_getObj(id);L.style.display="block";this[id+"O"]=L;if(dD.layers){L.style=L;}L.nX=iX;L.nY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fm=function(){this.nX=onScrollX()+(onClientWidth()-100);this.nY=onScrollY()+(onClientHeight()-70);this.P(this.nX,this.nY);onTimerID=setTimeout(this.id+"O.Fm()",50);};return L;}function ONS_IconHide(){if(eval(onObj)){clearTimeout(onTimerID);onObj.style.display="none";}}function ONS_IconInit(id){if(onLocation.indexOf("https")==-1&&onTracking){ONS_SiteTrack();}onObj=ONS_getObj(id);onObj.style.display="block";ONS_IconFloat(-80,-80,id).Fm();
return ;}function ON_ChkStatus(id){if(onblnStatus&&id=="pop"){setTimeout("ONS_FloatInit('OnSiteFloatWin')",onPopDelay);}else{onChkStatus=onChkStatus+1;if(onblnStatus==false&&onBulletStatus.complete){onblnStatus=true;}if(onChkStatus<5){setTimeout("ON_ChkStatus('"+id+"')",1000);}else{if(onChildWin){onChildWin.location=onErrorPath;}}}}function ONS_InitPop(){onAccess=[];onDisable=[];return true;}function ONS_SpecPop(qL,qA,qD,qP){for(var c=0;c<qD.length;c++){if(qL.indexOf(qD[c])!=-1){return false;}}if(qL.indexOf("https")!=-1){onImagesPath=onSecureImagePath;
blnSecureSite=true;}if(qP==null){if(qL.indexOf("https")!=-1){return false;}for(var c=0;c<qA.length;c++){if(qL.indexOf(qA[c][0])!=-1){if((qA[c][1]>onPopFreq&&onPopFreq!=0)||qA[c][1]==0){onPopFreq=qA[c][1];}}}}return true;}function ONS_Survey(){if(ONS_InitPop()){if(ONS_SpecPop(onLocation,onAccess,onDisable,onSStage)){onTagbln=ONS_Tags();if(onSStage==null){if((ONS_getRandom()<=onPopFreq)&&onSurvey==null){onBullet.src=onBulletPath;onBulletStatus.src=onStatusPath+"?rnd="+(ONS_getRandom*100);ON_ChkStatus("pop");
}else{onTracking=false;if(!onIndexPgr){ONS_InitTrack();}}}else{if(onSStage<8){ONS_IconInit("OnSiteFloatIcon");}}}}}function ONS_OnSite(){if((onSIntel!=null&&onSStage!=null)||(onSIntel==null&&onSStage==null)){onEXE=true;}if(onRun&&onEXE&&dD.cookie){if(dD.cookie){if(((onSIntel==1||onSIntel==2)&&(onSStage<8&&onSStage!=null))||onSIntel==null){ONS_Survey();}}}else{onObj=ONS_getObj("OnSiteFloatIcon");if(onObj){onObj.style.display="none";}}}var onFloatWidth=290;var onServerPath="http://onsite.hilton-research.com/engine/saventinfo.asp";
var onServerSPath="https://onsite.hilton-research.com/engine/saventinfo.asp";var onSurveyPath="http://onsite.hilton-research.com/engine/savenfinal.asp";var onStatusPath="http://onsite.hilton-research.com/images/hilton.gif";var onSiteCount=0;var onTagbln=false;var onblnStatus=false;var onChkStatus=0;var onEXE=false;var onMX,onMDf,onMD,onMY,onMLf,onML;var onFloatOn;var onChildWin;var onObj=null;var onImage=new Image();var onBullet=new Image();var onBulletStatus=new Image();var dD=document;var nN=navigator;
var wN=window;var px=dD.layers?"":"px";var onKey="0";var onTracking=true;var onAccess,onDisable,blnSecureSite=false;var onWSetting="width="+(screen.availWidth-150)+",height="+(screen.availHeight-100)+",left=0,top=0,resizable=1,scrollbars=1";var onSSetting="width=550,height=400,left="+(onClientWidth()-560)+",top="+((onClientHeight()-300))+",resizable=1,scrollbars=0";var onisNN=(nN.appName.indexOf("Netscape")!=-1);var onisIE=(nN.appName.indexOf("Microsoft")!=-1);var onisOP=(nN.userAgent.toLowerCase().indexOf("opera")>-1)?true:false;
var onisNS=(nN.userAgent.toLowerCase().indexOf("mozilla")!=-1)&&(parseInt(nN.appVersion)>=5);var onisMAC=(nN.appVersion.indexOf("Macintosh")>-1);var onSurveyType="0";var onLocation=ONS_getURL(dD.location,"");var onReferrer=ONS_getURL(dD.referrer,"?");var onIndexPgr=ONS_chkIndex(onLocation);var onSIntel=ONS_getCookie(onCookieName);var onSurvey=ONS_getCookie(onCookieName+"SV");var onSStage=ONS_getCookie(onCookieName+"S");var onCookie=ONS_getCookie(onCookieName+"C");var onSiteID=ONS_getSiteID();var pre_onload=window.onload;
if(onSIntel==2){onTracking=false;}if(onCookie==null){ONS_setCookie(onCookieName+"C",onReferrer,null,24);}if(wN.attachEvent){wN.attachEvent("onload",ONS_OnSite);}else{if(dD.addEventListener){dD.addEventListener("DOMContentLoaded",ONS_OnSite,false);
/*############ End hiway/en_GB/js/plug/onsite.js ############*/
}}