Type.registerNamespace("Ecom");Type.registerNamespace("Proto");Ecom.Application=function(){this.brand="";this.channel="";this.language="";this.waiterBox=null;this.extractInfo();Sys.Net.WebRequestManager.add_invokingRequest(this._onInvokingRequest);Sys.Application.add_load(Function.createDelegate(this,this._onDocumentLoad));Sys.Application.add_unload(Function.createDelegate(this,this._onDocumentUnload));this._created=new Date()};Ecom.Application.prototype={_onInvokingRequest:function invokingRequestHandler(d,a){var c=a.get_webRequest();metaCollection=document.getElementsByTagName("meta");for(i=0;i<metaCollection.length;i++){nameAttribute=metaCollection[i].name.search(/PageId/);if(nameAttribute!=-1){c.get_headers()["PageContext"]=metaCollection[i].content}}var b=jQuery("form:first").attr("CultureInfoName");c.get_headers()["CultureInfoName"]=b},extractInfo:function(e){this.brand="";this.channel="";this.language="";var a="body";if(e){a="#"+e}var c=jQuery(a).attr("class").match(/(?:brand|channel|language)-(\w+)/gi)||[];for(var b=c.length-1;b>=0;b--){var d=c[b].split("-");if(d.length==2){this[d[0]]=d[1]}}},showWaiterBox:function(a){if(this.waiterBox!=null){this.waiterBox.show(a)}},hideWaiterBox:function(){if(this.waiterBox!=null){this.waiterBox.hide()}},_onDocumentLoad:function(){this.waiterBox=new Ecom.UI.ModalBox("#headerWaitPanel",{dialogClass:"waiter-box",width:250,overlay:{id:"waiterOverlay"}})},_onDocumentUnload:function(){ThomasCook.Ecom.Web.BookingAvailability.DeletePageSpecificSessionVariables()}};Ecom.Application.registerClass("Ecom.Application");Ecom.Application=new Ecom.Application();Type.registerNamespace("Ecom.UI");Ecom.UI.Overlay=function(b){var d={id:"modalOverlay",zIndex:900,container:document.body};b=jQuery.extend(d,b);this._selector="#"+b.id;if(!jQuery(this._selector).length){var c='<div id="'+b.id+'" class="ui-widget-overlay" style="display:none;z-index:'+b.zIndex+';"></div>',e=jQuery(b.container),a=jQuery(c).appendTo(e);(jQuery.fn.bgiframe&&a.bgiframe())}};Ecom.UI.Overlay.prototype={show:function(b){var a={left:0,top:0,width:this.width(),height:this.height()};b=jQuery.extend(a,b);jQuery(this._selector).css({left:b.left+"px",top:b.top+"px",width:b.width+"px",height:b.height+"px"}).show()},hide:function(){jQuery(this._selector).hide()},height:function(){if(jQuery.browser.msie&&jQuery.browser.version<7){var c=document.documentElement||{},a=document.body||{},d=Math.max(c.scrollHeight||0,a.scrollHeight||0),b=Math.max(c.offsetHeight||0,a.offsetHeight||0);if(d<b){return jQuery(window).height()}else{return d}}else{return jQuery(document).height()}},width:function(){if(jQuery.browser.msie&&jQuery.browser.version<7){var b=document.documentElement||{},a=document.body||{},c=Math.max(b.scrollWidth||0,a.scrollWidth||0),d=Math.max(b.offsetWidth||0,a.offsetWidth||0);if(c<d){return jQuery(window).width()}else{return c}}else{return jQuery(document).width()}}};Ecom.UI.Overlay.registerClass("Ecom.UI.Overlay");Ecom.UI.ModalBox=function(a,e){var d={autoOpen:false,bgiframe:true,closeOnEscape:false,draggable:false,resizable:false,position:["middle","center"],width:"auto"};var b=jQuery.extend(d,e);b.modal=false;this.initialPosition={};this.initialPosition.left=b.position[0]||"middle";this.initialPosition.top=b.position[1]||"center";var c=jQuery("<div/>");var f=jQuery(a||c);this.element=f.length?f:c;this.element.dialog(b);this.element.closest("div.ui-dialog").find("div.ui-dialog-titlebar").remove();this.overlay=new Ecom.UI.Overlay(b.overlay)};Ecom.UI.ModalBox.prototype={show:function(c){var a={left:this.initialPosition.left,top:this.initialPosition.top};c=jQuery.extend(a,c);if(c.content){var d=jQuery(".content",this.element);if(d.length){d.empty();d.append(c.content)}}jQuery(".close-button",this.element).bind("click",this,this.onCloseButtonClick);this.overlay.show(c.overlay);this.element.dialog("option","position",[c.left,c.top]);this.element.dialog("open");var b=this.element.position().top+this.element.scrollTop();this.element.css("top",b+"px")},hide:function(){jQuery(".close-button",this.element).unbind("click",this.onCloseButtonClick);this.element.dialog("close");this.overlay.hide()},width:function(){return this.element.dialog("option","width")},height:function(){return this.element.dialog("option","height")},dispose:function(){this.element.dialog("destroy").remove()},onCloseButtonClick:function(a){a.data.hide()}};Ecom.UI.ModalBox.registerClass("Ecom.UI.ModalBox",null,Sys.IDisposable);Ecom.ModalDialog=function(a){this.width=10;this.height=10;this.backgroundColor="#fff";this.modalTopMargin="";this.fullScreen=false;this.offsetLeft=0;this.toBeShownId=a.id;this.toBeDisabledId="";this.toBeUsedForBackgroundBoundsId="";this.initialFocusId="";this.overlayPlaceHolderId="";this.overlayObject="";this.overlayId="";this.toCloseId="";Ecom.ModalDialog.initializeBase(this,[a]);this.OnClickDelegate=Function.createDelegate(this,this.OnClick);$addHandler(a,"click",this.OnClickDelegate)};Ecom.ModalDialog.prototype={initialize:function(){if(this.overlayId==""){this.overlayId="overlay"+this.toBeShownId}this.overlayContainerId=(this.overlayPlaceHolderId!="")?(this.overlayPlaceHolderId):(this.toBeDisabledId);jQuery(document).ready(Function.createDelegate(this,function(){this.overlayObject=new Ecom.UI.Overlay({id:this.overlayId,zIndex:600,container:jQuery("#"+this.overlayContainerId).parent()})}));var a=jQuery("#"+this.toBeShownId);if(a.length>0){a.css("position","absolute");a.css("z-index",900)}},OnClick:function(a){var c=this.toCloseId.split(",");var b=a.target;if(b!=null){for(i=0;i<c.length;i++){if(b.id==c[i]){this.Close()}}}},Show:function(){var a=jQuery("#"+this.toBeShownId);if(a.length>0){this.overlayObject.show();jQuery("#"+this.overlayId).css({"background-color":this.backgroundColor,opacity:"0.7",filter:"alpha(opacity=70)"});var c=(jQuery(window).height()-a.height())/2;var b=jQuery(window).width()/2-a.width()/2;if(c<0){c=40}a.css({top:c+"px",left:b+"px"}).show();this.scrollIntoView(a,true)}},scrollIntoView:function(b,a){var c=jQuery(b).offset().top||0;if(c<jQuery().scrollTop()){if(a){jQuery("html,body").stop().animate({scrollTop:c})}else{b.scrollIntoView(true)}}},Close:function(){var a=$get(this.toBeShownId);if(a!=null){a.style.display="none";jQuery(this.toBeDisabledId).show()}this.overlayObject.hide()}};Ecom.ModalDialog.registerClass("Ecom.ModalDialog",Sys.UI.Control);Ecom.UI.Calendar=function(a){this.control=null;this.onSelect=null;this.onShow=null;this._initialize(a)};Ecom.UI.Calendar.prototype={_initialize:function(b){var c=b.target;delete b.target;if(b.beforeShow){this.onShow=b.beforeShow}if(b.onSelect){this.onSelect=b.onSelect}this.control=Ecom.UI.Calendar.createDatepickerControl(c,jQuery.extend({},b,{onSelect:Function.createDelegate(this,this._onSelectProxy),beforeShow:Function.createDelegate(this,this._onShowProxy)}));this.setCurrentLanguage();var a=this._getOption("altField");jQuery(a).click(Function.createDelegate(this,function(){this.show()}))},_onSelectProxy:function(b,a){this._updateAltField();if(this.onSelect){this.onSelect(b,a)}},_onShowProxy:function(a,b){if(this.onShow){this.onShow(a,b)}this._fixCalendarPosition(a,b)},_updateAltField:function(){var a=this._getOption("altField");if(a){var c=this._getOption("altFormat")||"d-m-yy";var b=jQuery.datepicker.formatDate(c,this.getSelectedDate())||"";jQuery(a).text(b)}},_fixCalendarPosition:function(b,g){var e=jQuery(b).next("img.ui-datepicker-trigger"),h={left:0,top:e.height()};var d=this._getOption("altField");if(d){var c=jQuery(d),f=c.offset(),a=e.offset();h.left=f.left-a.left;h.top=f.top+c.outerHeight()-a.top+1}g.dpDiv.css({marginLeft:h.left+"px",marginTop:h.top+"px"})},_getOption:function(a){if(this.control){return this.control.datepicker("option",a)||""}return null},_setOption:function(a,b){if(this.control&&typeof b!=="undefined"){this.control.datepicker("option",a,b)}},show:function(){if(this.control){this.control.datepicker("show")}},getAttribute:function(a){return this.control.attr(a)||null},setLanguage:function(a){if(this.control){window.setTimeout(Function.createDelegate(this,function(){this.control.datepicker("option",jQuery.datepicker.regional[a||"nl"])}),300)}return null},setCurrentLanguage:function(){if(this.control){this.setLanguage(Ecom.Application.language||"nl")}return null},getSelectedDate:function(){if(this.control){return this.control.datepicker("getDate")||new Date()}return null},selectDate:function(b,a){if(this.control){this.control.datepicker("setDate",b||new Date())}if(a){this._updateAltField()}},setRanges:function(a,b){if(a){this._setOption("minDate",a)}if(b){this._setOption("maxDate",b)}},disable:function(){if(this.control){this.control.datepicker("disable")}}};Ecom.UI.Calendar.create=function(a){if(!a||!a.target){return null}return new Ecom.UI.Calendar(a)};Ecom.UI.Calendar.createDatepickerControl=function(c,b){var a=jQuery(c);if(a.length>0){a.datepicker("destroy");a.datepicker(jQuery.extend({dateFormat:"yymmdd",hideIfNoPrevNext:true,showOtherMonths:false,duration:"fast",showAnim:"fadeIn",showOn:"both",buttonImage:"/App/Upload/Css/NVB/Images/calendar.gif",buttonImageOnly:true},b))}return a};Ecom.UI.Calendar.registerClass("Ecom.UI.Calendar");Proto.BigPhotoModule=function(a){Proto.BigPhotoModule.initializeBase(this,[a]);this.OnClickDelegate=Function.createDelegate(this,this.OnClick);$addHandler(a,"click",this.OnClickDelegate);this.NamingContainer=a.id;this.SelectedElementId=a.id+"_thumb1";this.selectedClass="selected";this.unselectedClass="unselected";this.maximumWidth="800";this.maximumHeight="600"};Proto.BigPhotoModule.prototype={ResizeFor:function(g){var d=$get(this.NamingContainer+"_main");var b=0;var e=0;if(g!=null){var f=g.getAttribute("initheight");var c=g.getAttribute("initwidth")}if(f!=null&&c!=null){b=f;e=c}else{b=d.getAttribute("initheight");e=d.getAttribute("initwidth")}if(b!=null&&e!=null){var h=800;var a=600;if(Number(this.maximumWidth)!=0&&Number(this.maximumHeight)!=0){h=Number(this.maximumWidth);a=Number(this.maximumHeight)}if(e>b){if(e>h){b=Math.round((b/e)*h);e=h}if(b>a){e=Math.round((e/b)*a);b=a}}else{if(b>a){e=Math.round((e/b)*a);b=a}if(e>h){b=Math.round((b/e)*h);e=h}}d.setAttribute("height",b);d.setAttribute("width",e)}},OnClick:function(b){var a=null;var j=$get(this.NamingContainer+"_fotonumber");var k=$get(this.NamingContainer+"_fotocount");var h=b.target;var g=this.NamingContainer+"_thumb";if(h.id.startsWith(g)){if(h.id!=this.SelectedElementId){a=h}}else{if((j!=null)&&(k!=null)){var e=0;if(h.id==this.NamingContainer+"_next"){e=1}else{if(h.id==this.NamingContainer+"_previous"){e=-1}}if(e!=0){var f=parseInt(j.innerHTML)+e;a=$get(this.NamingContainer+"_thumb"+f);if(a==null){if(e==1){a=$get(this.NamingContainer+"_thumb1")}else{a=$get(this.NamingContainer+"_thumb"+k.innerHTML)}}}}}if(a!=null){var d=$get(this.SelectedElementId);if(d!=null){d.className=this.unselectedClass}var l=a.id.substring(g.length);if(j!=null){j.innerHTML=l}a.className=this.selectedClass;this.SelectedElementId=a.id;var c=$get(this.NamingContainer+"_main");var m=a.getAttribute("fullImageSource");if(m==null){m=a.src}c.src=m;c.title=a.title;this.ResizeFor(a)}}};Proto.BigPhotoModule.registerClass("Proto.BigPhotoModule",Sys.UI.Control);Proto.DetailTabControl=function(a){Proto.DetailTabControl.initializeBase(this,[a]);this.OnClickDelegate=Function.createDelegate(this,this.OnClick);$addHandler(a,"click",this.OnClickDelegate);this.NamingContainer=a.id;this.selectedElementId=a.id+"_thumb1";this.selectedClass="selected";this.unselectedClass="unselected";this.contentPrefix="prefix";this.hotKeysCreator=null;this.onFocusGainedActionsCreator=null;this.onFocusLostActionsCreator=null};Proto.DetailTabControl.prototype={initialize:function(){Proto.DetailTabControl.callBaseMethod(this,"initialize");if(this.hotKeysCreator!=null){this.hotKeys=this.hotKeysCreator();if(this.hotKeys!=null){for(var a=0;a<this.hotKeys.length;a++){var b=$get(this.NamingContainer+"_"+this.hotKeys[a].buttonId);if(b==null){b=$get(this.hotKeys[a].buttonId)}if(b!=null){$addHandler(b,"click",this.OnClickDelegate)}}}}if(null!=this.onFocusGainedActionsCreator){this.onFocusGainedActions=this.onFocusGainedActionsCreator();if(null!=this.onFocusGainedActions){for(var a=0;a<this.onFocusGainedActions.length;a++){if(""==(this.onFocusGainedActions[a].tabId)){this.onFocusGainedActions[a].tabId=this.selectedElementId}}}}if(null!=this.onFocusLostActionsCreator){this.onFocusLostActions=this.onFocusLostActionsCreator();if(null!=this.onFocusLostActions){for(var a=0;a<this.onFocusLostActions.length;a++){if(""==(this.onFocusLostActions[a].tabId)){this.onFocusLostActions[a].tabId=this.selectedElementId}}}}},OnClick:function(c){var e=c.target;if(e!=null){if(this.NamingContainer==e.id){return}if(this.hotKeys!=null){for(var d=0;d<this.hotKeys.length;d++){if(e.id.endsWith(this.hotKeys[d].buttonId)){var f=$get(this.NamingContainer+"_"+this.hotKeys[d].tabId);if(f==null){f=$get(this.hotKeys[d].tabId)}if(f!=null){e=f;break}}}}while((e!=null)&&(e.id!=null)&&(e.id!=this.selectedElementId)){if(e.id.startsWith(this.NamingContainer)){if((null!=this.onFocusLostActions)&&(null!=this.selectedElementId)){for(var d=0;d<this.onFocusLostActions.length;d++){if((this.onFocusLostActions[d].tabId==null)||this.selectedElementId.endsWith(this.onFocusLostActions[d].tabId)){this.onFocusLostActions[d].action(this.selectedElementId)}}}var a=e.id.substring(this.NamingContainer.length);var j=this.selectedElementId.substring(this.NamingContainer.length);var b=$get(this.contentPrefix+j);var h=$get(this.contentPrefix+a);if(b!=null){b.style.display="none"}if(h!=null){h.style.display="block"}var g=$get(this.selectedElementId);if(g!=null){g.className=this.unselectedClass}e.className=this.selectedClass;this.selectedElementId=e.id;if((null!=this.onFocusGainedActions)&&(null!=e)){for(var d=0;d<this.onFocusGainedActions.length;d++){if((this.onFocusGainedActions[d].tabId==null)||e.id.endsWith(this.onFocusGainedActions[d].tabId)){this.onFocusGainedActions[d].action(this.selectedElementId)}}}return}else{e=e.parentNode}}}},SetTabFocus:function(b){var e=jQuery("#tabstrip > li").attr("class",this.unselectedClass);var a=jQuery("#tabstrip_"+b).attr("class",this.selectedClass);this.selectedElementId="tabstrip_"+b;var d=jQuery("#firstColumn > div[id^='tabstripcontent_']").css("display","none");var c=jQuery("#tabstripcontent_"+b).css("display","block")},switchToEnvironmentTab:function(){this.SetTabFocus("ENVIRONMENT");switchToSmallPhotoModule()}};Proto.DetailTabControl.registerClass("Proto.DetailTabControl",Sys.UI.Control);Proto.PriceGridControl=function(a){Proto.PriceGridControl.initializeBase(this,[a]);this.OnClickDelegate=Function.createDelegate(this,this.OnClick);this.OnFocusLostDelegate=Function.createDelegate(this,this.OnFocusLost);this.OnFocusGainedDelegate=Function.createDelegate(this,this.OnFocusGained);$addHandler(a,"click",this.OnClickDelegate)};Proto.PriceGridControl.prototype={initialize:function(){Proto.PriceGridControl.callBaseMethod(this,"initialize")},OnFocusLost:function(d){var a=d.replace("pricegridtabs","priceGridDetail");var c=$get(a);if(c!=null){this.LeftScrollPosition=c.style.left}var b=d.replace("pricegridtabs","priceGridHeaderText");hide(b)},OnFocusGained:function(b){var a=b.replace("pricegridtabs","priceGridDetail");var d=$get(a);if(d!=null){d.style.left=this.LeftScrollPosition}var c=b.replace("pricegridtabs","priceGridHeaderText");show(c)},getAttributeValue:function(a,b){var c=a.attributes[b];var d=null;if(c!=null){d=c.value}return d},UpdateTransportAvailabilityForSelectedCell:function(){var b=jQuery("#startemailbooking");var c=(b.hasClass("btAction")&&b.is(":visible"));var g=(jQuery("#shouldAllowTransportBooking").val()=="1");if(g&&!c){show("transportbookingpane")}else{hide("transportbookingpane")}var e=$get("main");if(e!=null){var j=e.attributes.selectedcelldate.value;var a=e.attributes.selectedcellduration.value;var d=1;var f=$get("cell_"+d+"_"+a+"_"+j);if(f!=null){var h=(this.getAttributeValue(f,"canonlybebookedwithtransport")=="True");if(!h||this.getAttributeValue(f,"hastransport")=="1"){show("tsTransportAvailable");hide("tsNoTransportAvailable");this.updateTransportSelection(f)}else{hide("tsTransportAvailable");show("tsNoTransportAvailable")}}}},hideTransPortButtons:function(){hide("SearchWithoutTransport");hide("SearchTransportTrain");hide("SearchTransportFlight");show("SearchWithoutTransportInactive");show("SearchTransportTrainInactive");show("SearchTransportFlightInactive")},updateTransportSelection:function(a){this.hideTransPortButtons();if(this.getAttributeValue(a,"canonlybebookedwithtransport")=="False"){hide("SearchWithoutTransportInactive");show("SearchWithoutTransport")}if(this.getAttributeValue(a,"hastraintransport")=="True"){hide("SearchTransportTrainInactive");show("SearchTransportTrain")}if(this.getAttributeValue(a,"hasflighttransport")=="True"){hide("SearchTransportFlightInactive");show("SearchTransportFlight")}if(this.getAttributeValue(a,"canonlybebookedwithtransport")=="False"){jQuery("#SearchWithoutTransport_input").attr("checked","checked")}else{if(this.getAttributeValue(a,"hastraintransport")=="True"){jQuery("#SearchTransportTrain_input").attr("checked","checked")}else{if(this.getAttributeValue(a,"hasflighttransport")=="True"){jQuery("#SearchTransportFlight_input").attr("checked","checked")}}}},priceExampleTooltipInitialization:function(d){var b=document.body,e=jQuery("#priceExampleTooltip"),c=this;if(e.parent().get()!==b){e.appendTo(b)}if(!d.selectedColumn||!d.selectedRow){var a=jQuery("#main");d.selectedColumn=a.attr("selectedcelldate")||"";d.selectedRow=a.attr("selectedcellduration")||""}jQuery("#clickpricegrid").find('div[id^="pricegridcontent"]').each(function(g){var f=g+1;jQuery("#cell_"+f+"_"+d.selectedRow+"_"+d.selectedColumn).each(function(){c.bindPriceExampleTooltipToSelectedCell(this)})})},bindPriceExampleTooltipToSelectedCell:function(b){var a=jQuery(b),c=this.getPriceExampleTooltipInfo(b);a.bind("mouseenter.price-example-tooltip",c,this.showPriceExampleTooltipOnMouseEnter).bind("mouseleave.price-example-tooltip",this.hidePriceExampleTooltip)},unbindPriceExampleTooltip:function(a){jQuery(a).unbind(".price-example-tooltip")},getPriceExampleTooltipInfo:function(b){var a=jQuery(b);return{priceGridComponent:this,source:b,date:a.attr("tooltipdate")||"",duration:a.attr("tooltipduration")||"",priceAmount:a.attr("tooltippriceamount")||"",priceAmountDecimalPart:a.attr("tooltippriceamountdecimalpart")||"",referencePriceAmount:a.attr("tooltipreferencepriceamount")||"",referencePriceAmountDecimalPart:a.attr("tooltipreferencepriceamountdecimalpart")||"",priceType:a.attr("tooltippricetype")||"",showReferencePrice:a.attr("tooltipshowreferenceprice"),showRoundedPrice:a.attr("tooltipshowroundedprice")}},getTooltipTravelInfo:function(){var a=$find("clickmain");if(!a){return null}var c=this.getSelectedRoom(),d=jQuery("#pricegridcontent_"+c),b={selectedAirport:jQuery("#airportselect").find("option:selected").text()||"",adultsText:d.attr("adultstext")||"",childrenText:d.attr("childrentext")||"",numberOfAdults:d.attr("adultscount")||"",childrenCount:d.attr("childrencount")||"",boardType:jQuery("#boardtypeselect_"+c).find("option:selected").text()||"",roomIdentification:jQuery("#roomtypeselect_"+c).find("option:selected").text()||""};return b},showPriceExampleTooltip:function(l){if(!l){return}var n=jQuery("#priceExampleTooltip");n.find(".tooltip-content").hide();var b=jQuery(l.source),f=b.offset();cellHeight=b.height();n.showAsPopup({mouseX:f.left,mouseY:f.top,xOffset:-(n.width()+10),yOffset:-((n.height()/4)+(cellHeight/2))});n.find(".tooltip-content").show();var j=this.getTooltipTravelInfo();if(j===null){return}var d=j.selectedAirport||"",m="",a=n.find("p.tooltip-grijs"),k=n.find(".tooltip-price-old"),g=n.find("#tooltip-content-no-price"),e=n.find("#tooltip-content-price"),h="<br/>",c="&euro; ";if(d){d=d+", "}if(j.childrenCount==="0"){a.hide()}else{m=", "+j.childrenCount+" "+j.childrenText;a.show()}n.find("p.tooltip-last-item").html(j.numberOfAdults+" "+j.adultsText+m+h+d+l.date+h+j.roomIdentification+h+l.duration+", "+j.boardType);if(!isNaN(l.priceAmount)){n.find("span.tooltip-price-large").html(c+l.priceAmount);if(l.showRoundedPrice==="0"){n.find("span.tooltip-price-small").html(","+l.priceAmountDecimalPart)}if(l.showReferencePrice==="1"){k.html(c+l.referencePriceAmount);k.show()}else{k.hide()}g.hide();e.show()}else{k.hide();g.show();e.hide()}},showPriceExampleTooltipOnMouseEnter:function(a){var b=a.data.priceGridComponent||$find("clickpricegrid");b.showPriceExampleTooltip(jQuery.extend(a.data,{mouseX:a.pageX,mouseY:a.pageY}))},hidePriceExampleTooltip:function(a){jQuery("#priceExampleTooltip").hide()},OnClick:function(v){var C=v.target;if(C!=null){var g=this.getAttributeValue(C,"duration");var l=this.getAttributeValue(C,"date");var n=this.getAttributeValue(C,"grid");if((g==null)||(l==null)||(n==null)){return}var j=$get("main");if(j!=null){var r=this.getAttributeValue(j,"selectedcelldate");var m=this.getAttributeValue(j,"selectedcellduration");var t=1;var a=$get("pricegridcontent_"+t);while(a!=null){var b=$get("cell_"+t+"_"+m+"_"+r);var B=$get("column_"+t+"_"+r);var w=$get("row_"+t+"_"+m);if((B!=null)&&(w!=null)&(b!=null)){b.parentNode.className="price";B.className="header";jQuery(w).removeClass("selectedDuration").addClass("duration");this.unbindPriceExampleTooltip(b)}var p=$get("cell_"+t+"_"+g+"_"+l);var h=$get("column_"+t+"_"+l);var d=$get("row_"+t+"_"+g);if((h!=null)&&(d!=null)&(p!=null)){p.parentNode.className="selectedprice";h.className="selectedHeader";jQuery(d).removeClass("duration").addClass("selectedDuration");this.bindPriceExampleTooltipToSelectedCell(p);var o=this.getPriceExampleTooltipInfo(p);var z=jQuery.event.fix(v);this.showPriceExampleTooltip(jQuery.extend(o,{mouseX:z.pageX,mouseY:z.pageY}))}t=t+1;a=$get("pricegridcontent_"+t)}j.attributes.selectedcelldate.value=l;j.attributes.selectedcellduration.value=g;j.attributes.selectedcellroom.value=n;var e=$find("clickmain");if(e){e.HandlePriceTicketsCollapsing()}var c=$get("transportChoice_"+r+"_"+m);if(c!=null){c.style.display="none"}var k=(this.getAttributeValue(C,"canonlybebookedwithtransport")=="True");if(!k||this.getAttributeValue(C,"hastransport")=="1"){show("tsTransportAvailable");hide("tsNoTransportAvailable");this.updateTransportSelection(p)}else{hide("tsTransportAvailable");show("tsNoTransportAvailable")}var f=$get("transportChoice_"+l+"_"+g);var y=false;if(f!=null){f.style.display="";y=true}var q=(C.attributes.canquote==null);var x=(jQuery("#priceticket div.buttonBook").length===0&&!q);var e=$find("clickmain");if(e!=null){e.toggleBlocksVisibility(false,false)}jQuery("#foCalculatePrice").closest(".fo-controls").show();var A=$get("startemailbooking");if(A!=null){A.className="btAction";A.setAttribute("disableClick",false)}var u=$get("promocontactcenter");if(u!=null){if(C.attributes.ccpromo!=null){u.style.display=""}else{u.style.display="none"}}}}},hasRoom:function(a){var b=jQuery("#pricedgrid_tabstrip div[id='pricegridtabs_"+a+"']")[0];return b!==undefined},selectRoom:function(a){if(a<1){return}this.OnFocusLostDelegate("pricegridtabs_"+this.getSelectedRoom());jQuery("#pricedgrid_tabstrip div[id^='pricegridtabs']").each(function(b){var c=b+1;if(c===a){jQuery(this).removeClass("unselected").addClass("selected")}else{jQuery(this).removeClass("selected").addClass("unselected")}});jQuery("#pricegrid div.pricegrid-content-container div.pricegrid-details-container").each(function(b){var c=b+1;if(c===a){jQuery(this).show()}else{jQuery(this).hide()}});this.OnFocusGainedDelegate("pricegridtabs_"+a);this.updateTabControl()},getSelectedRoom:function(){var b=jQuery('#pricedgrid_tabstrip div[id^="pricegridtabs"].selected');if(b.length>0){var a=b.attr("id").replace("pricegridtabs_","");return parseInt(a,10)||1}return 1},updateTabControl:function(){var a=$find("pricegrid");if(a!=null){var b=this.getSelectedRoom();a.selectedElementId="pricegridtabs_"+b}}};Proto.PriceGridControl.registerClass("Proto.PriceGridControl",Sys.UI.Control);function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f]}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document)}if(!a&&e.getElementById){a=e.getElementById(f)}return a}function P7_HScroller(el,dr,tx,ox,spd){var g,gg,fr,sp,pa="",slw=true,m=false,w,ww,lx,rx;tx=parseInt(tx);if((g=MM_findObj(el))!=null){gg=(document.layers)?g:g.style}else{return}if(dr=="Stop"){if(g.toMove){clearTimeout(g.p7Magic)}g.toMove=false}if((parseInt(navigator.appVersion)>4||navigator.userAgent.indexOf("MSIE")>-1)&&!window.opera){pa="px"}if(navigator.userAgent.indexOf("NT")>-1||navigator.userAgent.indexOf("Windows 2000")>-1){slw=false}if(spd=="Slow"){sp=(slw)?2:1;fr=(slw)?40:30}else{if(spd=="Medium"){sp=(slw)?4:1;fr=(slw)?40:10}else{sp=(slw)?8:4;fr=(slw)?40:10}}if(spd=="Warp"){sp=5000}var xx=parseInt(gg.left);if(isNaN(xx)){if(g.currentStyle){xx=parseInt(g.currentStyle.left)}else{if(document.defaultView&&document.defaultView.getComputedStyle){xx=parseInt(document.defaultView.getComputedStyle(g,"").getPropertyValue("left"))}else{xx=0}}}if(document.all||document.getElementById){w=parseInt(g.offsetWidth);if(!w){w=parseInt(g.style.pixelWidth)}if(g.hasChildNodes){for(wx=0;wx<g.childNodes.length;wx++){ww=parseInt(g.childNodes[wx].offsetWidth);if(ww>w){w=ww}}}}else{if(document.layers){w=parseInt(g.clip.width)}}lx=tx-w+parseInt(ox);rx=tx;if(dr=="Right"){if(xx>lx){m=true;xx-=sp;if(xx<lx){xx=lx}}}if(dr=="Left"){if(xx<rx){m=true;xx+=sp;if(xx>rx){xx=rx}}}if(dr=="Reset"){gg.left=tx+pa;if(g.toMove){clearTimeout(g.p7Magic)}g.toMove=false}if(m){gg.left=xx+pa;if(g.toMove){clearTimeout(g.p7Magic)}g.toMove=true;var evalstring="g.p7Magic=setTimeout(\"P7_HScroller('"+el+"','"+dr+"',"+tx+","+ox+",'"+spd+"')\","+fr+")";eval(evalstring)}else{g.toMove=false}}function scrollDownCallBack(b){var a=$find(b);Sys.Debug.trace("Component: "+b);if(a){Sys.Debug.trace("Component found!");a.scrollDown()}else{Sys.Debug.trace("Component not found!")}}function scrollUpCallBack(b){var a=$find(b);Sys.Debug.trace("Component: "+b);if(a){Sys.Debug.trace("Component found!");a.scrollUp()}else{Sys.Debug.trace("Component found!")}}Ecom.VerticalScroll=function(a){this.scrollCursor=0;this.speed=5;this.timeoutID=0;this.div_obj=null;this.scrollPanes=null;this.element=a;this.scrollPaneCreator=null;this.scrollPanes=new Array();Ecom.VerticalScroll.initializeBase(this,[a]);this.OnMouseOverDelegate=Function.createDelegate(this,this.OnMouseOver);this.OnMouseOutDelegate=Function.createDelegate(this,this.OnMouseOut);$addHandler(a,"mouseover",this.OnMouseOverDelegate);$addHandler(a,"mouseout",this.OnMouseOutDelegate)};Ecom.VerticalScroll.prototype={initialize:function(){if(this.scrollPaneCreator){for(i=0;i<this.scrollPaneCreator().length;i++){this.scrollPanes[i]=new Object();this.scrollPanes[i].scrollPanel=this.scrollPaneCreator()[i].divName;Sys.Debug.trace(this.scrollPaneCreator()[i].divName);this.scrollPanes[i].scrollUp=this.scrollPaneCreator()[i].up;Sys.Debug.trace(this.scrollPaneCreator()[i].up);this.scrollPanes[i].scrollDown=this.scrollPaneCreator()[i].down;Sys.Debug.trace(this.scrollPaneCreator()[i].down);div_obj=$get(this.scrollPaneCreator()[i].divName);if(div_obj){this.div_obj=div_obj;this.div_obj.style.overflow="hidden"}}}},stopScroll:function(){clearTimeout(this.timeoutID)},scrollUp:function(){if(this.div_obj){this.scrollCursor=(this.scrollCursor-this.speed)<0?0:this.scrollCursor-this.speed;this.div_obj.scrollTop=this.scrollCursor;var a=this.element.id;Sys.Debug.trace("scrollUpCallBack('"+a+"')");this.timeoutID=setTimeout("scrollUpCallBack('"+a+"')",60)}},scrollDown:function(){if(this.div_obj){this.scrollCursor+=this.speed;this.div_obj.scrollTop=this.scrollCursor;if(this.div_obj.scrollTop==this.scrollCursor){var a=this.element.id;Sys.Debug.trace("scrollDownCallBack('"+a+"')");this.timeoutID=setTimeout("scrollDownCallBack('"+a+"')",60)}else{this.scrollCursor=this.div_obj.scrollTop}}},resetScroll:function(){if(this.div_obj){this.div_obj.scrollTop=0;this.scrollCursor=0}},OnMouseOver:function(a){Sys.Debug.trace("OnMouseOver: "+a.target.id);for(i=0;i<this.scrollPanes.length;i++){Sys.Debug.trace("OnMouseOver: "+this.scrollPanes[i].scrollUp);if(a.target.id==this.scrollPanes[i].scrollUp){Sys.Debug.trace("OnMouseOver found: "+this.scrollPanes[i].scrollUp);this.div_obj=$get(this.scrollPanes[i].scrollPanel);Sys.Debug.trace("OnMouseOverOver found scrollPane: "+this.scrollPanes[i].scrollPanel);if(div_obj){Sys.Debug.trace("Panel found")}else{Sys.Debug.trace("Panel not found")}this.scrollUp()}}for(i=0;i<this.scrollPanes.length;i++){Sys.Debug.trace("OnMouseOverDown: "+this.scrollPanes[i].scrollDown);if(a.target.id==this.scrollPanes[i].scrollDown){Sys.Debug.trace("OnMouseOverDown found: "+this.scrollPanes[i].scrollDown);this.div_obj=$get(this.scrollPanes[i].scrollPanel);Sys.Debug.trace("OnMouseOverDown found scrollPane: "+this.scrollPanes[i].scrollPanel);if(this.div_obj){Sys.Debug.trace("Panel found")}else{Sys.Debug.trace("Panel not found")}this.scrollDown()}}},OnMouseOut:function(a){Sys.Debug.trace("OnMouseOut: "+a.target.id);for(i=0;i<this.scrollPanes.length;i++){if((a.target.id==this.scrollPanes[i].scrollUp)||(a.target.id==this.scrollPanes[i].scrollDown)){this.div_obj=$get(this.scrollPanes[i].scrollPanel);this.stopScroll()}}}};Ecom.VerticalScroll.registerClass("Ecom.VerticalScroll",Sys.UI.Control);Proto.Updater=function(a){this.viewMarker="";Proto.Updater.initializeBase(this,[a]);this.OnChangeDelegate=Function.createDelegate(this,this.OnChange);this.OnClickDelegate=Function.createDelegate(this,this.OnClick);this.OnMouseOverDelegate=Function.createDelegate(this,this.OnMouseOver);this.OnMouseOutDelegate=Function.createDelegate(this,this.OnMouseOut);this.OnKeyPressDelegate=Function.createDelegate(this,this.OnKeyPress);this.MethodTimeoutDelegate=Function.createDelegate(this,this.MethodTimeout);this.OnFocusOutDelegate=Function.createDelegate(this,this.OnFocusOut);this.OnBlurDelegate=Function.createDelegate(this,this.OnBlur);this.GetClickedIndexDelegate=Function.createDelegate(this,this.GetClickedIndex)};Proto.Updater.prototype={RegisterEventHandler:function(g,b,k,h,c,f,l,d){if(this.WaitSpecifications==null){this.WaitSpecifications=new Array()}var e=this.WaitSpecifications[g];if(e==null){e=new Object();this.WaitSpecifications[g]=e}var j=e.events;if(j==null){j=new Array();e.events=j}var a=new Object();a.methodtocall=h;a.delegateforresult=c;a.stateretriever=f;a.showwaitmethod=l;a.hidewaitmethod=d;a.cancelevent=k;j[b]=a},ScrollElementIntoView:function(a){var b=$get(a);if(b!=null){b.scrollIntoView(true)}},ScrollIntoView:function(){this.ScrollElementIntoView(this.viewMarker)},ScrollComponentIntoView:function(a){var b=$find(a);if((b!=null)&&(b.ScrollIntoView!=null)){Sys.Debug.trace("Called ScrollComponentIntoView for componentid: "+a);b.ScrollIntoView()}},Wait:function(f,e){if(f!=null){var a=null;var h=null;var d=e?"block":"none";var g=e?"none":"block";var c=0;var b=f.wait;if(e){this.CurrentWaitSpecification=b}else{if(b==null){b=this.CurrentWaitSpecification}}if(b!=null){if(e){if(b.showwaitmethod!=null){b.showwaitmethod()}}else{if(b.hidewaitmethod!=null){b.hidewaitmethod()}}if(b.relativeShowPanels!=null){for(c=0;c<b.relativeShowPanels.length;c++){a=b.relativeShowPanels[c]+f.relativePostfix;h=$get(a);if(h!=null){h.style.display=d}}}if(b.absoluteShowPanels!=null){for(c=0;c<b.absoluteShowPanels.length;c++){a=b.absoluteShowPanels[c];h=$get(a);if(h!=null){h.style.display=d}}}if(b.relativeHidePanels!=null){for(c=0;c<b.relativeHidePanels.length;c++){a=b.relativeHidePanels[c]+f.relativePostfix;h=$get(a);if(h!=null){h.style.display=g}}}if(b.absoluteHidePanels!=null){for(c=0;c<b.absoluteHidePanels.length;c++){a=b.absoluteHidePanels[c];h=$get(a);if(h!=null){h.style.display=g}}}}}},GetClickedIndex:function(d){var c=null;if(d==null){return null}var b=d.target;if(b==null){return null}var e=b.id;if(e==null){return null}var a=e.lastIndexOf("_");if(a>=0){return e.substring(a+1)}return null},populateDropdown:function(c){if(!c||!c.select){return false}c=jQuery.extend({priceTicketModusDependent:true},c);var j=$get(c.select);if(j===null){return false}try{if(c.data&&c.data.Options&&c.data.SelectedValue){j.selectedIndex=-1;j.value=null;j.options.length=0;var p=c.data.Options,k=p.length,l=c.data.SelectedValue;for(var g=0;g<k;g++){var n=p[g],h=jQuery("<option/>").val(n.Value).text(n.Description);if(n.Value==l){h.attr("selected","selected")}h.appendTo(j)}}var q=j.options,b=(q&&q.length>0);if(c.label&&b){var o=$get(c.label);if(o===null){return}var f=(q.length==1),d=q[0];if(f){jQuery(o).text(d.text).show();jQuery(j).hide()}else{jQuery(j).show();jQuery(o).hide()}}return b}catch(m){var a=m}},ChangeSelectToMode:function(b,a,c){if(b!=null&&a!=null&&b.mode!=c){b.setAttribute("mode",c);b.style.display=(c=="readonly")?"none":"";a.style.display=(c=="readonly")?"":"none"}},FindRadioButtonValue:function(a){try{var d=a.childNodes;if(d!=null){for(var b=0;b<d.length;b++){var e=d[b];if(e.tagName=="INPUT"){if(e.type=="radio"){if(e.checked==true){return e.value}}}else{result=this.FindRadioButtonValue(e);if(result!=null){return result}}}}}catch(c){alert("FindRadioButtonValue error")}return null},GetSelectedValue:function(c){var b=$get(c);var a=b.selectedIndex;return b.options.children[a].value},UnhookChildSelects:function(a){if(a.getAttribute!=null){var e=a.getAttribute("noselects");if(e!=null){return}}if(a!=null){var d=a.getElementsByTagName("SELECT");if(d!=null){for(var c=0;c<d.length;c++){var f=d[c];try{$removeHandler(f,"change",this.OnChangeDelegate)}catch(b){}}}}},HookChildSelects:function(a){if(a.getAttribute!=null){var d=a.getAttribute("noselects");if(d!=null){return}}if(a!=null){var c=a.getElementsByTagName("SELECT");if(c!=null){for(var b=0;b<c.length;b++){var e=c[b];if(e!=null){$addHandler(e,"change",this.OnChangeDelegate)}}}}},OnPrepareContentUpdate:function(){var a=this.get_element();if(a!=null){this.UnhookChildSelects(a)}},OnContentUpdated:function(){var a=this.get_element();if(a!=null){this.HookChildSelects(a)}},DoPartialUpdate:function(o){if(o!=null){for(var l=0;l<o.length;l++){var q=o[l];var n=null;if(q.DivId!=null){n=$get(q.DivId);if(n==null){Sys.Debug.trace("Partial update div not found: "+q.DivId)}}if(n!=null){var d=q.DivOperation;if(d==0){this.UnhookChildSelects(n);var p=n.parentNode;var t=p.childNodes;for(var h=0;h<t.length;h++){var b=t[h];if(b.id==q.DivId){var u=document.createElement("div");u.innerHTML=q.DivHtml;var a=u.childNodes[0];p.replaceChild(a,b);break}}n=$get(q.DivId);this.HookChildSelects(n)}else{if(d==1){this.UnhookChildSelects(n);n.innerHTML=q.DivHtml;this.HookChildSelects(n)}else{if(d==2){var u=document.createElement("div");u.innerHTML=q.DivHtml;n.appendChild(u);this.HookChildSelects(u)}}}this.notifyTeaLeafOnDomChanges(n)}var c=q.PostOperations;if(c!=null){var g=0;for(g=0;g<c.length;g++){var f=c[g];var r=this[f];if(r!=null){try{r()}catch(m){}}}}}}},notifyTeaLeafOnDomChanges:function(a){if(a!==null){if(typeof TeaLeaf!=="undefined"&&TeaLeaf!==null){if(typeof TeaLeaf.Client!=="undefined"&&TeaLeaf.Client!==null){if(typeof TeaLeaf.Client.tlProcessNode==="function"){TeaLeaf.Client.tlProcessNode(document.body)}}}}},MethodTimeout:function(b,a){this.Wait(b,false);if(b.get_timedOut()){alert("Timeout error, please try again.")}else{if(b.get_statusCode()==0){return}else{if(b.get_statusCode()>0){if(b.get_message()!=""){this.CreateRefreshPagePopup();if(!this.ShowRefreshPagePopup()){alert(b.get_message())}}}else{alert("Unexpected error occured. (status code: "+b.get_statusCode()+")")}}}},ShowRefreshPagePopup:function(){Ecom.Application.hideWaiterBox();if(this.refreshPagePopup==null){return false}this.refreshPagePopup.show();return true},RefreshPagePopup:function(){window.location.reload()},CreateRefreshPagePopup:function(){var a={dialogClass:"option",width:350,minHeight:80};this.refreshPagePopup=new Ecom.UI.ModalBox("#refreshPagePopup",a);var b=this;jQuery("#refreshPagePopupBtn").click(function(){b.RefreshPagePopup()})},HandleEvent:function(a,b){var g=a.target;var f=this.FindWaitSpecificationInstance(g,b);if(f!=null){var e=f.wait;if(e!=null){var d=false;var c=g.attributes.disableClick;if(c!=null){d=Boolean.parse(c.value)}if(!d){var h=null;if(e.stateretriever!=null){h=e.stateretriever(a,b)}this.Wait(f,true);if(e.methodtocall!=null){e.methodtocall(g.id,b,h,e.delegateforresult,this.MethodTimeoutDelegate,f)}var j=e.cancelevent;if(j){a.preventDefault()}return true}}}return true},FindWaitSpecificationInstance:function(g,a){if(g==null){return null}var d=g.id.indexOf("_");var h="";if(d>=0){h=g.id.substring(0,d)}else{h=g.id}var f=null;if(this.WaitSpecifications==null){return null}var e=this.WaitSpecifications[h];if(e!=null){for(var b in e.events){if(b==a){f=new Object();f.wait=e.events[b];if(d>=0){var j=g.id.substring(d+1);var c=j.indexOf("_");if(c>=0){j=j.substring(0,c)}f.relativePostfix=j}break}}}return f},OnChange:function(a){return this.HandleEvent(a,"change")},OnClick:function(a){return this.HandleEvent(a,"click")},OnMouseOver:function(a){return this.HandleEvent(a,"mouseover")},OnMouseOut:function(a){return this.HandleEvent(a,"mouseout")},OnKeyPress:function(a){return this.HandleEvent(a,"keypress")},OnFocusOut:function(a){return this.HandleEvent(a,"focusout")},OnBlur:function(a){return this.HandleEvent(a,"blur")},UpdateMandatoryFieldIndicator:function(b,a){if(b!=null){if(b.value==""){Sys.UI.DomElement.addCssClass(b,a)}else{Sys.UI.DomElement.removeCssClass(b,a)}}},UpdateInvalidValueIndicator:function(c,a,b){if(null!=c){if(a){Sys.UI.DomElement.addCssClass(c,b)}else{Sys.UI.DomElement.removeCssClass(c,b)}}},Show:function(){show(this.get_element().id)},ShowParentComponent:function(a){while(a!=null){if(a.getAttribute("name")=="Component"){a.style.display="";return}a=a.parentNode}},HideParentComponent:function(a){while(a!=null){if(a.getAttribute("name")=="Component"){a.style.display="none";return}a=a.parentNode}},Hide:function(){hide(this.get_element().id)},UpdateValidFieldIndicator:function(c,b,a){if(c!=null){if(a){Sys.UI.DomElement.removeCssClass(c,b)}else{Sys.UI.DomElement.addCssClass(c,b)}}}};Proto.Updater.registerClass("Proto.Updater",Sys.UI.Control);Ecom.Omniture=function(a){Ecom.Omniture.initializeBase(this,[a])};Ecom.Omniture.prototype={initialize:function(){Ecom.Omniture.callBaseMethod(this,"initialize")},dispose:function(){Ecom.Omniture.callBaseMethod(this,"dispose")},DoPartialUpdate:function(a){alert("unexpected error")},DoPartialUpdateWithOmnitureLogging:function(a){if(a!=null){Ecom.Omniture.callBaseMethod(this,"DoPartialUpdate",[a.divUpdates]);var b=a.OmnitureLogging;if(b!=null){this.DoOmnitureCall(b)}}},DoOmnitureCall:function(a){if(a.tabName!=null){omnitureVar_TabName=a.tabName}if(a.fhFacets!=null){omnitureVar_fhFacets=a.fhFacets}if(a.products!=null){s.products=a.products}if(a.events!=null){s.events=a.events}if(a.eVar[1]!=null){s.eVar1=a.eVar[1]}if(a.eVar[2]!=null){s.eVar2=a.eVar[2]}if(a.eVar[3]!=null){s.eVar3=a.eVar[3]}if(a.eVar[4]!=null){s.eVar4=a.eVar[4]}if(a.eVar[5]!=null){s.eVar5=a.eVar[5]}if(a.eVar[6]!=null){s.eVar6=a.eVar[6]}if(a.eVar[7]!=null){s.eVar7=a.eVar[7]}if(a.eVar[8]!=null){s.eVar8=a.eVar[8]}if(a.eVar[9]!=null){s.eVar9=a.eVar[9]}if(a.eVar[10]!=null){s.eVar10=a.eVar[10]}if(a.eVar[11]!=null){s.eVar11=a.eVar[11]}if(a.eVar[12]!=null){s.eVar12=a.eVar[12]}if(a.eVar[13]!=null){s.eVar13=a.eVar[13]}if(a.eVar[14]!=null){s.eVar14=a.eVar[14]}if(a.eVar[15]!=null){s.eVar15=a.eVar[15]}if(a.eVar[16]!=null){s.eVar16=a.eVar[16]}if(a.eVar[17]!=null){s.eVar17=a.eVar[17]}if(a.eVar[18]!=null){s.eVar18=a.eVar[18]}if(a.eVar[19]!=null){s.eVar19=a.eVar[19]}if(a.eVar[20]!=null){s.eVar20=a.eVar[20]}if(a.eVar[21]!=null){s.eVar21=a.eVar[21]}if(a.eVar[22]!=null){s.eVar22=a.eVar[22]}if(a.eVar[23]!=null){s.eVar23=a.eVar[23]}if(a.eVar[24]!=null){s.eVar24=a.eVar[24]}if(a.eVar[25]!=null){s.eVar25=a.eVar[25]}if(a.eVar[26]!=null){s.eVar26=a.eVar[26]}if(a.eVar[27]!=null){s.eVar27=a.eVar[27]}if(a.eVar[28]!=null){s.eVar28=a.eVar[28]}if(a.eVar[29]!=null){s.eVar29=a.eVar[29]}if(a.eVar[30]!=null){s.eVar30=a.eVar[30]}if(a.eVar[31]!=null){s.eVar31=a.eVar[31]}if(a.eVar[32]!=null){s.eVar32=a.eVar[32]}if(a.eVar[33]!=null){s.eVar33=a.eVar[33]}if(a.eVar[34]!=null){s.eVar34=a.eVar[34]}if(a.eVar[35]!=null){s.eVar35=a.eVar[35]}if(a.eVar[36]!=null){s.eVar36=a.eVar[36]}if(a.eVar[37]!=null){s.eVar37=a.eVar[37]}if(a.eVar[38]!=null){s.eVar38=a.eVar[38]}if(a.eVar[39]!=null){s.eVar39=a.eVar[39]}if(a.eVar[40]!=null){s.eVar40=a.eVar[40]}if(a.eVar[41]!=null){s.eVar41=a.eVar[41]}if(a.eVar[42]!=null){s.eVar42=a.eVar[42]}if(a.eVar[43]!=null){s.eVar43=a.eVar[43]}if(a.eVar[44]!=null){s.eVar44=a.eVar[44]}if(a.eVar[45]!=null){s.eVar45=a.eVar[45]}if(a.eVar[46]!=null){s.eVar46=a.eVar[46]}if(a.eVar[47]!=null){s.eVar47=a.eVar[47]}if(a.eVar[48]!=null){s.eVar48=a.eVar[48]}if(a.eVar[49]!=null){s.eVar49=a.eVar[49]}if(a.eVar[50]!=null){s.eVar50=a.eVar[50]}if(a.eVar[51]!=null){s.eVar51=a.eVar[51]}if(a.eVar[52]!=null){s.eVar52=a.eVar[52]}if(a.eVar[53]!=null){s.eVar53=a.eVar[53]}if(a.eVar[54]!=null){s.eVar54=a.eVar[54]}if(a.eVar[55]!=null){s.eVar55=a.eVar[55]}if(a.eVar[56]!=null){s.eVar56=a.eVar[56]}if(a.eVar[57]!=null){s.eVar57=a.eVar[57]}if(a.eVar[58]!=null){s.eVar58=a.eVar[58]}if(a.eVar[59]!=null){s.eVar59=a.eVar[59]}if(a.prop[1]!=null){s.prop1=a.prop[1]}if(a.prop[2]!=null){s.prop2=a.prop[2]}if(a.prop[3]!=null){s.prop3=a.prop[3]}if(a.prop[4]!=null){s.prop4=a.prop[4]}if(a.prop[5]!=null){s.prop5=a.prop[5]}if(a.prop[6]!=null){s.prop6=a.prop[6]}if(a.prop[7]!=null){s.prop7=a.prop[7]}if(a.prop[8]!=null){s.prop8=a.prop[8]}if(a.prop[9]!=null){s.prop9=a.prop[9]}if(a.prop[10]!=null){s.prop10=a.prop[10]}if(a.prop[11]!=null){s.prop11=a.prop[11]}if(a.prop[12]!=null){s.prop12=a.prop[12]}if(a.prop[13]!=null){s.prop13=a.prop[13]}if(a.prop[14]!=null){s.prop14=a.prop[14]}if(a.prop[15]!=null){s.prop15=a.prop[15]}if(a.prop[16]!=null){s.prop16=a.prop[16]}if(a.prop[17]!=null){s.prop17=a.prop[17]}if(a.prop[18]!=null){s.prop18=a.prop[18]}if(a.prop[19]!=null){s.prop19=a.prop[19]}if(a.prop[20]!=null){s.prop20=a.prop[20]}if(a.prop[21]!=null){s.prop21=a.prop[21]}if(a.prop[22]!=null){s.prop22=a.prop[22]}if(a.prop[23]!=null){s.prop23=a.prop[23]}if(a.prop[24]!=null){s.prop24=a.prop[24]}if(a.prop[25]!=null){s.prop25=a.prop[25]}if(a.prop[26]!=null){s.prop26=a.prop[26]}if(a.prop[27]!=null){s.prop27=a.prop[27]}if(a.prop[28]!=null){s.prop28=a.prop[28]}if(a.prop[29]!=null){s.prop29=a.prop[29]}if(a.prop[30]!=null){s.prop30=a.prop[30]}launchOmnitureLogging(true)}};Ecom.Omniture.registerClass("Ecom.Omniture",Proto.Updater);var omnitureVar_TabName="";var omnitureVar_PageType="";var omnitureVar_ChannelName="";var omnitureVar_Sccid="";var omnitureVar_Sccl="";var omnitureVar_Scip="";var omnitureVar_Sipm="";var omnitureVar_fhFacets="";function appendStrings(a,b){if(a!=""&&b!=""){a+=":"}return a+b}function appendAllOmnitureFacets(){var a="";a=appendStrings(a,omnitureVar_PageType);a=appendStrings(a,omnitureVar_ChannelName);a=appendStrings(a,omnitureVar_fhFacets);return a}Ecom.OmnitureMonitor=function(a){Ecom.OmnitureMonitor.initializeBase(this,[a])};Ecom.OmnitureMonitor.prototype={initialize:function(){},AddTraceLine:function(b,a,c){if((c!=null)&&(c!="")){b+=a+" = "+c+"\n"}return b},TraceOmnitureLogging:function(){var a="";a=this.AddTraceLine(a,"s.pageName",s.pageName);a=this.AddTraceLine(a,"s.channel",s.channel);a=this.AddTraceLine(a,"s.products",s.products);a=this.AddTraceLine(a,"s.events",s.events);a=this.AddTraceLine(a,"s.prop1",s.prop1);a=this.AddTraceLine(a,"s.prop2",s.prop2);a=this.AddTraceLine(a,"s.prop3",s.prop3);a=this.AddTraceLine(a,"s.prop4",s.prop4);a=this.AddTraceLine(a,"s.prop5",s.prop5);a=this.AddTraceLine(a,"s.prop6",s.prop6);a=this.AddTraceLine(a,"s.prop7",s.prop7);a=this.AddTraceLine(a,"s.prop8",s.prop8);a=this.AddTraceLine(a,"s.prop9",s.prop9);a=this.AddTraceLine(a,"s.prop10",s.prop10);a=this.AddTraceLine(a,"s.prop11",s.prop11);a=this.AddTraceLine(a,"s.prop12",s.prop12);a=this.AddTraceLine(a,"s.prop13",s.prop13);a=this.AddTraceLine(a,"s.prop14",s.prop14);a=this.AddTraceLine(a,"s.prop15",s.prop15);a=this.AddTraceLine(a,"s.prop16",s.prop16);a=this.AddTraceLine(a,"s.prop17",s.prop17);a=this.AddTraceLine(a,"s.prop18",s.prop18);a=this.AddTraceLine(a,"s.prop19",s.prop19);a=this.AddTraceLine(a,"s.prop20",s.prop20);a=this.AddTraceLine(a,"s.prop21",s.prop21);a=this.AddTraceLine(a,"s.prop22",s.prop22);a=this.AddTraceLine(a,"s.prop23",s.prop23);a=this.AddTraceLine(a,"s.prop24",s.prop24);a=this.AddTraceLine(a,"s.prop25",s.prop25);a=this.AddTraceLine(a,"s.prop26",s.prop26);a=this.AddTraceLine(a,"s.prop27",s.prop27);a=this.AddTraceLine(a,"s.prop28",s.prop28);a=this.AddTraceLine(a,"s.prop29",s.prop29);a=this.AddTraceLine(a,"s.eVar1",s.eVar1);a=this.AddTraceLine(a,"s.eVar2",s.eVar2);a=this.AddTraceLine(a,"s.eVar3",s.eVar3);a=this.AddTraceLine(a,"s.eVar4",s.eVar4);a=this.AddTraceLine(a,"s.eVar5",s.eVar5);a=this.AddTraceLine(a,"s.eVar6",s.eVar6);a=this.AddTraceLine(a,"s.eVar7",s.eVar7);a=this.AddTraceLine(a,"s.eVar8",s.eVar8);a=this.AddTraceLine(a,"s.eVar9",s.eVar9);a=this.AddTraceLine(a,"s.eVar10",s.eVar10);a=this.AddTraceLine(a,"s.eVar11",s.eVar11);a=this.AddTraceLine(a,"s.eVar12",s.eVar12);a=this.AddTraceLine(a,"s.eVar13",s.eVar13);a=this.AddTraceLine(a,"s.eVar14",s.eVar14);a=this.AddTraceLine(a,"s.eVar15",s.eVar15);a=this.AddTraceLine(a,"s.eVar16",s.eVar16);a=this.AddTraceLine(a,"s.eVar17",s.eVar17);a=this.AddTraceLine(a,"s.eVar18",s.eVar18);a=this.AddTraceLine(a,"s.eVar19",s.eVar19);a=this.AddTraceLine(a,"s.eVar20",s.eVar20);a=this.AddTraceLine(a,"s.eVar21",s.eVar21);a=this.AddTraceLine(a,"s.eVar22",s.eVar22);a=this.AddTraceLine(a,"s.eVar23",s.eVar23);a=this.AddTraceLine(a,"s.eVar24",s.eVar24);a=this.AddTraceLine(a,"s.eVar25",s.eVar25);a=this.AddTraceLine(a,"s.eVar26",s.eVar26);a=this.AddTraceLine(a,"s.eVar27",s.eVar27);a=this.AddTraceLine(a,"s.eVar28",s.eVar28);a=this.AddTraceLine(a,"s.eVar29",s.eVar29);a=this.AddTraceLine(a,"s.eVar30",s.eVar30);a=this.AddTraceLine(a,"s.eVar31",s.eVar31);a=this.AddTraceLine(a,"s.eVar32",s.eVar32);a=this.AddTraceLine(a,"s.eVar33",s.eVar33);a=this.AddTraceLine(a,"s.eVar34",s.eVar34);a=this.AddTraceLine(a,"s.eVar35",s.eVar35);a=this.AddTraceLine(a,"s.eVar36",s.eVar36);a=this.AddTraceLine(a,"s.eVar37",s.eVar37);a=this.AddTraceLine(a,"s.eVar38",s.eVar38);a=this.AddTraceLine(a,"s.eVar39",s.eVar39);a=this.AddTraceLine(a,"s.eVar40",s.eVar40);a=this.AddTraceLine(a,"s.eVar41",s.eVar41);a=this.AddTraceLine(a,"s.eVar42",s.eVar42);a=this.AddTraceLine(a,"s.eVar43",s.eVar43);a=this.AddTraceLine(a,"s.eVar44",s.eVar44);a=this.AddTraceLine(a,"s.eVar45",s.eVar45);a=this.AddTraceLine(a,"s.eVar46",s.eVar46);a=this.AddTraceLine(a,"s.eVar47",s.eVar47);a=this.AddTraceLine(a,"s.eVar48",s.eVar48);a=this.AddTraceLine(a,"s.eVar49",s.eVar49);a=this.AddTraceLine(a,"s.eVar50",s.eVar50);a=this.AddTraceLine(a,"s.eVar51",s.eVar41);a=this.AddTraceLine(a,"s.eVar52",s.eVar42);a=this.AddTraceLine(a,"s.eVar53",s.eVar43);a=this.AddTraceLine(a,"s.eVar54",s.eVar44);a=this.AddTraceLine(a,"s.eVar55",s.eVar45);a=this.AddTraceLine(a,"s.eVar56",s.eVar46);a=this.AddTraceLine(a,"s.eVar57",s.eVar47);a=this.AddTraceLine(a,"s.eVar58",s.eVar48);a=this.AddTraceLine(a,"s.eVar59",s.eVar49);alert(a)}};Ecom.OmnitureMonitor.registerClass("Ecom.OmnitureMonitor");function TraceOmnitureLogging(){var a=new Ecom.OmnitureMonitor();a.TraceOmnitureLogging()}Ecom.OmnitureEventSuite=function(a){Ecom.OmnitureEventSuite.initializeBase(this,[a]);this.bookingTravellersEvents={};this.bookingTravellersEvents.omnitureEvent_BookingImportantTravelInfo=this.Booking_ImportantTravelInfo_OnClick;this.bookingTravellersEvents.omnitureEvent_BookingRoomOccupationError=this.Booking_RoomOccupationError_OnClick;this.bookingOptionsAndExtrasEvents={};this.bookingOptionsAndExtrasEvents.omnitureEvent_BookingTermAndConditions=this.Booking_InsurancesTermsAndConditionsUrl_OnClick;this.bookingPaymentEvents={};this.bookingPaymentEvents.omnitureEvent_BookingTravelConditions=this.Booking_TravelConditionsUrl_OnClick;this.bookingPaymentEvents.omnitureEvent_BookingPrivacy=this.Booking_PrivacyUrl_OnClick;this.bookingPaymentEvents.omnitureEvent_BookingUseVoucher=this.Booking_UseVoucher_OnClick;this.bookingPaymentEvents.omnitureEvent_BookingPaymentAgreed=this.Booking_PaymentAgreed_OnClick;this.detailPageBestPriceFinderEvents={};this.detailPageBestPriceFinderEvents.omnitureEvent_BestPriceFinderShow=this.BestPriceFinderShow_OnClick;this.detailPageBestPriceFinderEvents.omnitureEvent_BestPriceFinderClose=this.BestPriceFinderClose_OnClick;this.detailPageBestPriceFinderEvents.omnitureEvent_BestPriceFinderResultSelected=this.BestPriceFinderResultSelected_OnClick;this.detailPageSendDetailPageByEmailEvents={};this.detailPageSendDetailPageByEmailEvents.omnitureEvent_SendDetailPageByEmailClick=this.SendDetailPageByEmail_OnClick;this.detailPageSendDetailPageByEmailEvents.omnitureEvent_SendDetailPageByEmailSent=this.SendDetailPageByEmail_EmailSent};Ecom.OmnitureEventSuite.prototype={initialize:function(){},AddEvents:function(){this.AddEventArray(this.bookingTravellersEvents);this.AddEventArray(this.bookingOptionsAndExtrasEvents);this.AddEventArray(this.bookingPaymentEvents);this.AddEventArray(this.detailPageBestPriceFinderEvents);this.AddEventArray(this.detailPageSendDetailPageByEmailEvents)},AddEventArray:function(a){for(current in a){if(a.hasOwnProperty(current)){jQuery("."+current).live("click",a[current])}}},Booking_ImportantTravelInfo_OnClick:function(){s.prop3="Boeking:Reizigers:BelangrijkeReisinformatie";launchOmnitureLogging(true)},Booking_RoomOccupationError_OnClick:function(){s.prop3="Boeking:Reizigers:LeeftijdEnGeboortedatum";launchOmnitureLogging(true)},Booking_InsurancesTermsAndConditionsUrl_OnClick:function(){s.prop3="Boeking:OptiesEnExtras:Verzekeringsvoorwaarden";launchOmnitureLogging(true)},Booking_TravelConditionsUrl_OnClick:function(){s.prop3="Boeking:Betaling:Reisvoorwaarden";launchOmnitureLogging(true)},Booking_PrivacyUrl_OnClick:function(){s.prop3="Boeking:Betaling:Privacy";launchOmnitureLogging(true)},Booking_UseVoucher_OnClick:function(){s.prop3="Boeking:Betaling:CheckVoucher";launchOmnitureLogging(true)},Booking_PaymentAgreed_OnClick:function(){s.prop3="Boeking:Betaling:ReisvoorwaardenVoorAkkoord";launchOmnitureLogging(true)},Booking_TravellersSubmit_InvalidData:function(){s.prop3="Boeking:Reizigers:OngeldigeGegevens";launchOmnitureLogging(true)},Booking_AddressInfoSubmit_InvalidData:function(){s.prop3="Boeking:Personalia:OngeldigeGegevens";launchOmnitureLogging(true)},BestPriceFinderShow_OnClick:function(){s.prop3="Detail:BestePrijsZoeker:Openen";launchOmnitureLogging(true)},BestPriceFinderClose_OnClick:function(){s.prop3="Detail:BestePrijsZoeker:Sluiten";launchOmnitureLogging(true)},BestPriceFinderResultSelected_OnClick:function(){s.prop3="Detail:BestePrijsZoeker:Selecteren";launchOmnitureLogging(true)},SendDetailPageByEmail_OnClick:function(){s.prop3="Detail:SendDetailPageByEmail:MailDoor";launchOmnitureLogging(true)},SendDetailPageByEmail_EmailSent:function(){s.prop3="Detail:SendDetailPageByEmail:EmailVerstuurd";launchOmnitureLogging(true)}};Ecom.OmnitureEventSuite.registerClass("Ecom.OmnitureEventSuite");var omnitureEventSuite=null;function GetOmnitureEventSuite(){if(omnitureEventSuite===null){omnitureEventSuite=new Ecom.OmnitureEventSuite()}return omnitureEventSuite}Ecom.UpdaterWithWaitHeader=function(a){this.ShowHeaderWaitPanelDelegate=Function.createDelegate(this,this.ShowHeaderWaitPanel);this.HideHeaderWaitPanelDelegate=Function.createDelegate(this,this.HideHeaderWaitPanel);Ecom.UpdaterWithWaitHeader.initializeBase(this,[a])};Ecom.UpdaterWithWaitHeader.prototype={initialize:function(){Ecom.UpdaterWithWaitHeader.callBaseMethod(this,"initialize")},ShowHeaderWaitPanel:function(){Ecom.Application.showWaiterBox()},HideHeaderWaitPanel:function(){Ecom.Application.hideWaiterBox()}};Ecom.UpdaterWithWaitHeader.registerClass("Ecom.UpdaterWithWaitHeader",Proto.Updater);Ecom.SimplePromotionComponent=function(a){Ecom.SimplePromotionComponent.initializeBase(this,[a]);this.NamingContainer="";this.OnPromoClickDelegate=Function.createDelegate(this,this.OnPromoClick);this.RegisterEventHandler("promoClick","click",false,this.OnPromoClickDelegate,null,null,null,null);$addHandler(a,"click",this.OnClickDelegate)};Ecom.SimplePromotionComponent.prototype={initialize:function(){},OnPromoClick:function(c){var b=$get(c);if(b!=null){do{var a=b.getAttribute("url");if(a!=null&&a.length>0){document.location.href=a;return true}b=b.parentNode}while(b!=null)}return true}};Ecom.SimplePromotionComponent.registerClass("Ecom.SimplePromotionComponent",Proto.Updater);Proto.DateControl=function(a){this.namingContainer=a.id+"_";Proto.DateControl.initializeBase(this,[a]);this.OnYearChangeDelegate=Function.createDelegate(this,this.OnYearChange);this.OnMonthChangeDelegate=Function.createDelegate(this,this.OnMonthChange);this.OnDaysBlurDelegate=Function.createDelegate(this,this.ValidateDaySelection);this.OnMonthsBlurDelegate=Function.createDelegate(this,this.ValidateMonthSelection);this.OnYearsBlurDelegate=Function.createDelegate(this,this.ValidateYearSelection);this.days=$get(this.namingContainer+"days");$addHandler(this.days,"blur",this.OnDaysBlurDelegate);this.months=$get(this.namingContainer+"months");$addHandler(this.months,"change",this.OnMonthChangeDelegate);$addHandler(this.months,"blur",this.OnMonthsBlurDelegate);this.years=$get(this.namingContainer+"years");$addHandler(this.years,"change",this.OnYearChangeDelegate);$addHandler(this.years,"blur",this.OnYearsBlurDelegate);this.hasBlankDefault=false;this.supportsSingleFieldValidation=false;this.minAge=0};Proto.DateControl.prototype={initialize:function(){var a=new Date().getFullYear();a-=this.minAge;this.FillYears(a);this.FillMonths();this.FillDays()},AddDefault:function(e,b){if(null!=e){var a=e.length;for(index=e.length;index>0;index--){var c=index-1;var f=e[c].text;var d=e[c].value;e[index]=new Option(f,d)}if(null==b){e[0]=new Option("","")}else{e[0]=b}e.value=0}},FillBlankDefaults:function(){if(this.hasBlankDefault){this.AddDefault(this.years);this.AddDefault(this.months);this.AddDefault(this.days)}},GetBaseCounterValue:function(){if(this.hasBlankDefault){return 1}return 0},FillYears:function(b){var c;var a=this.GetBaseCounterValue();for(c=b;c>b-100;c--){var d=new Option(c,c);this.years.options[a]=d;a++}},FillMonths:function(){var b;var a=this.GetBaseCounterValue();for(b=1;b<=12;b++){var c=new Option(b,b);this.months.options[a]=c;a++}},FillDays:function(){var b;var a=this.GetBaseCounterValue();for(b=1;b<=31;b++){var c=new Option(b,b);this.days.options[a]=c;a++}},RemoveBlankDefault:function(a){if(this.hasBlankDefault&&(null!=a)){a.remove(0)}},IsValidDate:function(){if(this.hasBlankDefault){return this.IsDaySelected()&&this.IsMonthSelected()&&this.IsYearSelected()}return true},IsDaySelected:function(){return((null!=this.days)&&(null!=this.days.value)&&(""!=this.days.value)&&("0"!=this.days.value))},IsMonthSelected:function(){return((null!=this.months)&&(null!=this.months.value)&&(""!=this.months.value)&&("0"!=this.months.value))},IsYearSelected:function(){return((null!=this.years)&&(null!=this.years.value)&&(""!=this.years.value)&&("0"!=this.years.value))},Validate:function(){this.UpdateMandatoryFieldIndicator(this.days,"invalid");this.UpdateMandatoryFieldIndicator(this.months,"invalid");this.UpdateMandatoryFieldIndicator(this.years,"invalid")},ValidateDaySelection:function(){if(this.supportsSingleFieldValidation){this.UpdateMandatoryFieldIndicator(this.days,"invalid")}},ValidateMonthSelection:function(){if(this.supportsSingleFieldValidation){this.UpdateMandatoryFieldIndicator(this.months,"invalid")}},ValidateYearSelection:function(){if(this.supportsSingleFieldValidation){this.UpdateMandatoryFieldIndicator(this.years,"invalid")}},ToString:function(){return this.days.value+"/"+this.months.value+"/"+this.years.value},AdaptDays:function(){var a=this.days.value;this.RemoveBlankDefault(this.days);var e=31;var c=this.years.value;var d=this.months.value;if(d==2){if(this.IsLeapYear(c)){e=29}else{e=28}}if((d==4)||(d==6)||(d==9)||(d==11)){e=30}if(a>e){a=e}var b;var f=this.days.options.length;if(f>e){this.days.options.length=e}if(f<e){for(b=f+1;b<=e;b++){this.days.options[b-1]=new Option(b,b)}}this.AddDefault(this.days);this.days.value=a},OnYearChange:function(){this.AdaptDays()},OnMonthChange:function(){this.AdaptDays()},IsLeapYear:function(a){if(((a%4==0)&&(a%100!=0))||(a%400==0)){return true}else{return false}},SetDate:function(b,c,a){this.years.value=b;this.OnYearChange();this.months.value=c;this.OnMonthChange();this.days.value=a}};Proto.DateControl.registerClass("Proto.DateControl",Proto.Updater);Type.registerNamespace("Ecom.Detail");Type.registerNamespace("Ecom.Zoover");Ecom.Detail.CommonDetailComponent=function(){this.parentComponent=null;Ecom.Detail.CommonDetailComponent.initializeBase(this)};Ecom.Detail.CommonDetailComponent.prototype={initialize:function(){},setParentComponent:function(a){this.parentComponent=a;this.SendDetailPageByEmailDelegate=Function.createDelegate(this,this.SendDetailPageByEmail);this.OnDetailPageByEmailSentDelegate=Function.createDelegate(this,this.OnDetailPageByEmailSent);this.OnStorePackageInProfileDelegate=Function.createDelegate(this,this.OnStorePackageInProfile);this.LoginAndStorePackageDelegate=Function.createDelegate(this,this.LoginAndStorePackage);this.parentComponent.RegisterEventHandler("sendDetailPageByEmailButton","click",false,this.SendDetailPageByEmailDelegate,this.OnDetailPageByEmailSentDelegate,this.parentComponent.GetCurrentTravelInfoDelegate,null,null);this.parentComponent.RegisterEventHandler("storePackage","click",true,ThomasCook.Ecom.Web.Personalization.StorePackageInProfile,this.OnStorePackageInProfileDelegate,null,this.parentComponent.ShowWaitPanelDelegate,this.parentComponent.HideWaitPanelDelegate);this.parentComponent.RegisterEventHandler("loginAndStorePackage","click",true,this.LoginAndStorePackageDelegate,this.OnStorePackageInProfileDelegate,null,null,null)},SendDetailPageByEmail:function(a,h,d,c,k,e){Sys.Debug.trace("SendDetailPageByEmail");var b=this.parentComponent.GetCurrentTravelInfo();var j=$get("emailInput");b.SendDetailPageTo=j.value;b.EmailComments=$get("commentsText").value;var g="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";if(b.SendDetailPageTo!=""&&b.SendDetailPageTo.toLowerCase().match(g)==b.SendDetailPageTo.toLowerCase()){var e=this.parentComponent.FindWaitSpecificationInstance($get("sendDetailPageByEmailButton"),"click");ThomasCook.Ecom.Web.BookingAvailability.SendDetailPageByEmail(null,null,b,c,k,e);$get("emailInputDiv").style.display="none"}else{var f=jQuery("#sendDetailPageEmailWarning").text();alert(f)}},OnDetailPageByEmailSent:function(){var a=jQuery("#sendDetailPageSucceeded").text();GetOmnitureEventSuite().SendDetailPageByEmail_EmailSent();alert(a)},LoginAndStorePackage:function(h,f,g,d,a,e){var c=$find("loginpopupcomponentmain");if(c!=null){c.RememberProductToStore(h,f,g,d,a,e)}var b=$find("loginpopupcomponentmodaldialog");if(b!=null){b.Show()}},OnStorePackageInProfile:function(a){if(a=="Succeeded"){show("storedPackagePanel");hide("storePackagePanel")}else{var b=$find("header");if(b!=null){b.ShowError(a)}else{alert(a)}}this.parentComponent.HideWaitPanel()}};Ecom.Detail.CommonDetailComponent.registerClass("Ecom.Detail.CommonDetailComponent",Sys.Component);Ecom.Detail.BestPriceFinder=function(a){this.model={preferences:{},results:{}};this.dialog=null;this.roomTypeInfoPopup=null;this.earliestDeparture=null;this.latestReturn=null;this.preferencesTemplate=null;this.resultsTemplate=null;this._detailPageController=null;this._fixHeightsDelegate=null;Ecom.Detail.BestPriceFinder.initializeBase(this,[a])};Ecom.Detail.BestPriceFinder.prototype={initialize:function(){var d={toBeDisabledId:"entiredetailcontent",toCloseId:"dummy",width:955,height:450,backgroundColor:"#000"};this.dialog=$create(Ecom.ModalDialog,d,null,null,$get("bestPriceFinderDialogBox"));this._fixHeightsDelegate=Function.createDelegate(this,this._fixHeights);Sys.Application.add_load(Function.createDelegate(this,this._onDocumentLoad));var a=Function.createDelegate(this,this.getUserPreferences);var b=Function.createDelegate(this,this._showWaitPanel);var c=Function.createDelegate(this,this._hideWaitPanel);$addHandler($get("findBestPrice"),"click",Function.createDelegate(this,this._onFindBestPriceClick));this.RegisterEventHandler("findBestPrice","dummy",false,ThomasCook.Ecom.Web.BookingAvailability.FindBestPriceData,Function.createDelegate(this,this._onFindBestPriceCompleted),a,b,c);this.RegisterEventHandler("closeBestPriceFinder","click",false,ThomasCook.Ecom.Web.BookingAvailability.UpdateSearchBrowseUserData,Function.createDelegate(this,this.close),a,b,c);this.RegisterEventHandler("bestPriceResultItem","click",false,ThomasCook.Ecom.Web.BookingAvailability.GetInitialInfoForHoliday,Function.createDelegate(this,this._onResultSelected),Function.createDelegate(this,this._getTravelInfoForSelectedResult),b,c);$addHandler(this.get_element(),"click",this.OnClickDelegate);jQuery("#bestPriceOptionsPlaceholder #bestPriceRoomTypeInfoButton").live("click",Function.createDelegate(this,this._showRoomTypesInfoPopup));Ecom.Detail.BestPriceFinder.callBaseMethod(this,"initialize")},dispose:function(){},show:function(){if(this.dialog!=null){this.model.preferences.SelectedDuration=this._getSelectedDuration(true);this._populate("options");this.earliestDeparture.selectDate(this.initialDepartureDate,true);this.latestReturn.selectDate(this.initialReturnDate,true);this._updateRangesAndSelectedDates();this.dialog.Show()}},close:function(){if(this.dialog!=null){this.dialog.Close()}this._hideWaitPanel()},getUserPreferences:function(){this.update();var a=new ThomasCook.Ecom.Core.PageComponents.Data.CommonView.DetailPage.BestPriceUserSelection();jQuery.extend(a,this.model.preferences);a.__type="ThomasCook.Ecom.Core.PageComponents.Data.CommonView.DetailPage.BestPriceUserSelection";a.PageKey=jQuery("#main").attr("pageKey");a.Language=jQuery("#main").attr("languageISO");return a},update:function(c){if(arguments.length>0&&c){if(c.preferences){jQuery.extend(this.model.preferences,c.preferences);this.initialDepartureDate=Date.parseInvariant(this.model.preferences.EarliestDepartureDateString,"yyyyMMdd");this.initialReturnDate=Date.parseInvariant(this.model.preferences.LatestReturnDateString,"yyyyMMdd");this.seasonEndDate=Date.parseInvariant(this.model.preferences.SeasonEndDateString,"yyyyMMdd")}if(c.isInitialUpdate){if(c.initialAirports){var a=this._extendSelectionInfo(c.initialAirports).toAirports();this.model.preferences.Airports=this._mergeWithUserPrefs(a,this.model.preferences.Airports)}}if(c.initialDurations){this.model.preferences.Durations=this._extendSelectionInfo(c.initialDurations).toDurations()}if(c.results){jQuery.extend(this.model.results,c.results)}}else{var a=this.model.preferences.Airports;var b=a.length;for(var g=0;g<b;g++){a[g].Checked=jQuery("#bestPriceAirport_"+a[g].Code).is(":checked")||false}var d=this.model.preferences.Rooms;var l=d.length;for(var f=0;f<l;f++){var j=d[f].RoomTypes;var e=j.length;for(var k=0;k<e;k++){j[k].Checked=jQuery("#bestPriceRoomType_"+f+"_"+j[k].Code).is(":checked")||false}}this.model.preferences.SelectedDuration=this._getSelectedDuration();this.model.preferences.EarliestDepartureDateString=this.earliestDeparture.getSelectedDate().format("yyyyMMdd");this.model.preferences.LatestReturnDateString=this.latestReturn.getSelectedDate().format("yyyyMMdd")}if(arguments.length>0&&c&&c.populate){var h=(c.preferences&&c.results)?"both":(c.preferences)?"options":(c.results)?"results":"";this._populate(h)}},_getSelectedDuration:function(a){var b;if(a){b=jQuery("#durationselect option:selected").val()||jQuery("#durationselect option:first").val()}else{b=jQuery("#bestPriceDurations option:selected").val()||jQuery("#bestPriceDurations option:first").val()}return parseInt(b,10)||0},_onFindBestPriceClick:function(e){var g=this.earliestDeparture.getSelectedDate();var a=this.latestReturn.getSelectedDate();var f=this._getSelectedDuration();var b=Math.abs(a.getTime()-g.getTime());var d=Math.round(b/(1000*60*60*24));var c=(f>d);jQuery("#bestPriceOutOfRangeMessage").toggle(c);jQuery("#bestPriceOpeningMessage, #bestPriceResultsPlaceholder").toggle(!c);if(!c){this.HandleEvent(e,"dummy")}},_getDetailPageController:function(){if(this._detailPageController==null){this._detailPageController=$find("clickmain")}return this._detailPageController},_callDetailPageControllerMethod:function(){var c=jQuery.makeArray(arguments),b=c.shift(),a=this._getDetailPageController(),d=a[b];if(d){return d.apply(a,c)}return null},_getTravelInfoForSelectedResult:function(a,c){var k=this._callDetailPageControllerMethod("GetCurrentTravelInfo",a,c);if(a&&a.target&&a.target.id&&this.model&&this.model.results&&this.model.results.Items){var e=a.target.id.split("_"),h=parseInt(e[1],10),d=this.model.results.Items[h]||null;if(d!=null){var b=d.DepartureDate.format("yyyyMMdd");k.selectedDuration=d.Duration;if(d.DepartureAirportCode!=null){k.selectedAirport=d.DepartureAirportCode.toLowerCase()}k.selectedAirportDescription=d.DepartureAirportDescription;k.departureDate=b;k.selectedPeriod=b;k.selectedCellDate=b;k.selectedCellDuration=d.Duration;if(k.numberOfRooms!=d.Rooms.length){Sys.Debug.trace("Unexpected number of rooms in best price finder");return k}for(var f=0;f<k.numberOfRooms;f++){var g=d.Rooms[f];var l=g.ArrangementCode||"";if(k.arrangement!=l){Sys.Debug.trace("Incompatible arrangement returned by best price finder");return k}var j=k.roomOccupations[f];j.boardType=g.BoardTypeCode;j.roomIdentification=g.AccommodationCode+"__"+g.RoomBookCode}}}return k},_onResultSelected:function(a,b){this._callDetailPageControllerMethod("SetTravelInfoAndChoices",a,b);this.close()},_populate:function(a){if(a==="options"||a==="both"){if(this.preferencesTemplate==null){this.preferencesTemplate=jQuery("#bestPriceOptionsTemplate").parseTemplate("bestPriceOptions")}jQuery("#bestPriceOptionsPlaceholder").empty().appendTemplate(this.preferencesTemplate,this.model)}if(a==="results"||a==="both"){if(this.resultsTemplate==null){this.resultsTemplate=jQuery("#bestPriceResultsTemplate").parseTemplate("bestPriceResults")}if(!this.model.results||!this.model.results.Items){this.model.results={Items:[]}}jQuery("#bestPriceResultsPlaceholder").empty().appendTemplate(this.resultsTemplate,this.model)}jQuery("#bestPriceOpeningMessage").toggle(a==="options");jQuery("#bestPriceResultsPlaceholder").toggle(a==="results"||a==="both");if(this._fixHeightsDelegate){window.setTimeout(this._fixHeightsDelegate,0)}},_fixHeights:function(){var a=jQuery("#bestPricePreferencesContainer").height();var c=jQuery("#bestPriceResultsContainer");var b=c.find("div.best-price-header").outerHeight();c.height(a+"px");c.find("#bestPriceResultsPlaceholder").css({"overflow-y":"auto","overflow-x":"hidden",height:(a-b)+"px"})},_onFindBestPriceCompleted:function(a){if(a!=null){this.update({results:a});this.DoPartialUpdateWithOmnitureLogging(a)}else{Sys.Debug.trace("ThomasCook.Ecom.Web.BookingAvailability.FindBestPriceData failed")}this._populate("results");this._hideWaitPanel()},_onDocumentLoad:function(){this.roomTypeInfoPopup=new Ecom.UI.ModalBox("#bestPriceRoomTypeInfoPopup",{dialogClass:"option",width:600});this.earliestDeparture=Ecom.UI.Calendar.create({target:"#bestPriceDepartureDateControl",altField:"#bestPriceDepartureDateLabel",altFormat:"d-mm-yy",beforeShow:this._fixCalendarZindex,onSelect:Function.createDelegate(this,this._updateRangesAndSelectedDates)});this.latestReturn=Ecom.UI.Calendar.create({target:"#bestPriceReturnDateControl",altField:"#bestPriceReturnDateLabel",altFormat:"d-mm-yy",beforeShow:this._fixCalendarZindex})},_updateRangesAndSelectedDates:function(){var b=new Date(),a=new Date();a.setDate(b.getDate()+1);var d=new Date(a.getTime()),e=new Date(this.seasonEndDate),c=this.earliestDeparture.getSelectedDate();if(c<d){c=new Date(d.getTime())}if(c>e){c=new Date(e.getTime())}this.earliestDeparture.setRanges(d,e);this.earliestDeparture.selectDate(c,true);d=new Date(c.getTime());d.setDate(d.getDate()+1);e=new Date(c.getTime());e.setDate(e.getDate()+56);c=this.latestReturn.getSelectedDate();if(c<d){c=new Date(d.getTime());c.setDate(c.getDate()+14)}if(c>e){c=new Date(e.getTime())}this.latestReturn.setRanges(d,e);this.latestReturn.selectDate(c,true)},_fixCalendarZindex:function(){jQuery("#ui-datepicker-div").css("z-index","910")},_showRoomTypesInfoPopup:function(){if(this.roomTypeInfoPopup!=null){this.roomTypeInfoPopup.show({content:jQuery("#tabstripcontent_OVERSTAY_TYPES").html()})}},_showWaitPanel:function(){Ecom.Application.showWaiterBox()},_hideWaitPanel:function(){Ecom.Application.hideWaiterBox()},_findItem:function(a,d){for(var b=0,c=d.length;b<c;b++){if(d[b].Code===a.Code){return d[b]}}return null},_mergeWithUserPrefs:function(e,b){for(var c=0,d=e.length;c<d;c++){var a=this._findItem(e[c],b);if(a!=null){e[c].Checked=a.Checked}}return e},_extendSelectionInfo:function(a){return jQuery.extend(a,{toAirports:function(){var d=[];var b=this.Options||[];var e=b.length;for(var c=0;c<e;c++){d.push({Code:b[c].Value||"",Description:b[c].Description||"",Checked:true})}return d},toDurations:function(){var b=[];var c=this.Options||[];var e=c.length;for(var d=0;d<e;d++){b.push({Code:c[d].Value||"",Description:c[d].Description||""})}return b}})}};Ecom.Detail.BestPriceFinder.isBestPriceFinderEnabled=function(){return(jQuery("#main").attr("bestPriceFinder")=="enabled")};Ecom.Detail.BestPriceFinder.registerClass("Ecom.Detail.BestPriceFinder",Ecom.Omniture);Ecom.Detail.ZooverComponent=function(a){this.popup=null;Ecom.Detail.ZooverComponent.initializeBase(this,[a])};Ecom.Detail.ZooverComponent.prototype={initialize:function(){Sys.Application.add_load(Function.createDelegate(this,this.onDocumentLoad));jQuery("#zvContainer").appendTo("#zooverPlaceholder").show();jQuery("#zooverPopupTrigger").click(Function.createDelegate(this,this.showZooverPopup))},onDocumentLoad:function(){this.popup=new Ecom.UI.ModalBox("#zvPopup",{dialogClass:"zoover-box",width:650})},showZooverPopup:function(){if(this.popup!==null){this.popup.show()}}};Ecom.Detail.ZooverComponent.registerClass("Ecom.Detail.ZooverComponent",Sys.UI.Control);Ecom.Detail.GoogleMaps=function(a){this.latitude=null;this.longitude=null;this.zoomFactor=null;this.accoName="";this._gmapsInitialized=false;this._initializeGoogleMapsDelegate=Function.createDelegate(this,this.initializeGoogleMaps);Ecom.Detail.GoogleMaps.initializeBase(this,[a])};Ecom.Detail.GoogleMaps.prototype={initialize:function(){jQuery("#gmStatic").appendTo("#gmapStaticPlaceholder").show();jQuery("#gmDynamic").appendTo("#gmapsPlaceholder").show()},_reinitializeEventBinding:function(f){var e=jQuery("#gmStatic"),a=jQuery("#tabstrip_ENVIRONMENT"),d=Function.createDelegate(this,this._onGmTriggerClick),b=Function.createDelegate(this,this._onGmStaticClick);if(f){a.bind("click.initializeGmap",d)}else{var c=a.add(e);c.bind("click.initializeGmap",d);e.bind("click",b)}},_onGmStaticClick:function(b){var a=detailTabControl||$find("tabstrip")||null;if(a!==null){a.switchToEnvironmentTab()}},_onGmTriggerClick:function(a){window.setTimeout(this._initializeGoogleMapsDelegate,0)},validateProperties:function(){return(this.latitude!==null&&this.longitude!==null&&this.accoName!==""&&this.zoomFactor!==null)},setGeoProperties:function(a){a=a||{};this.latitude=a.latitude||null;this.longitude=a.longitude||null;this.zoomFactor=a.zoomFactor||null;this.accoName=a.accoName||"";this._reinitializeEventBinding(a.multimediaMode||false)},initializeGoogleMaps:function(){if(this._gmapsInitialized){return}if(!this.validateProperties()){Sys.Debug.trace("Ecom.Detail.GoogleMaps: invalid properties");return}var c=jQuery("#gmDynamic")[0]||null;if(c===null){Sys.Debug.trace("Ecom.Detail.GoogleMaps: target not found");return}var d=new google.maps.LatLng(this.latitude,this.longitude),b=new google.maps.Map(c,{zoom:this.zoomFactor,center:d,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}}),a=new google.maps.Marker({position:d,map:b,title:this.accoName});this._gmapsInitialized=true}};Ecom.Detail.GoogleMaps.registerClass("Ecom.Detail.GoogleMaps",Sys.UI.Control);Ecom.Detail.TransportSelector=function(a){this.departuresSelectId=null;this.departuresLabelId=null;this.arrivalsSelectId=null;this.arrivalsLabelId=null;this.carriersSelectId=null;this.carriersLabelId=null;this.departureHourSelectId=null;this.departureHourLabelId=null;this.transportClassSelectId=null;this.transportClassLabelId=null;this.transportDialog=null;this.flightParameterHierarchy=null;this.trainParameterHierarchy=null;this.busParameterHierarchy=null;this.currentTransport=null;ThomasCook.Ecom.Web.BookingAvailability.set_timeout(150000);Ecom.Detail.TransportSelector.initializeBase(this,[a]);this.GetCurrentTransportSearchParametersDelegate=Function.createDelegate(this,this.GetCurrentTransportSearchParameters);this.ShowSearchResultsDelegate=Function.createDelegate(this,this.ShowSearchResults);this.ShowWaitPanelDelegate=Function.createDelegate(this,this.ShowWaitPanel);this.HideWaitPanelDelegate=Function.createDelegate(this,this.HideWaitPanel);$addHandler(a,"click",this.OnClickDelegate);this.ChangeDepartureAirportDelegate=Function.createDelegate(this,this.ChangeDepartureAirport);this.ChangeArrivalAirportDelegate=Function.createDelegate(this,this.ChangeArrivalAirport);this.ChangeCarrierDelegate=Function.createDelegate(this,this.ChangeCarrier);this.ChangeDepartureHourDelegate=Function.createDelegate(this,this.ChangeDepartureHour);this.ChangeClassDelegate=Function.createDelegate(this,this.ChangeClass);this.FetchTransportParametersDelegate=Function.createDelegate(this,this.FetchTransportParameters);this.FetchFlightParametersDelegate=Function.createDelegate(this,this.FetchFlightParameters);this.FetchTrainParametersDelegate=Function.createDelegate(this,this.FetchTrainParameters);this.ShowTransportQueryResultDelegate=Function.createDelegate(this,this.ShowTransportQueryResult);this.ShowPriceCalcResultsDelegate=Function.createDelegate(this,this.ShowPriceCalcResults);this.RegisterEventHandler("flightdeparturesselect","change",false,this.ChangeDepartureAirportDelegate,null,this.FetchFlightParametersDelegate,null,null);this.RegisterEventHandler("flightarrivalsselect","change",false,this.ChangeArrivalAirportDelegate,null,this.FetchFlightParametersDelegate,null,null);this.RegisterEventHandler("flightcarriersselect","change",false,this.ChangeCarrierDelegate,null,this.FetchFlightParametersDelegate,null,null);this.RegisterEventHandler("traindeparturesselect","change",false,this.ChangeDepartureAirportDelegate,null,this.FetchTrainParametersDelegate,null,null);this.RegisterEventHandler("trainarrivalsselect","change",false,this.ChangeArrivalAirportDelegate,null,this.FetchTrainParametersDelegate,null,null);this.RegisterEventHandler("traincarriersselect","change",false,this.ChangeCarrierDelegate,null,this.FetchTrainParametersDelegate,null,null);this.RegisterEventHandler("traindeparturehoursselect","change",false,this.ChangeDepartureHourDelegate,null,this.FetchTrainParametersDelegate,null,null);this.RegisterEventHandler("traintransportclassesselect","change",false,this.ChangeClassDelegate,null,this.FetchTrainParametersDelegate,null,null);this.RegisterEventHandler("searchtransports","click",false,ThomasCook.Ecom.Web.BookingAvailability.SearchTransport,this.ShowTransportQueryResultDelegate,this.FetchTransportParametersDelegate,this.ShowWaitPanelDelegate,this.HideWaitPanelDelegate);this.RegisterEventHandler("tsTransportDescriptionChoice","click",false,ThomasCook.Ecom.Web.BookingAvailability.SelectTransportOptions,this.ShowSearchResultsDelegate,this.FetchTransportParametersDelegate,null,null);this.RegisterEventHandler("tsCalculatePrice","click",false,ThomasCook.Ecom.Web.BookingAvailability.CalculateTransportPrice,this.ShowPriceCalcResultsDelegate,this.FetchTransportParametersDelegate,this.ShowWaitPanelDelegate,this.HideWaitPanelDelegate)};Ecom.Detail.TransportSelector.prototype={initialize:function(){this.transportDialog=$create(Ecom.ModalDialog,{toBeDisabledId:"entiredetailcontent",toCloseId:"toClose",overlayId:"overlayTransportDialog",backgroundColor:"#000",width:947,height:450},null,null,$get("transportParametersDialog"));Ecom.Detail.TransportSelector.callBaseMethod(this,"initialize")},showTransportDialog:function(b){if(this.transportDialog&&b){this.HookChildSelects(this.get_element());this.flightParameterHierarchy=b.flightParameterHierarchy;this.trainParameterHierarchy=b.trainParameterHierarchy;this.busParameterHierarchy=b.busParameterHierarchy;var d=$find("transportParametersTabControl");if(d!=null){d.dispose()}var c=1;if(b.selectedTransportType=="Train"){c=2}d=$create(Proto.DetailTabControl,{selectedClass:"selected",unselectedClass:"unselected",selectedElementId:"tsTabStrip_"+c,NamingContainer:"tsTabStrip",contentPrefix:"tsTabContent"},null,null,$get("transportParametersTabControl"));var a=this;jQuery("select.transport-selection-parameter",this.element).each(function(){var e=this.id,f=e.replace(/select$/,"text");a.populateDropdown({select:e,label:f,priceTicketModusDependent:false})});this.transportDialog.Show();this.AutoSelectTransportIfNoChoicePossible(c)}},ExtractCurrentTransportFromId:function(c){var b=c.indexOf("_");var a=c.substring(b+1);if((a=="ANVR.VL")||(a=="ANVR.TR")||(a=="ANVR.BU")){this.currentTransport=a}},AutoSelectTransportIfNoChoicePossible:function(e){var b=true;jQuery("#tsTabContent_"+e+" select").each(function(){if(this.options.length>1){b=false}});if(b){var a=jQuery("#tsTabContent_"+e+" span[id^='searchtransports_']").attr("id");var d="click";var c=this.FindWaitSpecificationInstance($get(a),d);this.Wait(c,true);this.ExtractCurrentTransportFromId(a);ThomasCook.Ecom.Web.BookingAvailability.SearchTransport(a,d,this.FetchTransportParameters(),this.ShowTransportQueryResultDelegate,this.MethodTimeoutDelegate,c)}},tryToAutoAdvance:function(a){switch(a){case 1:break;case 2:break}},GetCurrentTransportSearchParameters:function(){},ChangeDepartureAirport:function(a,b,c){if(null!=c.DepartureAirport){this.populateDropdown({select:this.arrivalsSelectId,label:this.arrivalsLabelId,data:this._mapToSelectionInfo(c.DepartureAirport.Children),priceTicketModusDependent:false});c=this.FetchTransportParameters(null);this.ChangeArrivalAirport(a,b,c)}},ChangeArrivalAirport:function(a,b,c){if(null!=c.ArrivalAirport){this.populateDropdown({select:this.carriersSelectId,label:this.carriersLabelId,data:this._mapToSelectionInfo(c.ArrivalAirport.Children),priceTicketModusDependent:false});c=this.FetchTransportParameters(null);this.ChangeCarrier(a,b,c)}},ChangeCarrier:function(b,c,e){if(null!=e.Carrier){if(this.departureHourSelectId!=null){var d=$get(this.departureHourSelectId);var a=d.value;this.populateDropdown({select:this.departureHourSelectId,label:this.departureHourLabelId,data:this._mapToSelectionInfo(e.Carrier.Children),priceTicketModusDependent:false});d.value=a}e=this.FetchTransportParameters(null);this.ChangeDepartureHour(b,c,e)}},ChangeDepartureHour:function(b,c,d){if(null!=d.DepartureHour){var e=$get(this.transportClassSelectId);var a=e.value;this.populateDropdown({select:this.transportClassSelectId,label:this.transportClassLabelId,data:this._mapToSelectionInfo(d.DepartureHour.Children),priceTicketModusDependent:false});e.value=a}this.ChangeClass()},ChangeClass:function(){},_clearControlIds:function(){this.departuresSelectId=null;this.departuresLabelId=null;this.arrivalsSelectId=null;this.arrivalsLabelId=null;this.carriersSelectId=null;this.carriersLabelId=null;this.departureHourSelectId=null;this.departureHourLabelId=null;this.transportClassSelectId=null;this.transportClassLabelId=null},_setDepartures:function(a,b){this.departuresSelectId=a;this.departuresLabelId=b},_setArrivals:function(a,b){this.arrivalsSelectId=a;this.arrivalsLabelId=b},_setCarriers:function(a,b){this.carriersSelectId=a;this.carriersLabelId=b},_setDepartureHour:function(a,b){this.departureHourSelectId=a;this.departureHourLabelId=b},_setTransportClass:function(a,b){this.transportClassSelectId=a;this.transportClassLabelId=b},_mapToSelectionInfo:function(d){if(!d){return null}var c={Options:[]},b=d.length,a;for(a=0;a<b;a++){c.Options.push({Value:d[a].Code,Description:d[a].Label});if(0==a){c.SelectedValue=d[a].Code}}return c},_getSelectedValue:function(a){if(!a){return""}var c=a.options||[],b=a.selectedIndex||0,d=c[b],e=d.value||"";return e},_findNode:function(b,a){if(!b||!a){return null}var c,d=b.length;for(i=0;i<d;i++){c=b[i];if(a==c.Code){return c}}return null},_getSelectedNode:function(d,b){if(d&&b){var a=$get(d),c=this._getSelectedValue(a);if(c){return this._findNode(b,c)}}return null},_updateCurrentSelectedTransportType:function(c){if(c!=null){var b=c.target.id.indexOf("_");var a=c.target.id.substring(b+1);if((a=="ANVR.VL")||(a=="ANVR.TR")||(a=="ANVR.BU")){this.currentTransport=a}}return this.currentTransport},FetchFlightParameters:function(a){this.currentTransport="ANVR.VL";return this.FetchTransportParameters(a)},FetchTrainParameters:function(a){this.currentTransport="ANVR.TR";return this.FetchTransportParameters(a)},FetchTransportParameters:function(e){var c=new ThomasCook.Ecom.Core.PageComponents.Data.CommonView.Booking.BookingStepZero.TransportSelectionParameters(),a=null,f=this._updateCurrentSelectedTransportType(e),b=$find("clickmain");this._clearControlIds();if(f=="ANVR.VL"){this._setDepartures("flightdeparturesselect","flightdeparturestext");this._setArrivals("flightarrivalsselect","flightarrivalstext");this._setCarriers("flightcarriersselect","flightcarrierstext");a=this.flightParameterHierarchy}if(f=="ANVR.TR"){this._setDepartures("traindeparturesselect","traindeparturestext");this._setArrivals("trainarrivalsselect","trainarrivalstext");this._setCarriers("traincarriersselect","traincarrierstext");this._setDepartureHour("traindeparturehoursselect","traindeparturehourstext");this._setTransportClass("traintransportclassesselect","traintransportclassestext");a=this.trainParameterHierarchy;var d=$get("trainreturnhoursselect");if(d!=null){c.ReturnHour=this._getSelectedValue(d)}}if(f=="ANVR.BU"){this._setDepartures("busdeparturesselect","busdeparturestext");this._setArrivals("busarrivalsselect","busarrivalstext");this._setCarriers("buscarriersselect","buscarrierstext");a=this.busParameterHierarchy}if(b!==null){c.TravelInfo=b.GetCurrentTravelInfo()}if(a){c.DepartureAirport=this._getSelectedNode(this.departuresSelectId,a)}if(c.DepartureAirport){c.ArrivalAirport=this._getSelectedNode(this.arrivalsSelectId,c.DepartureAirport.Children)}if(c.ArrivalAirport){c.Carrier=this._getSelectedNode(this.carriersSelectId,c.ArrivalAirport.Children)}if(c.Carrier){c.DepartureHour=this._getSelectedNode(this.departureHourSelectId,c.Carrier.Children)}if(c.DepartureHour){c.TransportClass=this._getSelectedNode(this.transportClassSelectId,c.DepartureHour.Children)}c.TransportTypeCode=f;c.WayTransport=this.FetchSelectedWayTransport();c.BackTransport=this.FetchSelectedBackTransport();return c},FetchSelectedWayTransport:function(){var a=this.FindSelectedTransportOption(document.getElementsByName("away"));return this.FindSelectedTransport(this.wayTransports,a)},FetchSelectedBackTransport:function(){var a=this.FindSelectedTransportOption(document.getElementsByName("back"));return this.FindSelectedTransport(this.backTransports,a)},ClearTransportSelection:function(a){if(null==a){return null}for(i=0;i<a.length;i++){if(a[i].checked==true){a[i].checked=false;break}}},FindSelectedTransportOption:function(a){if(null==a){return null}for(i=0;i<a.length;i++){if(a[i].checked==true){return a[i].id.substring(a[i].id.indexOf("_")+1,a[i].id.length)}}},FindSelectedTransport:function(b,a){if((null==b)||(null==a)){return null}for(i=0;i<b.length;i++){if(b[i].TransportCode==a){return b[i]}}},ShowTransportQueryResult:function(c,b,a){if(null!=c){this.wayTransports=c.wayTransports;this.backTransports=c.backTransports;this.ShowSearchResults(c,b,a);this.AutoSelectSingleWayAndBackTransport()}},ShowSearchResults:function(d,c,a){if(d!=null){var f=$find("transportpriceandavailabilityqueryresults");if(f!=null){f.dispose()}var e=$create(Ecom.VerticalScroll,{scrollPaneCreator:function(){return[{divName:"transportOverviewLeft",up:"arrowUpLeft",down:"arrowDownLeft"},{divName:"transportOverviewRight",up:"arrowUpRight",down:"arrowDownRight"}]}},null,null,$get("transportpriceandavailabilityqueryresults"));var b=d.divUpdates;this.DoPartialUpdate(d.divUpdates);this.Wait(c,false)}},AutoSelectSingleWayAndBackTransport:function(){var a=this.AutoSelectSingleTransport("#transportOverviewLeft input");var b=this.AutoSelectSingleTransport("#transportOverviewRight input");if((a==1)||(b==1)){ThomasCook.Ecom.Web.BookingAvailability.SelectTransportOptions(null,null,this.FetchTransportParameters(),this.ShowSearchResultsDelegate,null)}},AutoSelectSingleTransport:function(a){var c=jQuery(a);var b=c.length;if(b==1){c.each(function(){jQuery(this).attr("checked","checked")})}return b},ShowPriceCalcResults:function(g,f,c){var e=g.divUpdates;this.DoPartialUpdate(g.divUpdates);var a=$find("clickpricegrid");if(a!=null){a.UpdateTransportAvailabilityForSelectedCell();hide("tsTransportAvailable")}var b=$find("clickmain");if(b!=null){b.updateStartBookingInfo();b.toggleBlocksVisibility(true,true)}var d=$find("transportParametersDialog");if((d!=null)&&(d.Close!=null)){d.Close()}this.Wait(f,false)},ShowWaitPanel:function(){var m=$get("transportParametersDialog");var h=0;var b=0;if(m!=null){var a=Sys.UI.DomElement.getBounds(m);h+=a.width-20;if(a.height>b){b=a.height-20}}var c=$get("background");if(c!=null){c.style.width=h+"px";c.style.height=b+"px"}var l=$get("wait");if(l!=null){l.style.width=h+"px";l.style.height=b+"px"}var j=$get("WaitPanel");if(j!=null){var f=10;var d=10;if(m!=null){f=10+m.offsetLeft;d=10+m.offsetTop}j.style.left=f+"px";j.style.top=d+"px";j.style.display=""}var e=$get("pleasewait");var k=$get("transportParametersDialog");if(e!=null&&k!=null){var a=Sys.UI.DomElement.getBounds(e);var g=(h/2)-(a.width/2);e.style.marginLeft=g+"px"}},HideWaitPanel:function(){var a=$get("WaitPanel");if(a!=null){a.style.display="none"}}};Ecom.Detail.TransportSelector.registerClass("Ecom.Detail.TransportSelector",Proto.Updater);Type.registerNamespace("Ecom.Personalization");Ecom.PersonalizationMenu=function(a){Ecom.PersonalizationMenu.initializeBase(this,[a]);this.GetProductPackageParametersForSelectedCountryDelegate=Function.createDelegate(this,this.GetProductPackageParametersForSelectedCountry);this.PrepareDataDelegate=Function.createDelegate(this,this.PrepareData);this.ShowPersonalDataPanelDelegate=Function.createDelegate(this,this.ShowPersonalDataPanel);this.ShowPasswordPanelDelegate=Function.createDelegate(this,this.ShowPasswordPanel);this.ShowNewsletterPanelDelegate=Function.createDelegate(this,this.ShowNewsletterPanel);this.LogoutDelegate=Function.createDelegate(this,this.Logout);this.MappingCreator=null;this.Mode="Watched";this.SelectedCountry=null;this.LoginName=null;this.OnPartialUpdateCompletedDelegate=Function.createDelegate(this,this.OnPartialUpdateCompleted);this.RegisterEventHandler("countries","click",true,ThomasCook.Ecom.Web.Personalization.ShowStoredLister,this.OnPartialUpdateCompletedDelegate,this.PrepareDataDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("watched","click",true,ThomasCook.Ecom.Web.Personalization.ShowStoredLister,this.OnPartialUpdateCompletedDelegate,this.PrepareDataDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("accountChangepersonaldata","click",true,this.ShowPersonalDataPanelDelegate,this.OnPartialUpdateCompletedDelegate,this.PrepareDataDelegate,null,null);this.RegisterEventHandler("accountChangepassword","click",true,this.ShowPasswordPanelDelegate,this.OnPartialUpdateCompletedDelegate,this.PrepareDataDelegate,null,null);this.RegisterEventHandler("accountLogout","click",true,this.LogoutDelegate,null,null,null,null);this.RegisterEventHandler("showNewsletter","click",true,this.ShowNewsletterPanelDelegate,this.OnPartialUpdateCompletedDelegate,this.PrepareDataDelegate,null,null);$addHandler(a,"click",this.OnClickDelegate)};Ecom.PersonalizationMenu.prototype={initialize:function(){if(this.MappingCreator!=null){this.Mapping=this.MappingCreator()}var a=$get("watched");if(a!=null){this.ToggleSelectedMenuItem(a)}},Refresh:function(){var a=this.PrepareData();ThomasCook.Ecom.Web.Personalization.ShowPersonalizationMenu(null,null,a,this.OnPartialUpdateCompletedDelegate,this.MethodTimeoutDelegate,null)},OnComponentClick:function(){},Logout:function(){var a=$find("header");if(a!=null){a.DoLogout()}},SyncNewsLetterUrl:function(){var f=$get("loginheaderSendEmail");if(f!=null){var a=$get("subscribeForNewsletterUrl").getAttribute("value");if(a!=null){var e=$get("loginreg_email");if(e!=null){var b=decodeURIComponent(a)+e.value;var c=$get("newsletteriframe");if(c!=null){var d=c.getAttribute("src");if(d!=b){c.setAttribute("src",b)}}}}}},SwitchRegistrationMode:function(f,h,j,k,b,m,g){var a=$get(h);if(a!=null){var d=a.getAttribute("loginrequired");if(d!=null&&d=="True"){var e=$find("loginpopupcomponentmodaldialog");if(e!=null){var c=$get("loginname");c.value=this.LoginName;e.Show();jQuery("#"+e.get_id()+" input:first").focus()}}else{var l=$find("loginregistrationcomponentpanel");if(l!=null){l.SwitchRegistrationMode(f)}this.ToggleSelectedMenuItem(a);this.Mode=a.getAttribute("mode");ThomasCook.Ecom.Web.Personalization.ShowStoredLister(h,j,k,b,m,g);this.SyncNewsLetterUrl()}}},ShowPersonalDataPanel:function(f,e,b,c,a,d){this.SwitchRegistrationMode("updateMode",f,e,b,c,a,d)},ShowPasswordPanel:function(f,e,b,c,a,d){this.SwitchRegistrationMode("passwordChangeMode",f,e,b,c,a,d)},ShowNewsletterPanel:function(f,e,b,c,a,d){this.SwitchRegistrationMode("newsletterChangeMode",f,e,b,c,a,d)},PrepareData:function(c){hide("loginregistrationcomponentpanel");var a=new ThomasCook.Ecom.Core.PageComponents.ContextObject.Personalization.PassportPageInput();if(c!=null&&c.target.id!=null){var d=$get(c.target.id)}var b=d;while(b!=null){if(b.getAttribute("mode")!=null){break}b=b.parentNode}if(b!=null){this.SelectedCountry=b.getAttribute("country");a.SelectedCountry=this.SelectedCountry;this.Mode=b.getAttribute("mode");a.SelectedMode=this.Mode;this.ToggleSelectedMenuItem(b);if(this.Mode=="Stored"){a.PackagesToShow=this.GetProductPackageParametersForSelectedCountry()}}return a},ToggleSelectedMenuItem:function(h){var g=["sectionWatched","sectionStored","sectionNewsletter","sectionAccount"];for(var e=0;e<g.length;e++){var d=$get(g[e]);if(d!=null&&d.childNodes!=null){var c=d.childNodes;for(var b=0;b<c.length;b++){var f=c[b];try{Sys.UI.DomElement.removeCssClass(f,"selected")}catch(a){}}}}Sys.UI.DomElement.addCssClass(h,"selected")},GetProductPackageParametersForSelectedCountry:function(){for(key in this.Mapping){if(key==this.SelectedCountry){return this.Mapping[key]}}return null},OnPartialUpdateCompleted:function(d,c,a){this.DoPartialUpdate(d.divUpdates);this.Wait(c,false);var e=$find("storedListerComponentMain");var b=$get("storedListerComponentMain");e.HookChildSelects(b);if(d.countryMapping!=null){this.Mapping=d.countryMapping;this.Mode=d.Mode;this.SelectedCountry=d.country}}};Ecom.PersonalizationMenu.registerClass("Ecom.PersonalizationMenu",Ecom.UpdaterWithWaitHeader);Ecom.StoredLister=function(a){Ecom.StoredLister.initializeBase(this,[a]);this.OnComponentClickDelegate=Function.createDelegate(this,this.OnComponentClick);this.OnPartialUpdateCompletedDelegate=Function.createDelegate(this,this.OnPartialUpdateCompleted);this.OnRemovingStoredItemDelegate=Function.createDelegate(this,this.OnRemovingStoredItem);this.GetStoredItemInfoDelegate=Function.createDelegate(this,this.GetStoredItemInfo);this.GoToDetailPageDelegate=Function.createDelegate(this,this.GoToDetailPage);this.OnStorePackageInProfileDelegate=Function.createDelegate(this,this.OnStorePackageInProfile);this.RememberSelectedItemDelegate=Function.createDelegate(this,this.RememberSelectedItem);this.LoginAndStorePackageDelegate=Function.createDelegate(this,this.LoginAndStorePackage);this.OnSelectionsComparedDelegate=Function.createDelegate(this,this.OnSelectionsCompared);this.GetSelectedItemsDelegate=Function.createDelegate(this,this.GetSelectedItems);this.GetRecentItemsInfoDelegate=Function.createDelegate(this,this.GetRecentItemsInfo);this.CompareDelegate=Function.createDelegate(this,this.Compare);this.InitializeTooltipsDelegate=Function.createDelegate(this,this.InitializeTooltips);this.RegisterEventHandler("removeStoredPackage","click",true,this.OnRemovingStoredItemDelegate,this.OnPartialUpdateCompletedDelegate,this.GetStoredItemInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("storedListerItem","click",true,this.GoToDetailPageDelegate,null,null,null,null);this.RegisterEventHandler("storedListerSortBy","change",false,ThomasCook.Ecom.Web.Personalization.ShowStoredLister,this.OnPartialUpdateCompletedDelegate,this.GetStoredItemInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("pagerSort","change",false,ThomasCook.Ecom.Web.Personalization.ShowRecentItems,this.OnPartialUpdateCompletedDelegate,this.GetRecentItemsInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("pagerSize","change",false,ThomasCook.Ecom.Web.Personalization.ShowRecentItems,this.OnPartialUpdateCompletedDelegate,this.GetRecentItemsInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("pagerNext","click",false,ThomasCook.Ecom.Web.Personalization.ShowRecentItems,this.OnPartialUpdateCompletedDelegate,this.GetRecentItemsInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("pagerPrevious","click",false,ThomasCook.Ecom.Web.Personalization.ShowRecentItems,this.OnPartialUpdateCompletedDelegate,this.GetRecentItemsInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("pagerDirectLink","click",false,ThomasCook.Ecom.Web.Personalization.ShowRecentItems,this.OnPartialUpdateCompletedDelegate,this.GetRecentItemsInfoDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("addStoredPackage","click",true,this.LoginAndStorePackageDelegate,this.OnStorePackageInProfileDelegate,this.RememberSelectedItemDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);this.RegisterEventHandler("compareitem","click",true,this.CompareDelegate,this.OnSelectionsComparedDelegate,this.GetSelectedItemsDelegate,this.ShowHeaderWaitPanelDelegate,this.HideHeaderWaitPanelDelegate);$addHandler(a,"click",this.OnClickDelegate);$addHandler(a,"mouseover",this.OnMouseOverDelegate);$addHandler(a,"mouseout",this.OnMouseOutDelegate);Sys.Application.add_load(this.InitializeTooltipsDelegate);this.HookChildSelects(a)};Ecom.StoredLister.prototype={initialize:function(){Ecom.StoredLister.callBaseMethod(this,"initialize")},Compare:function(h,f,e,c,a,d){var b=null;if((e==null)||(e.length<2)){b="CompareEmptySelection"}if(e.length>3){b="CompareMaximumExceeded"}if(b!=null){var g=$find("header");if(g!=null){g.ShowError(b)}this.Wait(d,false);return}else{ThomasCook.Ecom.Web.Personalization.ShowComparison(h,f,e,c,a,d)}},InitializeTooltips:function(){initializeTooltips("#storedListerComponentMain",".storedItem div[id^='PriceIndication_']","#priceIndicationHelp","top right");initializeTooltips("#storedListerComponentMain",".storedItem div[id^='ComparerHelp_']","#compareToolHelp","top left")},GetSelectedItems:function(h){var a=document.getElementsByTagName("input");var e=new Array();var d=0;var g="compareitemcheckbox_";var f=g.length;for(i=0;i<a.length;i++){var c=a[i];if(c.type=="checkbox"){if(c.checked){if(c.id.startsWith(g)){var b=c.id.substring(f);e[d]=parseInt(b,10);d++}}}}return e},OnSelectionsCompared:function(d,c,b){this.DoPartialUpdate(d.divUpdates);this.Wait(c,false);var a=$find("comparepopupmodaldialog");if(a!=null){a.Show()}},RememberSelectedItem:function(d){if(d==null){return null}var c=d.target;if(c==null){return null}var e=c.id;if(e==null){return null}var b=e.indexOf("_");if(b>=0){var a=e.substring(b+1);this.LastSelectedItem=a}return null},LoginAndStorePackage:function(a,h,c,b,j,g){var d=$find("header");if(d!=null){if(!d.IsLoggedIn()){var f=$find("loginpopupcomponentmain");if(f!=null){f.RememberProductToStore(a,h,c,b,j,g)}var e=$find("loginpopupcomponentmodaldialog");if(e!=null){if((g!=null)&&(g.wait!=null)&&(g.wait.hidewaitmethod!=null)){g.wait.hidewaitmethod()}e.Show()}}else{ThomasCook.Ecom.Web.Personalization.StorePackageInProfile(a,h,c,b,j,g)}}},OnStorePackageInProfile:function(a,c,b){this.Wait(c,false);if(a=="Succeeded"){show("storedPackage_"+this.LastSelectedItem);hide("addStoredPackage_"+this.LastSelectedItem);var e=$find("personalizationMenuComponentMain");if(e!=null){e.Refresh("personalizationMenuComponentMain")}}else{var d=$find("header");if(d!=null){d.ShowError(a)}}},OnComponentClick:function(){},OnRemovingStoredItem:function(f,e,b,c,a,d){ThomasCook.Ecom.Web.Personalization.RemovePackageFromProfile(f,e,b,c,a,d)},OnPartialUpdateCompleted:function(c,b,a){this.DoPartialUpdate(c.divUpdates);this.Wait(b,false);if(c.countryMapping!=null){var d=$find("personalizationMenuComponentMain");if(d!=null){d.Mapping=c.countryMapping;d.Mode=c.mode;d.SelectedCountry=c.country}}this.InitializeTooltips()},UpdatePageNumberFromId:function(c,a){if(c.startsWith("pagerDirectLink")){var b=c.split("_");if((b!=null)&&(b.length>=2)){a.PageNumber=parseInt(b[1],10)}}},GetRecentItemsInfo:function(h){var b=new ThomasCook.Ecom.Core.PageComponents.ContextObject.Personalization.PassportPageInput();b.SelectedMode="Watched";b.SelectedCountry=null;b.PageNumber=1;var g=document.getElementsByTagName("select");if(g!=null){var d=0;for(d=0;d<g.length;d++){var f=g[d];if(f!=null){if(f.id.startsWith("pagerSort")){b.SortDirection=f.value}if(f.id.startsWith("pagerSize")){b.ViewSize=f.value}}}}var c=document.getElementsByTagName("span");if(c!=null){for(d=0;d<c.length;d++){var e=c[d];if(e!=null){if(e.className.indexOf("selectedPage")>=0){this.UpdatePageNumberFromId(e.id,b)}}}}var a=h.target.id;this.UpdatePageNumberFromId(a,b);if(a.indexOf("pagerPrevious")>=0){b.PageNumber-=1}if(a.indexOf("pagerNext")>=0){b.PageNumber+=1}if(a.indexOf("pagerSize")>=0){b.ViewSize=h.target.value}if(a.indexOf("pagerSort")>=0){b.SortDirection=h.target.value}return b},GetStoredItemInfo:function(){var a=new ThomasCook.Ecom.Core.PageComponents.ContextObject.Personalization.PassportPageInput();var c=$find("personalizationMenuComponentMain");if(c!=null){a.SelectedMode=c.Mode;a.SelectedCountry=c.SelectedCountry}var b=$get("storedListerSortBy");if(b!=null){a.SortDirection=b.value}if(a.SelectedMode=="Stored"){a.PackagesToShow=c.GetProductPackageParametersForSelectedCountry()}return a},GoToDetailPage:function(e){var d=e.split("_");if(d.length>1){var a="storedListerItemSelect_"+d[1];var c=$get(a);if(c!=null){var b=c.getAttribute("href");if(b!=null&&b!=""){document.location.href=b}}}}};Ecom.StoredLister.registerClass("Ecom.StoredLister",Ecom.UpdaterWithWaitHeader);Ecom.Personalization.LoginHeader=function(a){this.isLoggedIn=false;this.unexpectedErrorPopup=null;this.maxLimitReachedErrorPopup=null;this.compareMaximumExceededErrorPopup=null;this.compareEmptySelectionErrorPopup=null;Ecom.Personalization.LoginHeader.initializeBase(this,[a]);this.DoLoginDelegate=Function.createDelegate(this,this.DoLogin);this.RegisterEventHandler("login","click",true,this.DoLoginDelegate,null,null,null,null);this.DoLogoutDelegate=Function.createDelegate(this,this.DoLogout);this.RegisterEventHandler("logout","click",true,this.DoLogoutDelegate,null,null,null,null);this.SubmitEmailAddressDelegate=Function.createDelegate(this,this.SubmitEmailAddress);this.RegisterEventHandler("loginheaderSendEmail","click",true,this.SubmitEmailAddressDelegate,null,null,null,null);this.OnSwitchLanguageDelegate=Function.createDelegate(this,this.OnSwitchLanguage);this.RegisterEventHandler("langswitcher","click",true,this.OnSwitchLanguageDelegate,null,null,null,null);this.OnEnterEmailDelegate=Function.createDelegate(this,this.OnEnterEmail);this.LoginCompletedCallbackDelegate=Function.createDelegate(this,this.LoginCompletedCallback);this.LogoutCompletedCallbackDelegate=Function.createDelegate(this,this.LogoutCompletedCallback);this.OnloadDelegate=Function.createDelegate(this,this.Onload);this.OnShowLoginStatusCompletedDelegate=Function.createDelegate(this,this.OnShowLoginStatusCompleted);$addHandler(a,"click",this.OnClickDelegate)};Ecom.Personalization.LoginHeader.prototype={initialize:function(){this.OnloadDelegate();var a=$get("loginheaderEmail");if(a!=null){$addHandler(a,"keypress",this.OnEnterEmailDelegate)}},OnComponentClick:function(){},ShowError:function(a){if(a=="UnexpectedError"){if(this.unexpectedErrorPopup==null){this.unexpectedErrorPopup=new Ecom.UI.ModalBox("#UnexpectedError",{dialogClass:"message-box personalization",width:360})}this.unexpectedErrorPopup.show()}else{if(a=="MaxLimitReached"){if(this.maxLimitReachedErrorPopup==null){this.maxLimitReachedErrorPopup=new Ecom.UI.ModalBox("#MaxLimitReached",{dialogClass:"message-box personalization",width:360})}this.maxLimitReachedErrorPopup.show()}else{if(a=="CompareMaximumExceeded"){if(this.compareMaximumExceededErrorPopup==null){this.compareMaximumExceededErrorPopup=new Ecom.UI.ModalBox("#CompareMaximumExceeded",{dialogClass:"message-box personalization",width:360})}this.compareMaximumExceededErrorPopup.show()}else{if(a=="CompareEmptySelection"){if(this.compareEmptySelectionErrorPopup==null){this.compareEmptySelectionErrorPopup=new Ecom.UI.ModalBox("#CompareEmptySelection",{dialogClass:"message-box personalization",width:360})}this.compareEmptySelectionErrorPopup.show()}}}}},DoLogin:function(){var a=$find("loginpopupcomponentmodaldialog");if(a!=null){a.Show();jQuery("#"+a.get_id()+" input:first").focus()}},DoLogout:function(){Sys.Services.AuthenticationService.logout("/",this.LogoutCompletedCallbackDelegate,null,null)},LoginCompletedCallback:function(){location.reload(true)},LogoutCompletedCallback:function(){},OnEnterEmail:function(b){var a=b.charCode;if(a!=null&&a==13){this.SubmitEmailAddress()}},SubmitEmailAddress:function(){var c=$get("loginheaderSendEmail");var b=$get("subscribeForNewsletterUrl");var f=$get("subscribeForNewsletterRedirectUrl");var e=$get("loginheaderEmail");if(c!=null&&e!=null&&e.value!=""&&(f!=null||b!=null)){if(e.value!=""&&e.value!=e.defaultValue){var d="";var a=false;if(f!=null&&f.value!=""){d=f.getAttribute("value");a=true}else{d=b.getAttribute("value")}d=decodeURIComponent(d);if(a){document.location.href=d+e.value}else{window.open(d+e.value,"Popup","")}}}},OnSwitchLanguage:function(c){var b=$get(c);if(b!=null){var a=decodeURIComponent(b.getAttribute("url"));window.location=a}},Onload:function(){ThomasCook.Ecom.Web.Personalization.GetLoginStatus(this.OnShowLoginStatusCompletedDelegate,null,null)},SetLoginStatus:function(a){this.isLoggedIn=false;if(a){this.isLoggedIn=true;show("logout");show("myPassportButton");hide("login");hide("login_myPassportButton")}else{hide("logout");hide("myPassportButton");show("login");show("login_myPassportButton")}},OnShowLoginStatusCompleted:function(a,c,b){if(a!=null&&a.IsLoggedIn==true){this.SetLoginStatus(true)}else{this.SetLoginStatus(false)}var d=$get("loginViewedItemsCount");if(a!=null&&d!=null){d.innerHTML=a.ViewedItemsCount}if(!this.isLoggedIn){if(document.location.hash=="#ShowLogin"){this.DoLogin()}}},IsLoggedIn:function(){return this.isLoggedIn}};Ecom.Personalization.LoginHeader.registerClass("Ecom.Personalization.LoginHeader",Proto.Updater);Ecom.Personalization.LoginPopup=function(a){Ecom.Personalization.LoginPopup.initializeBase(this,[a]);this.LoginCompletedCallbackDelegate=Function.createDelegate(this,this.LoginCompletedCallback);this.OnEnterLoginDelegate=Function.createDelegate(this,this.OnEnterLogin);this.DoLoginDelegate=Function.createDelegate(this,this.DoLogin);this.RegisterEventHandler("loginpopupLogin","click",true,this.DoLoginDelegate,null,null,null,null);this.CancelLoginDelegate=Function.createDelegate(this,this.CancelLogin);this.RegisterEventHandler("loginpopupCancel","click",true,this.CancelLoginDelegate,null,null,null,null);this.ForgotPasswordShowDelegate=Function.createDelegate(this,this.ForgotPasswordShow);this.RegisterEventHandler("loginpopupForgotPassword","click",true,this.ForgotPasswordShowDelegate,null,null,null,null);this.ForgotPasswordSendDelegate=Function.createDelegate(this,this.ForgotPasswordSend);this.RegisterEventHandler("passwordforgotSend","click",true,this.ForgotPasswordSendDelegate,null,null,null,null);this.ForgotPasswordResponseDelegate=Function.createDelegate(this,this.ForgotPasswordResponse);$addHandler(a,"click",this.OnClickDelegate);$addHandler(a,"keypress",this.OnEnterLoginDelegate)};Ecom.Personalization.LoginPopup.prototype={initialize:function(){},ForgotPasswordShow:function(){var b=$find("passwordforgotcomponentmodaldialog");if(b!=null){this.ForgotPasswordReset();b.Show()}var a=$find("loginpopupcomponentmodaldialog");if(a!=null){a.Close()}},ForgotPasswordSend:function(){var a=$get("passwordforgotemail");if(a!=null){var c="^([a-zA-Z0-9_\\.\\-])+\\@(?:[a-zA-Z0-9\\-]+\\.)+([a-zA-Z0-9]{2,4})+$";var b=new RegExp(c);if(a.value==""||b.test(a.value)==false){show("passwordforgotvalidation");this.UpdateValidFieldIndicator(a,"invalid",false)}else{hide("passwordforgotvalidation");this.UpdateValidFieldIndicator(a,"invalid",true);ThomasCook.Ecom.Web.Personalization.ResendPassword(a.value,this.ForgotPasswordResponse,null,null)}}},ForgotPasswordResponse:function(a){var b=$find("passwordforgotcomponentmodaldialog");if(a){b.Close()}else{show("passwordforgotfailure")}},ForgotPasswordReset:function(){var a=$get("passwordforgotemail");if(a!=null){a.value="";hide("passwordforgotvalidation");hide("passwordforgotfailure");this.UpdateValidFieldIndicator(a,"invalid",true)}},OnEnterLogin:function(a){var b=a.charCode;if(b!=null&&b==13){this.DoLogin()}},OnComponentClick:function(){},RememberProductToStore:function(g,d,f,b,a,c){var e=new Object();e.div=g;e.eventtype=d;e.dummy=f;e.successdelegate=b;e.failuredelegate=a;e.waitSpecificationInstance=c;this.favouriteToStore=e},LoginCompletedCallback:function(e){if(e){if(this.favouriteToStore!=null){var c=$find("loginpopupcomponentmodaldialog");if(c!=null){c.Close()}var f=$find("header");if(f!=null){f.SetLoginStatus(true)}var d=this.favouriteToStore;this.favouriteToStore=null;ThomasCook.Ecom.Web.Personalization.StorePackageInProfile(d.div,d.eventtype,d.dummy,d.successdelegate,d.failuredelegate,d.waitSpecificationInstance)}else{var b=$get("loginpopupLogin");if(b!=null){var a=decodeURIComponent(b.getAttribute("url"));if((a!=null)&&(a.length>0)){document.location.href=a}}}}else{show("loginfailure")}},DoLogin:function(){var b=$get("loginname");var a=$get("password");Sys.Services.AuthenticationService.login(b.value,a.value,false,null,null,this.LoginCompletedCallbackDelegate,null,null)},CancelLogin:function(){hide("loginfailure");var a=$find("loginpopupcomponentmodaldialog");if(a!=null){a.Close()}}};Ecom.Personalization.LoginPopup.registerClass("Ecom.Personalization.LoginPopup",Proto.Updater);Ecom.Personalization.LoginRegistration=function(a){Ecom.Personalization.LoginRegistration.initializeBase(this,[a]);this.OnRegisteredDelegate=Function.createDelegate(this,this.OnRegistered);this.OnCancelDelegate=Function.createDelegate(this,this.OnCancel);this.OnTryRegisterDelegate=Function.createDelegate(this,this.OnTryRegister);this.TryChangePasswordDelegate=Function.createDelegate(this,this.TryChangePassword);this.OnPasswordChangedDelegate=Function.createDelegate(this,this.OnPasswordChanged);this.OnTryUpdateDelegate=Function.createDelegate(this,this.OnTryUpdate);this.OnUpdatedDelegate=Function.createDelegate(this,this.OnUpdated);this.AgreeWithNewslettersDelegate=Function.createDelegate(this,this.AgreeWithNewsletters);this.RegisterEventHandler("loginregNewsletterPref","click",false,this.AgreeWithNewslettersDelegate,null,null,null,null);this.OnEnteredEmailAddressDelegate=Function.createDelegate(this,this.OnEnteredEmailAddress);this.OnEnteredLastNameDelegate=Function.createDelegate(this,this.OnEnteredLastName);this.OnEnteredFirstNameDelegate=Function.createDelegate(this,this.OnEnteredFirstName);this.OnPasswordEnteredDelegate=Function.createDelegate(this,this.OnPasswordEntered);this.OnPasswordConfirmationEnteredDelegate=Function.createDelegate(this,this.OnPasswordConfirmationEntered);this.OnGenderSelectedDelegate=Function.createDelegate(this,this.OnGenderSelected);this.RegisterEventHandler("loginregRegister","click",true,this.OnTryRegisterDelegate,this.OnRegisteredDelegate,null,null,null);this.RegisterEventHandler("loginregCancel","click",true,this.OnCancelDelegate,null,null,null,null);this.RegisterEventHandler("loginregSave","click",true,this.OnTryUpdateDelegate,this.OnUpdatedDelegate,null,null,null);this.RegisterEventHandler("loginregChangePassword","click",true,this.TryChangePasswordDelegate,this.OnPasswordChangedDelegate,null,null,null);this.field=$get("loginreg_email");$addHandler(this.field,"blur",this.OnEnteredEmailAddressDelegate);this.field=$get("loginreg_firstName");$addHandler(this.field,"blur",this.OnEnteredFirstNameDelegate);this.field=$get("loginreg_lastName");$addHandler(this.field,"blur",this.OnEnteredLastNameDelegate);this.field=$get("loginreg_password");$addHandler(this.field,"blur",this.OnPasswordEnteredDelegate);this.field=$get("loginreg_passwordRepeat");$addHandler(this.field,"blur",this.OnPasswordConfirmationEnteredDelegate);this.field=$get("loginreg_gender");$addHandler(this.field,"blur",this.OnGenderSelectedDelegate);$addHandler(a,"click",this.OnClickDelegate)};Ecom.Personalization.LoginRegistration.prototype={initialize:function(){},SwitchRegistrationMode:function(b){hideAll("errorContainer");hideAll("passwordchangeerror");hideAll("updateerror");show("loginregistrationcomponentpanel");var a=$get("loginregistrationcomponentmode");if(a!=null){Sys.UI.DomElement.removeCssClass(a,"newsletterChangeMode");Sys.UI.DomElement.removeCssClass(a,"registrationMode");Sys.UI.DomElement.removeCssClass(a,"passwordChangeMode");Sys.UI.DomElement.removeCssClass(a,"updateMode");Sys.UI.DomElement.addCssClass(a,b)}hide("registrationpassword");show("registrationpassword")},OnComponentClick:function(){},AgreeWithNewsletters:function(){var a=$get("loginregNewsletterPref");if(a!=null){if(a.checked){show("loginregNewsletterchoices")}else{hide("loginregNewsletterchoices")}}},OnPasswordChanged:function(a){if(a){hide("passwordchangefailed");show("passwordchangesucceeded")}else{hide("passwordchangesucceeded");show("passwordchangefailed")}},TryChangePassword:function(a,k,n,b,o,e){var g=true;var f="";var j=$get("loginreg_origpassword");var d=$get("loginreg_password");var h=$get("loginreg_passwordRepeat");var l=j.value;var m=d.value;this.UpdateMandatoryFieldIndicator(j,"invalid");this.UpdateMandatoryFieldIndicator(d,"invalid");this.UpdateMandatoryFieldIndicator(h,"invalid");if(l==""||m==""){g=false}if(d.value!=h.value){g=false;var c=$get("errorPassword");if(c!=null){f+=c.innerHTML+"\n"}}if(g==true){ThomasCook.Ecom.Web.Personalization.ChangePassword(m,l,b,o,e)}else{if(f!=""){alert(f)}}},OnTryUpdate:function $Ecom$Personalization$LoginRegistration$OnTryRegister(f,e,d,b,a,c){hide("updatesucceeded");this.OnTryUpdateOrRegister(f,e,d,b,a,c,true)},OnTryRegister:function $Ecom$Personalization$LoginRegistration$OnTryRegister(f,e,d,b,a,c){this.OnTryUpdateOrRegister(f,e,d,b,a,c,false)},OnTryUpdateOrRegister:function $Ecom$Personalization$LoginRegistration$OnTryRegister(l,d,h,r,e,g,k){var v=true;var t="";var n=new ThomasCook.Ecom.Core.Services.Personalization.SubscriberDetails();var f="loginreg";var a=$get(f+"_firstName");var p=$get(f+"_lastName");var o=$get(f+"_gender");this.UpdateMandatoryFieldIndicator(a,"invalid");this.UpdateMandatoryFieldIndicator(p,"invalid");this.UpdateMandatoryFieldIndicator(o,"invalid");var j=$find("loginregbirthdate");var c=$get("registrationErrors");if(null!=c){hideAll("registrationErrors")}if(null!=j){j.Validate()}if(a.value==""||p.value==""||o.value==""||!j.IsValidDate()){v=false}var w=$get("loginreg_email");this.UpdateMandatoryFieldIndicator(w,"invalid");var q="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";if(w.value==""||w.value.toLowerCase().match(q)!=w.value.toLowerCase()){v=false;this.UpdateValidFieldIndicator(w,"invalid",false)}else{this.UpdateValidFieldIndicator(w,"invalid",true)}var u=$get("loginreg_password");var m=$get("loginreg_passwordRepeat");this.UpdateMandatoryFieldIndicator(u,"invalid");this.UpdateMandatoryFieldIndicator(m,"invalid");if(u.value!=m.value){v=false;var b=$get("errorPassword");if(b!=null){t+=b.innerHTML+"\n"}}if(v==true){n.firstName=a.value;n.middleName=$get(f+"_middleName").value;n.lastName=p.value;n.gender=o.value;n.email=$get(f+"_email").value;n.password=$get(f+"_password").value;n.year=$get(f+"birthdate_years").value;n.month=$get(f+"birthdate_months").value;n.day=$get(f+"birthdate_days").value;n.language=$get(f+"_language").value;if(k){ThomasCook.Ecom.Web.Personalization.UpdateRegistration(l,d,n,r,e,g)}else{ThomasCook.Ecom.Web.Personalization.Register(l,d,n,r,e,g)}}else{show("loginregErrorMessage");if(t!=""){alert(t)}}},OnEnteredEmailAddress:function(c){var b=$get("loginreg_email");this.UpdateMandatoryFieldIndicator(b,"invalid");var d="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";var a=false;if(b.value==""||email1.value.toLowerCase().match(d)!=email1.value.toLowerCase()){a=true}this.UpdateInvalidValueIndicator(b,a,"invalid")},OnEnteredLastName:function(b){var a=$get("loginreg_lastName");this.UpdateMandatoryFieldIndicator(a,"invalid")},OnEnteredFirstName:function(b){var a=$get("loginreg_firstName");this.UpdateMandatoryFieldIndicator(a,"invalid")},OnPasswordEntered:function(b){var a=$get("loginreg_password");this.UpdateMandatoryFieldIndicator(a,"invalid")},OnPasswordConfirmationEntered:function(b){var a=$get("loginreg_password");var c=$get("loginreg_passwordRepeat");this.UpdateInvalidValueIndicator(c,(c.value==""||a.value!=c.value),"invalid")},OnGenderSelected:function(b){var a=$get("loginreg_gender");this.UpdateMandatoryFieldIndicator(a,"invalid")},OnRegistered:function(a){if(a=="Success"){this.Redirect("loginregRegister")}else{show(a)}},OnUpdated:function(a){if(a=="Success"){show("updatesucceeded")}else{show(a)}},OnCancel:function(){this.Redirect("loginregCancel")},Redirect:function(c){var b=$get(c);if(b!=null){var a=decodeURIComponent(b.getAttribute("url"));if((a!=null)&&(a.length>0)){document.location.href=a}}}};Ecom.Personalization.LoginRegistration.registerClass("Ecom.Personalization.LoginRegistration",Proto.Updater);Ecom.Personalization.PackageComparer=function(a){Ecom.Personalization.PackageComparer.initializeBase(this,[a]);this.GoToDetailPageDelegate=Function.createDelegate(this,this.GoToDetailPage);this.RemoveFromCompareStateRetrieverDelegate=Function.createDelegate(this,this.RemoveFromCompareStateRetriever);this.OnRemoveFromCompareDelegate=Function.createDelegate(this,this.OnRemoveFromCompare);this.CloseDelegate=Function.createDelegate(this,this.Close);this.RegisterEventHandler("comparedStoredListerItem","click",true,this.GoToDetailPageDelegate,null,null,null,null);this.RegisterEventHandler("removeComparedStoredListerItem","click",true,ThomasCook.Ecom.Web.Personalization.ShowComparison,this.OnRemoveFromCompareDelegate,this.RemoveFromCompareStateRetrieverDelegate,null,null);this.RegisterEventHandler("comparedStoredListerClose","click",true,this.CloseDelegate,null,null,null,null);$addHandler(a,"click",this.OnClickDelegate)};Ecom.Personalization.PackageComparer.prototype={initialize:function(){},OnRemoveFromCompare:function(c,b,a){this.DoPartialUpdate(c.divUpdates);this.Wait(b,false)},RemoveFromCompareStateRetriever:function(d,b){var a=d.target.id;var f=a.indexOf("_");if(f>=0){var g=a.substring(f+1);var e=$get("compareitemcheckbox_"+g);if(e!=null){e.checked=false}}var c=$find("storedListerComponentMain");if(c!=null){return c.GetSelectedItems(d)}return null},Close:function(b){var a=$find("comparepopupmodaldialog");if(a!=null){a.Close()}},GoToDetailPage:function(e){var d=e.split("_");if(d.length>1){var a="comparedStoredListerItemSelect_"+d[1];var c=$get(a);if(c!=null){var b=c.getAttribute("href");if(b!=null&&b!=""){document.location.href=b}}}}};Ecom.Personalization.PackageComparer.registerClass("Ecom.Personalization.PackageComparer",Proto.Updater);