function addDCSMultiTrackToDomReadyToTAHQ(){var addDCSMultiTrackTAHQTAHQ=function(){var headertab=$ES(".mootabs_title li a");headertab.each(function(eachtag){var idtag=eachtag.getProperty("id");eachtag.addEvent("click",function(){dcsMultiTrack("WT.cg_n","TAHQ","WT.cg_s","LandingPage","WT.si_n","tahq_tab","WT.si_p",idtag,"WT.dl","1");if(idtag=="downloadimages"){window.open("http://fm2.agtseattle.com/FMPro?-db=HHOrders.fp5&-lay=CGI&-format=HH/HTML-Access/Consent.htm&CustomerID=&LastName=&FirstName=&Organization=&Address=&City=&StateProvince=&PostalCode=&Country=&Email=&Phone=&Fax=&ShippingLastName=&ShippingFirstName=&ShippingOrganization=&ShippingAddress=&ShippingCity=&ShippingStateProvince=&ShippingPostalCode=&ShippingCountry=&-New","_blank","scrollbars=yes")}})})};window.addEvent((window.ie)?"domready":"load",addDCSMultiTrackTAHQTAHQ)}function addDCSMultiTrackToDomReadyToResources(){var addDCSMultiTrackToResources=function(){var headertab=$ES(".mootabs_title li a");headertab.each(function(eachtag){var idtag=eachtag.getProperty("id");eachtag.addEvent("click",function(){dcsMultiTrack("WT.cg_n","tahq","WT.cg_s","tahq_landing","WT.si_n",idtag,"WT.si_p",idtag,"WT.dl","1")})})};window.addEvent((window.ie)?"domready":"load",addDCSMultiTrackToResources)}var addDCSMultiTrack=function(){var headertab=$ES(".mootabs_title_vert li");headertab.each(function(eachtag){eachtag.addEvent("click",function(){dcsMultiTrack("WT.ti","Tab: "+eachtag.title,"WT.dl","1")})})};function addDCSMultiTrackToDomReady(){window.addEvent("domready",function(){window.addEvent((window.ie)?"domready":"load",addDCSMultiTrack)})}function addDCSMultiTrackToDomReadyToPorts(){var addShoreExcursionsDCSMultiTrack=function(){var headertab=$ES(".mootabs_title_vert li");headertab.each(function(eachtag){eachtag.addEvent("click",function(){if(eachtag.title=="Shore Excursions"){jQuery("#infoIcons").show()}else{jQuery("#infoIcons").hide()}dcsMultiTrack("WT.ti","Tab: "+eachtag.title,"WT.dl","1")})})};window.addEvent((window.ie)?"domready":"load",addShoreExcursionsDCSMultiTrack)}function setDays(formName){var yearDropdown=document.forms[formName].birthYear!=undefined?document.forms[formName].birthYear:document.forms[formName].year;var monthDropdown=document.forms[formName].birthMonth!=undefined?document.forms[formName].birthMonth:document.forms[formName].month;var dayDropdown=document.forms[formName].birthDay!=undefined?document.forms[formName].birthDay:document.forms[formName].day;var theYear=yearDropdown.value;var theMonth=monthDropdown.value;var theDay=dayDropdown.value;if(theYear!=""&&theMonth!=""){if(theYear.length!=4){alert("Please enter a valid 4 digit year")}else{var noOfDays=GetMonDays(theYear,theMonth);var optionItem;for(var count=dayDropdown.options.length-1;count>-1;count--){dayDropdown.options[count]=null}optionItem=new Option("Day","",false,false);dayDropdown.options[0]=optionItem;optionItem=new Option("","",false,false);dayDropdown.options[1]=optionItem;for(var count=1;count<=noOfDays;count++){if(theDay==count){optionItem=new Option(count,count,true,true)}else{optionItem=new Option(count,count,false,false)}dayDropdown.options[dayDropdown.length]=optionItem}}}}function GetMonDays(year,month){var DaysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];if(IsLeapYear(year)){DaysInMonth[1]=29}return DaysInMonth[month-1]}function IsLeapYear(year){if((year%4)==0){return !((year%100==0)&&(year%400)!=0)}else{return false}}function printthisframe(){parent.parent.frames.GBreg_frame.focus();parent.parent.frames.GBreg_frame.print()}function hideReal(){document.getElementById("fakeSubmit").style.display="block";document.getElementById("realsubmit").style.display="none"}function updatestate(cc){if(cc=="US"){$("one").setStyle("display","block");$("two").setStyle("display","none");$("three").setStyle("display","none");$("four").setStyle("display","none")}else{if(cc=="CA"){$("one").setStyle("display","none");$("two").setStyle("display","block");$("three").setStyle("display","none");$("four").setStyle("display","none")}else{if(cc=="MX"){$("one").setStyle("display","none");$("two").setStyle("display","none");$("three").setStyle("display","block");$("four").setStyle("display","none")}else{$("one").setStyle("display","none");$("two").setStyle("display","none");$("three").setStyle("display","none");$("four").setStyle("display","block")}}}}function adjustSecondaryDests(destPrime,formCodes){var max=formCodes.length;for(var idx=0;idx<max;idx++){var dCode=formCodes[idx].value;if(dCode==destPrime){formCodes[idx].checked=false}}}function checkIfPrimary(destPrime,secondDest){if(destPrime==secondDest.value){secondDest.checked=false;alert("This is already selected as your primary destination.")}}function changeDestOrUrl(elementId){var redirect;redirect=document.getElementById(elementId).value;if(redirect!=""&&redirect!=-1){document.location.href=redirect}}function openDeckPlans(shipCode){openDeckPlansCruiseDetails(shipCode)}function changeship(){var shipcode=$("shipCode").getValue();var fvshipcode="ship="+shipcode;var flashplayer={movie:"../swf/loader.swf",width:"740",height:"1300",majorversion:"8",build:"0",xi:"true",wmode:"transparent",flashvars:fvshipcode};UFO.create(flashplayer,"flash");$$("#deckPlanEmail").setProperty("href","../main/ShipDeckPlansEmail.action?emailType=SHIPDECKPLANS&shipCode="+shipcode)}function loadPlanningAndAdviceContent(newElement,tabName,contentMenu,contentSubMenu){jQuery.noConflict();jQuery("body").css("cursor","wait");jQuery("li").css("cursor","wait");tabName=encodeURIComponent(tabName);contentMenu=encodeURIComponent(contentMenu);contentSubMenu=encodeURIComponent(contentSubMenu);jQuery.ajax({url:"/cruise-vacation-planning/PlanningAndAdviceContent.action?tabName="+tabName+"&contentMenu="+contentMenu+"&contentSubMenu="+contentSubMenu,success:function(message){jQuery("body").css("cursor","default");jQuery("li").css("cursor","pointer");if(message.length>0){if(message.indexOf("bygTabCopy")==-1){jQuery("#planningAndAdviceContent").html(message)}else{jQuery("#planningAndAdviceContent").html((jQuery.trim(message)).substring(10))}}var isNotTabCopy=message.length>0&&message.indexOf("bygTabCopy")==-1;setBYGNavigation(newElement,tabName,contentMenu,contentSubMenu,isNotTabCopy)}})}function setBYGNavigation(newElement,tabName,contentMenu,contentSubMenu,isNotTabCopy){var tabMenuSubMenu;if(currentElement!=null){tabMenuSubMenu=currentElement.split("-");if(tabMenuSubMenu.length>=3){jQuery("#"+tabMenuSubMenu[0]).removeClass("on");jQuery("#"+tabMenuSubMenu[0]+"-"+tabMenuSubMenu[1]).removeClass("active");jQuery("#"+currentElement).removeClass("active");jQuery("#"+tabMenuSubMenu[0]+"-ul").hide();jQuery("#"+tabMenuSubMenu[0]+"-"+tabMenuSubMenu[1]+"-ul").hide()}else{if(tabMenuSubMenu.length>=2){jQuery("#"+tabMenuSubMenu[0]).removeClass("on");jQuery("#"+currentElement).removeClass("active");if(jQuery("#"+currentElement+"-0")!=null){jQuery("#"+currentElement+"-0").removeClass("active")}if(jQuery("#"+tabMenuSubMenu[0]+"-ul")!=null){jQuery("#"+tabMenuSubMenu[0]+"-ul").hide()}if(jQuery("#"+currentElement+"-ul")!=null){jQuery("#"+currentElement+"-ul").hide()}}else{jQuery("#"+currentElement).removeClass("on");if(jQuery("#"+currentElement+"-0")!=null){jQuery("#"+currentElement+"-0").removeClass("active")}if(jQuery("#"+currentElement+"-0-0")!=null){jQuery("#"+currentElement+"-0-0").removeClass("active")}if(jQuery("#"+currentElement+"-ul")!=null){jQuery("#"+currentElement+"-ul").hide()}if(jQuery("#"+currentElement+"-0-ul")!=null){jQuery("#"+currentElement+"-0-ul").hide()}}}}tabMenuSubMenu=newElement.id.split("-");if(tabMenuSubMenu.length>=3){jQuery("#"+newElement.id).addClass("active");jQuery("#"+tabMenuSubMenu[0]+"-"+tabMenuSubMenu[1]).addClass("active");jQuery("#"+tabMenuSubMenu[0]).addClass("on");jQuery("#"+tabMenuSubMenu[0]+"-ul").show();jQuery("#"+tabMenuSubMenu[0]+"-"+tabMenuSubMenu[1]+"-ul").show()}else{if(tabMenuSubMenu.length>=2){if(jQuery("#"+newElement.id+"-0")!=null){jQuery("#"+newElement.id+"-0").addClass("active")}jQuery("#"+newElement.id).addClass("active");jQuery("#"+tabMenuSubMenu[0]).addClass("on");if(jQuery("#"+tabMenuSubMenu[0]+"-ul")!=null){jQuery("#"+tabMenuSubMenu[0]+"-ul").show()}if(jQuery("#"+newElement.id+"-ul")!=null){jQuery("#"+newElement.id+"-ul").show()}}else{if(jQuery("#"+newElement.id+"-0-0")!=null&&isNotTabCopy){jQuery("#"+newElement.id+"-0-0").addClass("active")}if(jQuery("#"+newElement.id+"-0")!=null&&isNotTabCopy){jQuery("#"+newElement.id+"-0").addClass("active")}jQuery("#"+newElement.id).addClass("on");if(jQuery("#"+newElement.id+"-ul")!=null){jQuery("#"+newElement.id+"-ul").show()}if(jQuery("#"+newElement.id+"-0-ul")!=null&&isNotTabCopy){jQuery("#"+newElement.id+"-0-ul").show()}}}currentElement=newElement.id}function compareSubmit(documentForm){var max=documentForm.compareSelection.length;if(documentForm.compareCruisesVoyageValuesStr.value!=""){documentForm.compareCruisesVoyageValuesStr.value=""}for(var idx=0;idx<max;idx++){documentForm.compareCruisesVoyageValuesStr.value+=(documentForm.compareSelection[idx].value+"*")}documentForm.submit()}function compareSubmitTour(documentForm){var max=documentForm.compareSelection.length;if(documentForm.compareCruiseToursTourIdVoyageCodeValuesStr.value!=""){documentForm.compareCruiseToursTourIdVoyageCodeValuesStr.value=""}for(var idx=0;idx<max;idx++){documentForm.compareCruiseToursTourIdVoyageCodeValuesStr.value+=(documentForm.compareCruisesTourId[idx].value+","+documentForm.compareSelection[idx].value+"*")}documentForm.submit()}function setSelectedDatesInDropdown(documentForm){var dateString=(documentForm.compareCruisesVoyageValuesStr!=null)?documentForm.compareCruisesVoyageValuesStr.value:documentForm.compareCruiseToursTourIdVoyageCodeValuesStr.value;var selectedDates=dateString.split("*");var max=documentForm.compareSelection.length;for(var idx=0;idx<max;idx++){documentForm.compareSelection[idx].value=selectedDates[idx]}}function setCTourSelectedDatesInDropdown(documentForm){var dateString=(documentForm.compareCruiseToursTourIdVoyageCodeValuesStr!=null)?documentForm.compareCruiseToursTourIdVoyageCodeValuesStr.value:documentForm.compareCruisesVoyageValuesStr.value;var selectedDates=dateString.split("*");var max=documentForm.compareSelection.length;var min=0;for(var idx=0;idx<max;idx++){var temp=selectedDates[idx];if(temp!="BLANK"){if(temp.indexOf("%2C")>0){var tourvoy=temp.split("%2C")}else{var tourvoy=temp.split(",")}documentForm.compareSelection[idx].value=tourvoy[1]}}}function loadNoMapImage(imageObject,type){if(imageObject!=null){imageObject.onerror=""}if(imageObject!=null&&type!=null){imageObject.src="../images/itineraryMaps/"+type+"/no_map.jpg"}}function loadDefaultPortImage(imageObject){if(imageObject!=null){imageObject.onerror="";imageObject.src="/images/miscellaneous/img_port_default.jpg"}}function loadDefaultBanner(imageObject,type){if(imageObject!=null){imageObject.onerror=""}if(imageObject!=null&&type!=null){imageObject.src="/images/findcruises/banner_"+type+"_default.jpg"}}function showFullDescription(shxNo){jQuery("#fullDesc"+shxNo).show();jQuery("#shortDesc"+shxNo).hide()}function hideFullDescription(shxNo){jQuery("#fullDesc"+shxNo).hide();jQuery("#shortDesc"+shxNo).show()}function extractDateSelected(bookForm,detailForm){bookForm.voyageCode.value=detailForm.voyageCode.value;bookForm.submit()}function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"")}function compareSubmitCruiseTours(){var errorMsgCompareCount=$("errorCompareCount");var total=0;var max=document.compareCruiseTours.compareSelection.length;if(document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value!=""){document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value=""}for(var idx=0;idx<max;idx++){if(eval("document.compareCruiseTours.compareSelection["+idx+"].checked")==true){total+=1;document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value+=(document.compareCruiseTours.compareSelectionValue[idx].value+"*")}}if(total<2){errorMsgCompareCount.setHTML("Please select more than one CruiseTour to compare");window.scrollTo(0,0)}else{document.compareCruiseTours.submit()}}function compareSubmitCruise(){var errorMsgCompareCount=$("errorCompareCount");var total=0;var max=document.compareCruises.compareSelection.length;if(document.compareCruises.compareCruisesVoyageValuesStr.value!=""){document.compareCruises.compareCruisesVoyageValuesStr.value=""}for(var idx=0;idx<max;idx++){if(eval("document.compareCruises.compareSelection["+idx+"].checked")==true){total+=1;document.compareCruises.compareCruisesVoyageValuesStr.value+=(document.compareCruises.compareSelectionValue[idx].value+"*")}}if(total<2){errorMsgCompareCount.setHTML("Please select more than one Cruise to compare");window.scrollTo(0,0)}else{document.compareCruises.submit()}}function saveCookiesAndSubmit(){var regionCode=document.CountrySelectorForm.regionCode.value;var countryCode=document.CountrySelectorForm.countryCode.value;if(regionCode==""&&countryCode==""){alert("Please select a region and then select a country and click GO")}else{if(countryCode==""){alert("Please select a country and click GO")}else{document.CountrySelectorForm.action="CountrySelectorSaveUserCountry.action";document.CountrySelectorForm.submit()}}}function checkBookValue(){$$("#firstNameError").empty();$$("#lastNameError").empty();$$("#bookError").empty();var firstName=document.getElementById("firstName").value;var lastName=document.getElementById("lastName").value;var bookNumber=document.getElementById("bookNumber").value;firstName=firstName.replace(/\s+/g,"");lastName=lastName.replace(/\s+/g,"");bookNumber=bookNumber.replace(/\s+/g,"");if(firstName==""){$$("#firstNameError").setHTML("First Name can not be empty");$$(".mainerror").empty()}if(lastName==""){$$("#lastNameError").setHTML("Last Name can not be empty");$$(".mainerror").empty()}if(bookNumber==""){$$("#bookError").setHTML("Booking Number can not be empty");$$(".mainerror").empty()}if(firstName!=""&&lastName!=""&&bookNumber!=""){document.BookingsLookUpResults.submit()}}function login(){var username=$("username").getProperty("value");var password=$("password").getProperty("value");$("login").submit()}function register(){var username=$("username").getProperty("value");$("register").submit()}function forgot(){var email=$("email").getProperty("value");$("forgotpassword").submit()}function showhidedivforgpass(){if(document.getElementById){if(document.getElementById("forgpass").style.display=="none"){document.getElementById("forgpass").style.display="block"}else{document.getElementById("forgpass").style.display="none"}}else{if(document.layers){if(document.forgpass.display=="none"){document.forgpass.display="block"}else{document.forgpass.display="none"}}else{if(document.all.forgpass.style.display=="none"){document.all.forgpass.style.display="block"}else{document.all.forgpass.style.display="none"}}}}function showhidedivfriend(){if(document.getElementById){if(document.getElementById("friend").style.display=="none"){document.getElementById("friend").style.display="block"}else{document.getElementById("friend").style.display="none"}}else{if(document.layers){if(document.friend.display=="none"){document.friend.display="block"}else{document.friend.display="none"}}else{if(document.all.friend.style.display=="none"){document.all.friend.style.display="block"}else{document.all.friend.style.display="none"}}}}function compareSubmitCruisesMyAccount(){var alertmsgCruise=$("errorCruise");var total=0;var max=document.compareCruises.compareSelection.length;if(document.compareCruises.compareCruisesVoyageValuesStr.value!=""){document.compareCruises.compareCruisesVoyageValuesStr.value=""}for(var idx=0;idx<max;idx++){if(eval("document.compareCruises.compareSelection["+idx+"].checked")==true){total+=1;document.compareCruises.compareCruisesVoyageValuesStr.value+=(document.compareCruises.compareSelectionValue[idx].value+"*")}}if(total<2){alertmsgCruise.setHTML("Please select more than one Cruise to compare")}else{document.compareCruises.submit()}}function compareSubmitCruiseToursMyAccount(){var alertmsgCruiseTour=$("errorCruiseTour");var total=0;var max=document.compareCruiseTours.compareSelection.length;if(document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value!=""){document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value=""}for(var idx=0;idx<max;idx++){if(eval("document.compareCruiseTours.compareSelection["+idx+"].checked")==true){total+=1;document.compareCruiseTours.compareCruiseToursTourIdVoyageCodeValuesStr.value+=(document.compareCruiseTours.compareSelectionValue[idx].value+"*")}}if(total<2){alertmsgCruiseTour.setHTML("Please select more than one CruiseTour to compare")}else{document.compareCruiseTours.submit()}}function hideShowCruiseAndCruiseTourSelector(){window.addEvent("domready",function(){var cf_selector=$ES(".homeCruiseselector");var cf_panel=$("findcruise");var ctf_panel=$("findcruisetour");cf_panel.setStyle("display","block");ctf_panel.setStyle("display","none");$ES("a.cruise").addEvent("click",function(e){cf_panel.setStyle("display","block");ctf_panel.setStyle("display","none");$ES("a.cruise").removeClass("off");$ES("a.cruisetour").addClass("off");e=new Event(e).stop()});$ES("a.cruisetour").addEvent("click",function(e){cf_panel.setStyle("display","none");ctf_panel.setStyle("display","block");$ES("a.cruisetour").removeClass("off");$ES("a.cruise").addClass("off");e=new Event(e).stop()})})}function cruiseFinderSelector(){window.addEvent("domready",function(){var gallery=$("cruisefinderajx");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode"});var selectDurations=new Element("select",{id:"durationsbox",name:"durationCode"});var selectPorts=new Element("select",{id:"portsbox",name:"portCode"});var selectDates=new Element("select",{id:"datesbox",name:"dateCode"});var selectShips=new Element("select",{id:"shipsbox",name:"shipCodeSearch"});selectDestinations.injectInside(gallery);selectDurations.injectAfter(selectDestinations);selectPorts.injectAfter(selectDurations);selectDates.injectAfter(selectPorts);selectShips.injectAfter(selectDates);selectDestinations.setStyles({width:"157px",display:"block",marginBottom:"4px"});selectDurations.setStyles({width:"157px",display:"block",marginBottom:"4px"});selectPorts.setStyles({width:"157px",display:"block",marginBottom:"4px"});selectDates.setStyles({width:"157px",display:"block",marginBottom:"4px"});selectShips.setStyles({width:"157px",display:"block",marginBottom:"4px"});var adddates=function(subnodes,valuee){var dateoption="";dateoption=new Element("option").setHTML("Any departure date");dateoption.setProperty("value","");selectDates.empty();selectDates.adopt(dateoption);subnodes.each(function(subnode){var dateoption=new Element("option").setHTML(subnode.displayDate);dateoption.setProperty("value",subnode.key);if(subnode.key==valuee){dateoption.setProperty("selected","selected")}selectDates.adopt(dateoption)})};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML("Any departure port");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)})};var addships=function(subnodes,valuee){var shipoption="";shipoption=new Element("option").setHTML("Any ship");shipoption.setProperty("value","");selectShips.empty();selectShips.adopt(shipoption);subnodes.each(function(subnode){var shipoption=new Element("option").setHTML(subnode.displayName);shipoption.setProperty("value",subnode.name);if(subnode.name==valuee){shipoption.setProperty("selected","selected")}selectShips.adopt(shipoption)})};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML("Any destination");destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var adddurations=function(subnodes,valuee){var durationoption="";durationoption=new Element("option").setHTML("Any duration");durationoption.setProperty("value","");selectDurations.empty();selectDurations.adopt(durationoption);subnodes.each(function(subnode){var durationoption=new Element("option").setHTML(subnode.displayValue);durationoption.setProperty("value",subnode.cruiseDurationId);if(subnode.cruiseDurationId==valuee){durationoption.setProperty("selected","selected")}selectDurations.adopt(durationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();var durationvalue=selectDurations.getValue();var portvalue=selectPorts.getValue();var datevalue=selectDates.getValue();var shipvalue=selectShips.getValue();var dates="../../../test/json/CruiseFinderDates.action";var requestdates=new Json.Remote(dates,{onComplete:function(jsonObj){adddates(jsonObj.Date,datevalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ports="../../../test/json/CruiseFinderPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ships="../../../test/json/CruiseFinderShips.action";var requestships=new Json.Remote(ships,{onComplete:function(jsonObj){addships(jsonObj.Ship,shipvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var destinations="../../../test/json/CruiseFinderDestinations.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var durations="../../../test/json/CruiseFinderDurations.action";var requestdurations=new Json.Remote(durations,{onComplete:function(jsonObj){adddurations(jsonObj.CruiseDuration,durationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0})};allmethod();var cruisefinderForm=$("cruisefinderform");$$("a.findcruisesubmit").addEvent("click",function(e){e=new Event(e).stop();cruisefinderForm.submit()});selectDestinations.addEvent("change",function(e){var destinationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDurations.addEvent("change",function(e){var durationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectPorts.addEvent("change",function(e){var portvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDates.addEvent("change",function(e){var datevalue=this.getValue();e=new Event(e).stop();allmethod()});selectShips.addEvent("change",function(e){var shipvalue=this.getValue();e=new Event(e).stop();allmethod()})})}function cruiseTourSelectorMainBody(){window.addEvent("domready",function(){var CTajax=$("cruisetourfinderajx");var CTselectDestinations=new Element("select",{id:"CTdestinationsbox",name:"subProductCode"});var CTselectDurations=new Element("select",{id:"CTdurationsbox",name:"durationCode"});var CTselectPorts=new Element("select",{id:"CTportsbox",name:"portCode"});var CTselectDates=new Element("select",{id:"CTdatesbox",name:"dateCode"});CTselectDestinations.injectInside(CTajax);CTselectDurations.injectAfter(CTselectDestinations);CTselectPorts.injectAfter(CTselectDurations);CTselectDates.injectAfter(CTselectPorts);CTselectDestinations.setStyles({width:"157px",display:"block",marginBottom:"7px"});CTselectDurations.setStyles({width:"157px",display:"block",marginBottom:"7px"});CTselectPorts.setStyles({width:"157px",display:"block",marginBottom:"7px"});CTselectDates.setStyles({width:"157px",display:"block"});var adddates=function(subnodes,valuee){var dateoption="";dateoption=new Element("option").setHTML("Any departure date");dateoption.setProperty("value","");CTselectDates.empty();CTselectDates.adopt(dateoption);subnodes.each(function(subnode){var dateoption=new Element("option").setHTML(subnode.displayDate);dateoption.setProperty("value",subnode.key);if(subnode.key==valuee){dateoption.setProperty("selected","selected")}CTselectDates.adopt(dateoption)})};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML("Any cruisetour port");portoption.setProperty("value","");CTselectPorts.empty();CTselectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}CTselectPorts.adopt(portoption)})};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML("Any cruisetour series");destinationoption.setProperty("value","");CTselectDestinations.empty();CTselectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.code);if(subnode.code==valuee){destinationoption.setProperty("selected","selected")}CTselectDestinations.adopt(destinationoption)})};var adddurations=function(subnodes,valuee){var durationoption="";durationoption=new Element("option").setHTML("Any duration");durationoption.setProperty("value","");CTselectDurations.empty();CTselectDurations.adopt(durationoption);subnodes.each(function(subnode){var durationoption=new Element("option").setHTML(subnode.displayValue);durationoption.setProperty("value",subnode.cruiseDurationId);if(subnode.cruiseDurationId==valuee){durationoption.setProperty("selected","selected")}CTselectDurations.adopt(durationoption)})};var allmethodCT=function(){var destinationvalue=CTselectDestinations.getValue();var durationvalue=CTselectDurations.getValue();var portvalue=CTselectPorts.getValue();var datevalue=CTselectDates.getValue();var flexvalue=false;var noofmonthint=1;var dates="../../../test/json/CruiseTourFinderDates.action";var requestdates=new Json.Remote(dates,{onComplete:function(jsonObj){adddates(jsonObj.Date,datevalue)}}).send({subProductCode:destinationvalue,portCode:portvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:flexvalue,noOfFlexibleMonths:noofmonthint});var ports="../../../test/json/CruiseTourFinderPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({subProductCode:destinationvalue,portCode:portvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:flexvalue,noOfFlexibleMonths:noofmonthint});var destinations="../../../test/json/CruiseTourFinderProducts.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Product,destinationvalue)}}).send({subProductCode:destinationvalue,portCode:portvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:flexvalue,noOfFlexibleMonths:noofmonthint});var durations="../../../test/json/CruiseTourFinderDurations.action";var requestdurations=new Json.Remote(durations,{onComplete:function(jsonObj){adddurations(jsonObj.CruiseDuration,durationvalue)}}).send({subProductCode:destinationvalue,portCode:portvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:flexvalue,noOfFlexibleMonths:noofmonthint})};allmethodCT();var cruisetourfinderForm=$("cruisetourfinderform");$$("a.findcruisetoursubmit").addEvent("click",function(e){e=new Event(e).stop();cruisetourfinderForm.submit()});CTselectDestinations.addEvent("change",function(e){var destinationvalue=this.getValue();e=new Event(e).stop();allmethodCT()});CTselectDurations.addEvent("change",function(e){var durationvalue=this.getValue();e=new Event(e).stop();allmethodCT()});CTselectPorts.addEvent("change",function(e){var portvalue=this.getValue();e=new Event(e).stop();allmethodCT()});CTselectDates.addEvent("change",function(e){var datevalue=this.getValue();e=new Event(e).stop();allmethodCT()})})}function setSelectedValuesOnloadForCampaiginGeneral(){var max=document.adCampaignGeneralForm.destCodesSecondary.length;for(var idx=0;idx<max;idx++){var dCode=document.adCampaignGeneralForm.destCodesSecondary[idx].value;for(var dl=0;dl<destsLength;dl++){if(dCode==dests.substr(dl,1)){document.adCampaignGeneralForm.destCodesSecondary[idx].checked=true}}}}function setSelectedValuesOnloadForPreferences(){var max=document.UpdatePreferencesForm.destCodesSecondary.length;if(dests!=null&&dests.length>1){dests=dests.substr(1,dests.length-2);var indDests=dests.split(", ");var destsLength=indDests.length;for(var idx=0;idx<max;idx++){var dCode=document.UpdatePreferencesForm.destCodesSecondary[idx].value;for(var dl=0;dl<destsLength;dl++){if(dCode==indDests[dl]){document.UpdatePreferencesForm.destCodesSecondary[idx].checked=true}}}}}function portsHeaderOnload(destinationvalue,portvalue){var allmethoddom=function(){var departureOnly=$("DeparturePortsOnly").getValue();var requestports;var ports;if(departureOnly){ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"1"})}else{if(!departureOnly){ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}}var destinations="../../../test/json/Destinations.action";var requestdestinations;requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({})};var destinationcontainer=$("destinationcontainer");var portcontainer=$("portcontainer");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode","class":"two40"});var selectPorts=new Element("select",{id:"portbox",name:"portCode","class":"two40"});selectDestinations.injectInside(destinationcontainer);selectPorts.injectInside(portcontainer);var addcounts=function(subnodes){subnodes.each(function(subnode){$("count").empty();$("count").setHTML(subnode.count)})};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML("Please Select...");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)})};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML("Please Select...");destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();var portvalue=selectPorts.getValue();var departureOnly=$("DeparturePortsOnly").getValue();var ports;var requestports;if(departureOnly){ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"1"})}else{if(!departureOnly){ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}}var destinations="../../../test/json/Destinations.action";var requestdestinations;requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({})};allmethoddom();selectPorts.addEvent("change",function(e){e=new Event(e).stop();$("PortDetailsForm").submit()});selectDestinations.addEvent("change",function(e){e=new Event(e).stop();allmethod()});$("DeparturePortsOnly").addEvent("click",function(){var destinationvalue=selectDestinations.getValue();var portvalue=selectPorts.getValue();var ports;var requestports;if(this.getProperty("checked")){this.setProperty("value","true");ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"1"})}else{if(!this.getProperty("checked")){this.setProperty("value","false");ports="../../../test/json/Ports.action";requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}}})}function packagesHeaderOnload(newDestCode,newPortCode,newYear){window.addEvent("domready",function(){var destinationcontainer=$("destinationcontainer");var portcontainer=$("portcontainer");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode","class":"two10"});var selectPorts=new Element("select",{id:"portbox",name:"portCode","class":"two10"});selectDestinations.injectInside(destinationcontainer);selectPorts.injectInside(portcontainer);var yearcontainer=$("yearcontainer");var selectYear=new Element("select",{id:"yearbox",name:"year","class":"one10"});selectYear.injectInside(yearcontainer);var addcounts=function(subnodes){subnodes.each(function(subnode){$("count").empty();$("count").setHTML(subnode.count);if($("destinationsbox").value!=null&&$("destinationsbox").value!=""&&$("portbox").value!=null&&$("portbox").value!=""){if($("count").getText()>0){jQuery("#yearboxdiv").show();jQuery("#noDisplayResults").hide()}else{jQuery("#yearboxdiv").hide();jQuery("#noDisplayResults").show()}}else{jQuery("#yearboxdiv").hide();jQuery("#noDisplayResults").hide()}$("count").empty()})};var addYears=function(subnodes,valuee){var yearoption="";yearoption=new Element("option").setHTML("Please Select...");yearoption.setProperty("value","");selectYear.empty();selectYear.adopt(yearoption);subnodes.each(function(subnode){var yearoption=new Element("option").setHTML(subnode.option);yearoption.setProperty("value",subnode.value);if(subnode.value==valuee){yearoption.setProperty("selected","selected")}selectYear.adopt(yearoption)})};var addBlankYear=function(){var yearoption="";yearoption=new Element("option").setHTML("Please Select...");yearoption.setProperty("value","");selectYear.empty();selectYear.adopt(yearoption)};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML("Please Select...");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);var count=0;subnodes.each(function(subnode){count=count+1;var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)});if(count==0){jQuery("#noDisplayResults").show()}else{jQuery("#noDisplayResults").hide()}};var addBlankports=function(){var portoption="";portoption=new Element("option").setHTML("Please Select...");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption)};var addBlankCount=function(){if(newYear!=null&&newYear!=""){jQuery("#yearboxdiv").show();jQuery("#displayResults").show()}else{if(newDestCode!=null&&newDestCode=="AT"){jQuery("#portboxdiv").hide();jQuery("#yearboxdiv").hide();jQuery("#displayResults").show()}else{jQuery("#yearboxdiv").hide();jQuery("#displayResults").hide()}}jQuery("#noDisplayResults").hide()};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML("Please Select...");destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);var destinationoption2=new Element("option").setHTML("Alaska CruiseTours");destinationoption2.setProperty("value","AT");selectDestinations.adopt(destinationoption2);if(valuee=="AT"){destinationoption2.setProperty("selected","selected")}subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();if(destinationvalue==null||destinationvalue==""){addBlankports()}else{if(destinationvalue=="AT"){addBlankports()}else{var ports="../../../test/json/PackagePorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,"")}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}}addBlankCount();addBlankYear()};var allmethoddom=function(){var destinationvalue=newDestCode;var portvalue=newPortCode;if(destinationvalue!=null&&destinationvalue!=""&&destinationvalue!="AT"){var ports="../../../test/json/PackagePorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}else{addBlankports()}var yearCode=newYear;if(portvalue!=null&&portvalue!=""){var years="../../../test/json/PackageYear.action";var requestyears=new Json.Remote(years,{onComplete:function(jsonObj){addYears(jsonObj.PackageYear,yearCode)}}).send({portCode:portvalue})}else{addBlankYear()}addBlankCount();var destinations="../../../test/json/Destinations.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({})};allmethoddom();selectPorts.addEvent("change",function(e){jQuery("#displayResults").hide();var portvalue=selectPorts.getValue();var yearValue=null;e=new Event(e).stop();yearValue=selectYear.getValue();var years="../../../test/json/PackageYear.action";var requestyears=new Json.Remote(years,{onComplete:function(jsonObj){addYears(jsonObj.PackageYear,"")}}).send({portCode:portvalue});var counts="../../../test/json/PackageCount.action";var requestcounts=new Json.Remote(counts,{onComplete:function(jsonObj){addcounts(jsonObj.Count)}}).send({portCode:portvalue})});selectYear.addEvent("change",function(e){var portvalue=selectPorts.getValue();var yearValue=selectYear.getValue();if(yearValue!=null&&yearValue!=""){e=new Event(e).stop();var counts="../../../test/json/PackageCount.action";var requestcounts=new Json.Remote(counts,{onComplete:function(jsonObj){addcounts(jsonObj.Count)}}).send({portCode:portvalue});$("PackageDetailsForm").submit()}else{jQuery("#displayResults").hide()}});selectDestinations.addEvent("change",function(e){e=new Event(e).stop();allmethod();var destinationvalue=selectDestinations.getValue();if(destinationvalue!=null&&destinationvalue=="AT"){$("PackageDetailsForm").submit();jQuery("#portboxdiv").hide();jQuery("#yearboxdiv").hide();jQuery("#displayResults").hide()}else{jQuery("#portboxdiv").show();jQuery("#displayResults").hide()}})})}var injectSelectBoxesDefault=function(selectDestinations,gallery,selectDurations,selectPorts,selectDates,selectShips){selectDestinations.injectInside(gallery);selectDurations.injectAfter(selectDestinations);selectPorts.injectAfter(selectDurations);selectDates.injectAfter(selectPorts);selectShips.injectAfter(selectDates)};function onloadForMainBody(styles,injectSelectBoxes,initialTexts){if(styles==null){var defaultStyle={width:"191px",display:"block",marginBottom:"4px"};styles={destinationStyle:defaultStyle,durationStyle:defaultStyle,portStyle:defaultStyle,dateStyle:defaultStyle,shipStyle:defaultStyle}}if(injectSelectBoxes==null){injectSelectBoxes=injectSelectBoxesDefault}if(initialTexts==null){initialTexts={destinationText:"Any destination",durationText:"Any duration",portText:"Any departure port",dateText:"Any departure date",shipText:"Any ship"}}window.addEvent("domready",function(){var gallery=$("cruisefinderajx");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode"});var selectDurations=new Element("select",{id:"durationsbox",name:"durationCode"});var selectPorts=new Element("select",{id:"portsbox",name:"portCode"});var selectDates=new Element("select",{id:"datesbox",name:"dateCode"});var selectShips=new Element("select",{id:"shipsbox",name:"shipCodeSearch"});injectSelectBoxes(selectDestinations,gallery,selectDurations,selectPorts,selectDates,selectShips);selectDestinations.setStyles(styles.destinationStyle);selectDurations.setStyles(styles.durationStyle);selectPorts.setStyles(styles.portStyle);selectDates.setStyles(styles.dateStyle);selectShips.setStyles(styles.shipStyle);var adddates=function(subnodes,valuee){var dateoption="";dateoption=new Element("option").setHTML(initialTexts.dateText);dateoption.setProperty("value","");selectDates.empty();selectDates.adopt(dateoption);subnodes.each(function(subnode){var dateoption=new Element("option").setHTML(subnode.displayDate);dateoption.setProperty("value",subnode.key);if(subnode.key==valuee){dateoption.setProperty("selected","selected")}selectDates.adopt(dateoption)})};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML(initialTexts.portText);portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)})};var addships=function(subnodes,valuee){var shipoption="";shipoption=new Element("option").setHTML(initialTexts.shipText);shipoption.setProperty("value","");selectShips.empty();selectShips.adopt(shipoption);subnodes.each(function(subnode){var shipoption=new Element("option").setHTML(subnode.displayName);shipoption.setProperty("value",subnode.name);if(subnode.name==valuee){shipoption.setProperty("selected","selected")}selectShips.adopt(shipoption)})};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML(initialTexts.destinationText);destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var adddurations=function(subnodes,valuee){var durationoption="";durationoption=new Element("option").setHTML(initialTexts.durationText);durationoption.setProperty("value","");selectDurations.empty();selectDurations.adopt(durationoption);subnodes.each(function(subnode){var durationoption=new Element("option").setHTML(subnode.displayValue);durationoption.setProperty("value",subnode.cruiseDurationId);if(subnode.cruiseDurationId==valuee){durationoption.setProperty("selected","selected")}selectDurations.adopt(durationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();var durationvalue=selectDurations.getValue();var portvalue=selectPorts.getValue();var datevalue=selectDates.getValue();var shipvalue=selectShips.getValue();var dates="../../../test/json/CruiseFinderDates.action";var requestdates=new Json.Remote(dates,{onComplete:function(jsonObj){adddates(jsonObj.Date,datevalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ports="../../../test/json/CruiseFinderPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ships="../../../test/json/CruiseFinderShips.action";var requestships=new Json.Remote(ships,{onComplete:function(jsonObj){addships(jsonObj.Ship,shipvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var destinations="../../../test/json/CruiseFinderDestinations.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var durations="../../../test/json/CruiseFinderDurations.action";var requestdurations=new Json.Remote(durations,{onComplete:function(jsonObj){adddurations(jsonObj.CruiseDuration,durationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0})};allmethod();var cruisefinderForm=$("cruisefinderform");$$("a.findcruisesubmit").addEvent("click",function(e){e=new Event(e).stop();cruisefinderForm.submit()});selectDestinations.addEvent("change",function(e){var destinationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDurations.addEvent("change",function(e){var durationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectPorts.addEvent("change",function(e){var portvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDates.addEvent("change",function(e){var datevalue=this.getValue();e=new Event(e).stop();allmethod()});selectShips.addEvent("change",function(e){var shipvalue=this.getValue();e=new Event(e).stop();allmethod()})})}function onloadForFBWidget(styles,injectSelectBoxes,initialTexts){if(styles==null){var defaultStyle={width:"191px",display:"block",marginBottom:"4px"};styles={destinationStyle:defaultStyle,durationStyle:defaultStyle,portStyle:defaultStyle,dateStyle:defaultStyle,shipStyle:defaultStyle}}if(injectSelectBoxes==null){injectSelectBoxes=injectSelectBoxesDefault}if(initialTexts==null){initialTexts={destinationText:"Any destination",durationText:"Any duration",portText:"Any departure port",dateText:"Any departure date",shipText:"Any ship"}}window.addEvent("domready",function(){var gallery=$("cruisefinderajx");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode"});var selectDurations=new Element("select",{id:"durationsbox",name:"durationCode"});var selectPorts=new Element("select",{id:"portsbox",name:"portCode"});var selectDates=new Element("select",{id:"datesbox",name:"dateCode"});var selectShips=new Element("select",{id:"shipsbox",name:"shipCodeSearch"});injectSelectBoxes(selectDestinations,gallery,selectDurations,selectPorts,selectDates,selectShips);selectDestinations.setStyles(styles.destinationStyle);selectDurations.setStyles(styles.durationStyle);selectPorts.setStyles(styles.portStyle);selectDates.setStyles(styles.dateStyle);selectShips.setStyles(styles.shipStyle);var adddates=function(subnodes,valuee){var dateoption="";dateoption=new Element("option").setHTML(initialTexts.dateText);dateoption.setProperty("value","");selectDates.empty();selectDates.adopt(dateoption);subnodes.each(function(subnode){var dateoption=new Element("option").setHTML(subnode.displayDate);dateoption.setProperty("value",subnode.key);if(subnode.key==valuee){dateoption.setProperty("selected","selected")}selectDates.adopt(dateoption)})};var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML(initialTexts.portText);portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)})};var addships=function(subnodes,valuee){var shipoption="";shipoption=new Element("option").setHTML(initialTexts.shipText);shipoption.setProperty("value","");selectShips.empty();selectShips.adopt(shipoption);subnodes.each(function(subnode){var shipoption=new Element("option").setHTML(subnode.displayName);shipoption.setProperty("value",subnode.name);if(subnode.name==valuee){shipoption.setProperty("selected","selected")}selectShips.adopt(shipoption)})};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML(initialTexts.destinationText);destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var adddurations=function(subnodes,valuee){var durationoption="";durationoption=new Element("option").setHTML(initialTexts.durationText);durationoption.setProperty("value","");selectDurations.empty();selectDurations.adopt(durationoption);subnodes.each(function(subnode){var durationoption=new Element("option").setHTML(subnode.displayValue);durationoption.setProperty("value",subnode.cruiseDurationId);if(subnode.cruiseDurationId==valuee){durationoption.setProperty("selected","selected")}selectDurations.adopt(durationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();var durationvalue=selectDurations.getValue();var portvalue=selectPorts.getValue();var datevalue=selectDates.getValue();var shipvalue=selectShips.getValue();var dates="../../../ssl/json/CruiseFinderDates.action";var requestdates=new Json.Remote(dates,{onComplete:function(jsonObj){adddates(jsonObj.Date,datevalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ports="../../../ssl/json/CruiseFinderPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var ships="../../../ssl/json/CruiseFinderShips.action";var requestships=new Json.Remote(ships,{onComplete:function(jsonObj){addships(jsonObj.Ship,shipvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var destinations="../../../ssl/json/CruiseFinderDestinations.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0});var durations="../../../ssl/json/CruiseFinderDurations.action";var requestdurations=new Json.Remote(durations,{onComplete:function(jsonObj){adddurations(jsonObj.CruiseDuration,durationvalue)}}).send({destCode:destinationvalue,portCode:portvalue,shipCode:shipvalue,durationCode:durationvalue,dateCode:datevalue,flexibleMonths:false,noOfFlexibleMonths:0})};allmethod();var cruisefinderForm=$("cruisefinderform");$$("a.findcruisesubmit").addEvent("click",function(e){e=new Event(e).stop();cruisefinderForm.submit()});selectDestinations.addEvent("change",function(e){var destinationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDurations.addEvent("change",function(e){var durationvalue=this.getValue();e=new Event(e).stop();allmethod()});selectPorts.addEvent("change",function(e){var portvalue=this.getValue();e=new Event(e).stop();allmethod()});selectDates.addEvent("change",function(e){var datevalue=this.getValue();e=new Event(e).stop();allmethod()});selectShips.addEvent("change",function(e){var shipvalue=this.getValue();e=new Event(e).stop();allmethod()})})}function changeUrl(){var redirect;redirect=document.getElementById("shipCode").value;document.location.href=redirect}function setSelectedValuesOnloadBrochure(){var max=document.brochureForm.brochureDestCodes.length;for(var idx=0;idx<max;idx++){var dCode=document.brochureForm.brochureDestCodes[idx].value;if(dCode==dest.substr(1,1)){document.brochureForm.brochureDestCodes[idx].checked=true}}}function checkBrochureSettings(destPrime,secondDest,from){if(secondDest.value!=null&&secondDest.value!=""&&destPrime.value!=null&&destPrime.value!=""){if(destPrime.value==secondDest.value){secondDest.value="";jQuery("#guideImageDiv").html("");jQuery("#guideImageDiv").hide();if(from=="secondary"){alert("This is already selected as your primary destination.")}else{alert("Please select a different secondary destination.")}}else{jQuery("#guideImageDiv").html("<a href=\"javascript:openLargeCruiseGuideImage('"+destPrime.value+'\')"><img src="/images/miscellaneous/cruiseGuide-'+destPrime.value+'.jpg"></a>');jQuery("#guideImageDiv").show()}}else{jQuery("#guideImageDiv").html("");jQuery("#guideImageDiv").hide()}}function openLargeCruiseGuideImage(destCode){GBreg_show("Cruise Guide","/images/miscellaneous/cruiseGuide-lg-"+destCode+".jpg",640,962)}function setSelectedValuesOnloadSpecialOffers(){var max=document.spOfferForm.specialOffersDestCodes.length;for(var idx=0;idx<max;idx++){var dCode=document.spOfferForm.specialOffersDestCodes[idx].value;for(var dl=0;dl<destsLength;dl++){if(dCode==dests.substr(dl,1)){document.spOfferForm.specialOffersDestCodes[idx].checked=true}}}}function setSelectedValuesOnloadWeWillCallYou(){var max=document.callYouForm.secondaryDestCodes.length;for(var idx=0;idx<max;idx++){var dCode=document.callYouForm.secondaryDestCodes[idx].value;for(var dl=0;dl<destsLength;dl++){if(dCode==dests.substr(dl,1)){document.callYouForm.secondaryDestCodes[idx].checked=true}}}}function writeReview(tourId,serverName,portCode,destCode,shorexReviewPreUrl){var ret="http://"+serverName+"/cruise-destinations/ShoreExcursions!viewExcursions.action?requestSource=shoreExcursions&portCode="+portCode+"&destCode="+destCode;ret=escape(ret);ret=ReplaceAll(ret,"/","%2F");var inRet=shorexReviewPreUrl+"/9041/"+tourId+"/reviews.htm?format=embedded";inRet=escape(inRet);inRet=ReplaceAll(inRet,"/","%2F");var submissionUrl="http://"+serverName+"/cruise-destinations/SubmitShorexReview.action?requestSource=shoreExcursions&destCode="+destCode+"&portCode="+portCode+"&excursionCode="+tourId;submissionUrl=escape(submissionUrl);submissionUrl=ReplaceAll(submissionUrl,"/","%2F");var url=shorexReviewPreUrl+"/9041/"+tourId+"/writereview.htm?format=embedded&campaignid=BV_RATING_SUMMARY&return=";url=url+ret;url=url+"&innerreturn="+inRet;url=url+"&user=__USERID__&submissionparams=__BVSUBMISSIONPARAMETERS__&submissionurl=";url=url+submissionUrl;document.location.href=url}function ReplaceAll(Source,stringToFind,stringToReplace){var temp=Source;var index=temp.indexOf(stringToFind);while(index!=-1){temp=temp.replace(stringToFind,stringToReplace);index=temp.indexOf(stringToFind)}return temp}function initializeNavigationSimple(firstLevel,secondLevel,thirdLevel){var firstLoad="first";window.addEvent("domready",function(){if(firstLevel!=""&&firstLevel!=undefined){firstLoad=firstLevel}if(secondLevel!=""&&secondLevel!=undefined){firstLoad=secondLevel}if(thirdLevel!=""&&thirdLevel!=undefined){firstLoad=thirdLevel}myTabs1=new mootabs("leftnavigation",{height:"auto",width:"auto",changeTransition:"none",mouseOverClass:"over",activateOnLoad:firstLoad})})}function initializeNavigation(firstLevel,secondLevel,thirdLevel){initializeNavigationSimple(firstLevel,secondLevel,thirdLevel);addDCSMultiTrackToDomReady()}function corporateIncentivesMainOnload(){if(window.ie){window.addEvent("domready",function(){var headertab=$ES(".mootabs_title_vert li");headertab.each(function(eachtag){var idtag=eachtag.getProperty("id");if(idtag=="4"){eachtag.$events.click.keys.each(function(event){eachtag.removeEvent("click",event)})}eachtag.addEvent("click",function(){dcsMultiTrack("WT.ti","Tab: "+eachtag.title,"WT.dl","1");if(idtag=="4"){GBreg_show("Contact Form","ContactCharter.action",640,962)}})})})}else{window.addEvent("load",function(){var headertab=$ES(".mootabs_title_vert li");headertab.each(function(eachtag){var idtag=eachtag.getProperty("id");if(idtag=="4"){eachtag.$events.click.keys.each(function(event){eachtag.removeEvent("click",event)})}eachtag.addEvent("click",function(){dcsMultiTrack("WT.ti","Tab: "+eachtag.title,"WT.dl","1");if(idtag=="4"){GBreg_show("Contact Form","ContactCharter.action",640,962)}})})})}}function shorexSearchOnload(newDestCode,newPortCode,newTourLangCode,useLangCode){window.addEvent("domready",function(){var destinationcontainer=$("destinationcontainer");var portcontainer=$("portcontainer");var selectDestinations=new Element("select",{id:"destinationsbox",name:"destCode","class":"two10"});var selectPorts=new Element("select",{id:"portbox",name:"portCode","class":"two10"});selectDestinations.injectInside(destinationcontainer);selectPorts.injectInside(portcontainer);if(useLangCode){var tourLangcontainer=$("tourLangcontainer");var selectTourLang=new Element("select",{id:"tourLangbox",name:"tourLanguage","class":"two10"});selectTourLang.injectInside(tourLangcontainer)}var addcounts=function(subnodes){subnodes.each(function(subnode){$("count").empty();$("count").setHTML(subnode.count);if($("destinationsbox").value!=null&&$("destinationsbox").value!=""&&$("portbox").value!=null&&$("portbox").value!=""){if($("count").getText()>0){jQuery("#displayResultsSubmit").show();jQuery("#noDisplayResults").hide()}else{jQuery("#displayResultsSubmit").hide();jQuery("#noDisplayResults").show()}}else{jQuery("#displayResultsSubmit").hide();jQuery("#noDisplayResults").hide()}})};if(useLangCode){var addTourLanguages=function(subnodes,valuee){var tourLangoption="";tourLangoption=new Element("option").setHTML("Please Select...");tourLangoption.setProperty("value","");selectTourLang.empty();selectTourLang.adopt(tourLangoption);tourLangoption="";tourLangoption=new Element("option").setHTML("Show All");tourLangoption.setProperty("value","");selectTourLang.adopt(tourLangoption);subnodes.each(function(subnode){var tourLangoption=new Element("option").setHTML(subnode.language);tourLangoption.setProperty("value",subnode.langCode);if(subnode.langCode==valuee){tourLangoption.setProperty("selected","selected")}selectTourLang.adopt(tourLangoption)})};var addBlankTourLang=function(){var tourLangoption="";tourLangoption=new Element("option").setHTML("Please Select...");tourLangoption.setProperty("value","");selectTourLang.empty();selectTourLang.adopt(tourLangoption)}}var addports=function(subnodes,valuee){var portoption="";portoption=new Element("option").setHTML("Please Select...");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption);subnodes.each(function(subnode){var portoption=new Element("option").setHTML(subnode.marketName);portoption.setProperty("value",subnode.portCode);if(subnode.portCode==valuee){portoption.setProperty("selected","selected")}selectPorts.adopt(portoption)})};var addBlankports=function(){var portoption="";portoption=new Element("option").setHTML("Please Select...");portoption.setProperty("value","");selectPorts.empty();selectPorts.adopt(portoption)};var addBlankCount=function(){jQuery("#displayResultsSubmit").hide();jQuery("#noDisplayResults").hide()};var adddestinations=function(subnodes,valuee){var destinationoption="";destinationoption=new Element("option").setHTML("Please Select...");destinationoption.setProperty("value","");selectDestinations.empty();selectDestinations.adopt(destinationoption);subnodes.each(function(subnode){var destinationoption=new Element("option").setHTML(subnode.name);destinationoption.setProperty("value",subnode.destCode);if(subnode.destCode==valuee){destinationoption.setProperty("selected","selected")}selectDestinations.adopt(destinationoption)})};var allmethod=function(){var destinationvalue=selectDestinations.getValue();if(destinationvalue==null||destinationvalue==""){addBlankports()}else{var ports="../../../test/json/ShoreExcursionPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,"")}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}addBlankCount();if(useLangCode){addBlankTourLang()}};var allmethoddom=function(){var destinationvalue=newDestCode;var portvalue=newPortCode;if(destinationvalue!=null&&destinationvalue!=""){var ports="../../../test/json/ShoreExcursionPorts.action";var requestports=new Json.Remote(ports,{onComplete:function(jsonObj){addports(jsonObj.Port,portvalue)}}).send({destCode:destinationvalue,departurePortsOnly:"0"})}else{addBlankports()}if(useLangCode){var tourLangCode=newTourLangCode;if(portvalue!=null&&portvalue!=""){var tourLangs="../../../test/json/ShoreTourLanguages.action";var requesttourLangs=new Json.Remote(tourLangs,{onComplete:function(jsonObj){addTourLanguages(jsonObj.TourLanguage,tourLangCode)}}).send({portCode:portvalue})}else{addBlankTourLang()}}addBlankCount();var destinations="../../../test/json/Destinations.action";var requestdestinations=new Json.Remote(destinations,{onComplete:function(jsonObj){adddestinations(jsonObj.Destination,destinationvalue)}}).send({})};allmethoddom();selectPorts.addEvent("change",function(e){var portvalue=selectPorts.getValue();var tourLangValue=null;e=new Event(e).stop();if(useLangCode){tourLangValue=selectTourLang.getValue();var tourLangs="../../../test/json/ShoreTourLanguages.action";var requestports=new Json.Remote(tourLangs,{onComplete:function(jsonObj){addTourLanguages(jsonObj.TourLanguage,"")}}).send({portCode:portvalue})}var counts="../../../test/json/ExcursionsCount.action";var requestcounts=new Json.Remote(counts,{onComplete:function(jsonObj){addcounts(jsonObj.Count)}}).send({portCode:portvalue})});if(useLangCode){selectTourLang.addEvent("change",function(e){var portvalue=selectPorts.getValue();var tourLangValue=selectTourLang.getValue();e=new Event(e).stop();var counts="../../../test/json/ExcursionsCount.action";var requestcounts=new Json.Remote(counts,{onComplete:function(jsonObj){addcounts(jsonObj.Count)}}).send({portCode:portvalue,tourLanguage:tourLangValue})})}selectDestinations.addEvent("change",function(e){e=new Event(e).stop();allmethod()});$("viewex").addEvent("click",function(){$("shoreExform").submit()})})}function destinationOnload(firstLevel,secondLevel){var firstLoad="first";window.addEvent("domready",function(){if(firstLevel!=""){firstLoad=firstLevel}if(secondLevel!=""){firstLoad=secondLevel}var firstIndex=$$(".mootabs_title_vert li.first").getProperty("id");var myToggler=$$("li.acc");new MultipleOpenAccordion(myToggler,$$("ul.second"),{openAll:false,allowMultipleOpen:false,firstElementsOpen:[firstIndex],transition:Fx.Transitions.sineOut,display:0});myTabs1=new mootabs("leftnavigation",{height:"auto",width:"auto",changeTransition:"none",mouseOverClass:"over",activateOnLoad:firstLoad})});window.addEvent((window.ie)?"domready":"load",addDCSMultiTrack)}function bvLoadRR(url,tourId){var bvPage=url+"/9041/"+tourId+"/reviews.htm?format=embedded";var URLParamNames={reviewID:"featurereview",reviewPage:"reviewspage"};var getURLParam=function(name){if(!name){return null}var match=(new RegExp("[?&]"+name+"=([^&#]+)")).exec(window.location.search);return match?decodeURIComponent(match[1]):null};bvReviewID=getURLParam(URLParamNames.reviewID);bvReviewPage=getURLParam(URLParamNames.reviewPage);if(/^[0-9]+$/.test(bvReviewID)){bvPage+="&reviewid="+bvReviewID}else{if(/^[0-9]+$/.test(bvReviewPage)){bvPage+="&page="+bvReviewPage}}document.getElementById("BVFrame").src=bvPage;setTimeout("BVcheckLoadState()",15000)}function BVsubmissionCheckLoadState(bvErrorMsg){if(!BVisLoaded){document.getElementById("BVSubmissionFrame").src="";document.getElementById("BVSubmissionContainer").innerHTML=bvErrorMsg}}function bvLoadRRSubmission(bvoice_user){var bvErrorMsg="Review Submission Currently Unavailable";var getURLParam=function(name){if(!name){return null}var match=(new RegExp("[?&]"+name+"=([^&#]+)")).exec(window.location.search);return match?decodeURIComponent(match[1]):null};bvPage=getURLParam("bvpage");var bvRegex=new RegExp("^"+window.location.protocol+"//([A-Za-z0-9-.]+[.])?"+document.domain+"/");if(bvPage&&bvRegex.test(bvPage)){BVisLoaded=false;document.getElementById("BVSubmissionFrame").src=bvPage.replace(/__USERID__/,bvoice_user);setTimeout('BVsubmissionCheckLoadState("'+bvErrorMsg+'")',15000)}else{document.getElementById("BVSubmissionContainer").innerHTML=bvErrorMsg}}function openDeckPlansCruiseDetails(shipCode){shipCode=shipCode.toLowerCase();if(shipCode=="sd"){shipCode="sa_2"}else{if(shipCode=="aa"){shipCode="za"}else{if(shipCode=="uu"){shipCode="zu"}else{if(shipCode=="ma"){shipCode="ma_2"}}}}var url="/main/DeckPlans.action?ship="+shipCode;window.open(url,"deckPlans")}function displayVandVBug(){var year=strSailDate.substr(0,4);var month=strSailDate.substr(4,2);month=month-1;var day=strSailDate.substr(6,2);if(vvShipCode=="AM"){startDateVV=new Date("2010","03","29")}else{if(vvShipCode=="ED"){startDateVV=new Date("2010","02","20")}else{if(vvShipCode=="MA"){startDateVV=new Date("2010","03","02")}else{if(vvShipCode=="NA"){startDateVV=new Date("2010","06","04")}else{if(vvShipCode=="NO"){startDateVV=new Date("2010","03","04")}else{if(vvShipCode=="OS"){startDateVV=new Date("2010","03","03")}else{if(vvShipCode=="PR"){startDateVV=new Date("2010","04","17")}else{if(vvShipCode=="RT"){startDateVV=new Date("2010","03","10")}else{if(vvShipCode=="RY"){startDateVV=new Date("2010","02","28")}else{if(vvShipCode=="SD"){startDateVV=new Date("2010","03","11")}else{if(vvShipCode=="VE"){startDateVV=new Date("2010","03","25")}else{if(vvShipCode=="VO"){startDateVV=new Date("2010","03","17")}else{if(vvShipCode=="WE"){startDateVV=new Date("2010","02","14")}else{if(vvShipCode=="AA"){startDateVV=new Date("2010","04","14")}else{if(vvShipCode=="UU"){startDateVV=new Date("2010","02","31")}}}}}}}}}}}}}}}var vvSailDate=new Date(year,month,day);var vvCountryCode=getCookieValue("countryCodeForHAL");if(startDateVV<=vvSailDate&&vvSailDate<=endDateVV){if(vvCountryCode=="NL"){document.getElementById("vandvbug_NL").style.display="block"}else{document.getElementById("vandvbug").style.display="block"}}}function getCookieValue(cookieName){var exp=new RegExp(escape(cookieName)+"=([^;]+)");if(exp.test(document.cookie+";")){exp.exec(document.cookie+";");return unescape(RegExp.$1)}else{return false}}function setCookieValue(name,value,expires){if(name==undefined){return}if(value==undefined){value=""}var cookieSettings=name+"="+value+"; path=/";if(expires!=null){cookieSettings+="; expires="+expires}if(document.domain.indexOf("hollandamerica")!=-1){cookieSettings+="; domain=hollandamerica.com"}document.cookie=cookieSettings}function showSocialMediaOverlay(url,delay,height,width){if(!OVERLAY_OPEN){window.addEvent("domready",function(){GBreg_show("Social Media Overlay",url,height,width)});var futureExpire="Tue, 2 Jun 2050 00:00:00 GMT";setCookieValue("viewedSocialMediaOverlay","true",futureExpire)}else{setTimeout("showSocialMediaOverlay('"+url+"', '"+delay+"', "+height+", "+width+")",delay)}}function scheduleSocialMediaOverlay(url,delay,height,width){if(width==null){width=962}if(height==null){height=640}var viewedOverlay=getCookieValue("viewedSocialMediaOverlay");if(viewedOverlay!="true"){setTimeout("showSocialMediaOverlay('"+url+"', '"+delay+"', "+height+", "+width+")",delay)}}function showMyAccountSocialMediaOverlay(delay,height,width){var viewedOverlay=getCookieValue("viewedSocialMediaOverlay");var clickedSocialMediaLink=getCookieValue("clickedSocialMediaLink");if(viewedOverlay!="true"&&clickedSocialMediaLink!="true"){scheduleSocialMediaOverlay("/main/MyAccountOverlay.action",delay,height,width)}}function showForBookedGuestsSocialMediaOverlay(delay,height,width){var viewedOverlay=getCookieValue("viewedSocialMediaOverlay");if(viewedOverlay!="true"){scheduleSocialMediaOverlay("/main/ForBookedGuestsOverlay.action",delay,height,width)}}function setClickedSocialMediaLink(){setCookieValue("clickedSocialMediaLink","true")}function loadHeader(xml){jQuery(xml).find("album").each(function(){var path=jQuery(this).attr("lgpath");var speed=jQuery(this).attr("advanceSpeed");jQuery(xml).find("img").each(function(i){var id=i+1;var image=jQuery(this).attr("src");var u=image.lastIndexOf("/");var img=image.substring(u+1);var wt='dcsMultiTrack("DCS.dcsuri","/hp_hero","WT.ti","Click:hp_hero","WT.dl","2","WT.z_mod_n","hp_hero","WT.z_mod_a","clickthrough","WT.z_mod_a_d", "'+img+'","WT.z_mod_a_p", "'+id+'");';var imageURL=path+image;var url=jQuery(this).attr("link");var target=jQuery(this).attr("target");jQuery("#header_slideshow").append("<div><a href='"+url+"' onClick='"+wt+"' target='"+target+"'><img src='"+imageURL+"' alt='' border ='none' width='960' height='350' /></a></div>")});jQuery("#header_slideshow").cycle({fx:"fade",timeout:speed,pager:"#hero_navi",pagerAnchorBuilder:paginate_header,slideExpr:"div",nowrap:1})})}function loadSpotlight(xml){jQuery("#spotlight_slideshow").empty();jQuery(xml).find("slideshow").each(function(){jQuery(xml).find("photo").each(function(i){var id=i+1;var url=jQuery(this).attr("gotoURL");var target=jQuery(this).attr("urlWindow");var imageURL=jQuery(this).attr("photoURL");var u=imageURL.lastIndexOf("/");var img=imageURL.substring(u+1);var wt='dcsMultiTrack("DCS.dcsuri","/hp_spotlight","WT.ti","Click:hp_spotlight","WT.dl","2","WT.z_mod_n","hp_spotlight","WT.z_mod_a","clickthrough","WT.z_mod_a_d", "'+img+'","WT.z_mod_a_p", "'+id+'");';jQuery("#spotlight_slideshow").append("<div><a href='"+url+"' onClick='"+wt+"' target='"+target+"'><img src='"+imageURL+"' alt='' border ='none' width='276' height='203' /></a></div>")});jQuery("#spotlight_slideshow").cycle({fx:"fade",timeout:4000,pager:"#spotlight_navi",pagerAnchorBuilder:paginate_spotlight,slideExpr:"div",nowrap:1})})}function openLuggageTag(bookingUrl,booking,seq){var langCode=getCookieValue("languageCodeForHAL");if(!langCode){langCode="en"}var url=bookingUrl+"/checkin/viewEdocs.do?seqNumber="+seq+"&booking="+booking+"&docType=EL&checkinComplete=true&tags=true&langCode="+langCode+"&tagCount="+document.getElementById("tagCount"+booking).value;window.open(url,"LuggageTag"+booking,"toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=800,height=600,left = 10,top = 10")}function displayGlobalData(){var currElem=document.getElementById("contentName").value;document.getElementById(cname).style.display="none";document.getElementById(currElem).style.display="block";cname=currElem}function displayCorporateData(){var currElem=document.getElementById("corpOff").value;document.getElementById(cname).style.display="none";document.getElementById(currElem).style.display="block";cname=currElem}function loadRecentItems(){jQuery.noConflict();jQuery("body").css("cursor","wait");jQuery.ajax({url:"/main/RecentlyViewedHome.action",cache:false,success:function(message){jQuery("body").css("cursor","default");jQuery("#ajaxRecentItems").html(message)}})}function showAllPorts(){jQuery("#allPortsDiv").show();jQuery("#singlePortDiv").hide();jQuery("#hideAllPortsButton").show();jQuery("#showAllPortsButton").hide()}function hideAllPorts(){jQuery("#allPortsDiv").hide();jQuery("#singlePortDiv").show();jQuery("#hideAllPortsButton").hide();jQuery("#showAllPortsButton").show()}function loadOffersContent(destCode,duration,dateCode,reloadDuration,reloadDates,specialOfferType,specialOfferCode,subMenuItem){var offerURL="/find-cruise-vacation/LoadOffersContent.action?";offerURL=offerURL+"destCode="+destCode+"&duration="+duration+"&dateCode="+dateCode;offerURL=offerURL+"&specialOfferType="+specialOfferType+"&specialOfferCode="+specialOfferCode;offerURL=offerURL+"&subMenuItem="+subMenuItem;jQuery.noConflict();jQuery("body").css("cursor","wait");jQuery.ajax({url:offerURL,cache:false,success:function(message){jQuery("body").css("cursor","default");jQuery("#ajaxOffersContent").html(message);if(reloadDuration){var durContent=jQuery("#tempDurationHolder").html();jQuery("#finalDurationHolder").html(durContent)}if(reloadDates){var dateContent=jQuery("#tempDatesHolder").html();jQuery("#finalDatesHolder").html(dateContent)}jQuery("#tempDurationHolder").html("");jQuery("#tempDatesHolder").html("")}})}function obtainSpOfferCode(){var dCode=document.getElementById("destCode").value;var specialOfferCode="";if(dCode!=null&&dCode!=""){if(dCode.contains("multi")){specialOfferCode=dCode}else{if(dCode.length>1&&dCode!="AT"){var offerCodeKey=dCode.substring(0,1);specialOfferCode=document.getElementById(offerCodeKey).value}else{specialOfferCode=document.getElementById(dCode).value}}}}function showSpecialoffersByFilters(currentSelect){var dCode=document.getElementById("destCode").value;var specialOfferType=document.getElementById("specialOfferType").value;var subMenuItem=document.getElementById("subMenuItem").value;if(dCode!=null&&dCode!=""){var durCode=document.getElementById("duration").value;var dateCode=document.getElementById("dateCode").value;var reloadDuration=true;var reloadDates=true;var specialOfferCode=obtainSpOfferCode();if(currentSelect=="duration"){reloadDuration=false}else{if(currentSelect=="date"){reloadDates=false}else{durCode="";dateCode=""}}loadOffersContent(dCode,durCode,dateCode,reloadDuration,reloadDates,specialOfferType,specialOfferCode,subMenuItem)}}function openCustomOverlay(url,height,width){jQuery(document).ready(function(){GBreg_show("map",url,height,width)})}var trafficCode=getCookieValue("trafficSourceForHAL");var isMarketedHAL=false;if(trafficCode&&(trafficCode.indexOf("email")!=-1||trafficCode.indexOf("Remkt")!=-1)){isMarketedHAL=true}function openPromotionalOverlay(url,delay,cookieName){if(!OVERLAY_OPEN){jQuery(document).ready(function(){GBreg_show("Login",url,640,962)});setHALCookie(cookieName)}else{setTimeout("openPromotionalOverlay('"+url+"', '"+delay+"', '"+cookieName+"')",delay)}}function openCustomPromotionalOverlay(url,delay,cookieName,height,width,title){if(!OVERLAY_OPEN){jQuery(document).ready(function(){GBreg_show(title,url,height,width)});setHALCookie(cookieName)}else{setTimeout("openCustomPromotionalOverlay('"+url+"', '"+delay+"', '"+cookieName+"', '"+height+"', '"+width+"', '"+title+"')",delay)}}function setHALCookie(cookieName){if(document.domain.indexOf("hollandamerica")==-1){document.cookie=cookieName+"=yes; expires=Tue, 2 Jun 2050 00:00:00 GMT; path=/"}else{document.cookie=cookieName+"=yes; expires=Tue, 2 Jun 2050 00:00:00 GMT; path=/; domain=hollandamerica.com"}}function openClickToInteractOverlay(from,delay){var height="350";var width="400";var cookieName="clickToInteractForHAL";var clickToInteractCode=getCookieValue(cookieName);if(!clickToInteractCode||clickToInteractCode!="yes"){if(isMarketedHAL){setHALCookie(cookieName)}else{var url="/contactUs/"+from+".action";var title="";setTimeout("openCustomPromotionalOverlay('"+url+"', '"+delay+"', '"+cookieName+"', '"+height+"', '"+width+"', '"+title+"')",delay)}}}function showSpecialOfferPopup(from,delay){var cookieName="specialOffersForHAL";var specialOfferCode=getCookieValue(cookieName);if(!specialOfferCode||specialOfferCode!="yes"){if(isMarketedHAL){setHALCookie(cookieName)}else{var url="/contactUs/"+from+"SpecialOffers.action?spFrom="+from;setTimeout("openPromotionalOverlay('"+url+"', '"+delay+"', '"+cookieName+"')",delay)}}}function showMarinerSpecialOfferPopup(from,delay){var cookieName="marinerSpecialOffersForHAL";var marinerCode=getCookieValue(cookieName);if(!marinerCode||marinerCode!="yes"){var url="/contactUs/"+from+"SpecialOffers.action?spFrom="+from;setTimeout("    openPromotionalOverlay('"+url+"', '"+delay+"', '"+cookieName+"')",delay)}}function loadTabs(flash,image,url){updateHeader(flash,image);updateFBLike(url)}function updateFBLike(link){if(loadHALFBLike!=null&&loadHALFBLike){if(link!=null){var url="http://"+link;jQuery("#fblikeblock").html('<div class="fb-like" data-href="'+url+'" data-layout="button_count" data-width="100" data-show-faces="false" data-send="false"></div>');if(typeof FB!="undefined"){FB.XFBML.parse(document.getElementById("fblikeblock"))}}}};
