if(typeof App=="undefined"||!App){App={}}App.overlay=function(a){this.init(a)};App.overlay.NAME="ProductOverlay";App.overlay.NS="POL";App.overlay.settings={width:"772px",height:"508px",fixedcenter:false,close:true,draggable:false,zindex:1000,modal:true,visible:false};App.overlay.prototype={init:function(a){this.overlaysettings=App.Y.merge(App.overlay.settings,a);this.owner=a.host;this.overlay=false;if(typeof(a.callback)!="undefined"){this.callback=true;if(this.owner.hasClass("button")){this.button=this.owner;App.CustomEvent.subscribe("DeleteHandler:onDelete",this.checkDeleted,this)}else{this.button=this.owner.ancestor().one("> .button")}this.isSelected=false;if(this.button&&this.button.hasClass("selected")){this.isSelected=true}}else{this.callback=false}this.owner.on("click",this.onClick,this)},iframeclass:function(){if(typeof(this.overlaysettings.iframeclass)!="undefined"){return this.overlaysettings.iframeclass}return""},render:function(){this.overlay=new YAHOO.widget.Panel("overlay"+this.owner._yuid,this.overlaysettings);this.overlay.setBody("<iframe class='"+this.iframeclass()+"' src='"+this.owner.get("href")+"' frameborder='0'></iframe>");this.overlay.render(document.body);try{this.overlay.hideEvent.subscribe(function(){App.CustomEvent.fire("TravelPlan:updated")});if(this.callback){this.overlay.hideEvent.subscribe(App.Y.bind(this.checkselected,this))}}catch(a){App.Y.log(a)}App.CustomEvent.subscribe("Overlay:close",function(){this.overlay.hide()},this)},onClick:function(a){a.preventDefault();if(!this.overlay){this.render()}this.overlay.show();this.overlay.center()},checkDeleted:function(){if(this.isSelected){this.checkselected()}},checkselected:function(){var a=this.owner.get("href");var b=(a.search(/\/\d+\?/)+1);var f=parseInt(a.substr(b,(a.indexOf("?",b)-b)));if(f>0){var c="/Product/ProductInTrip/"+f;var e={on:{success:this.checkSelectedDone},context:this};var d=App.Y.io(c,e)}},checkSelectedDone:function(b,a,c){var d=App.Y.JSON.parse(a.responseText);if(d){if(d.InTrip){this.setSelected(true)}else{this.setSelected(false)}}},setSelected:function(a){if(typeof(a)=="undefined"){a=true}var b=false;if(this.button){if(this.button.ancestor("div.detailedproduct")){b=true}if(a){this.button.addClass("selected");this.isSelected=true;if(b){this.button.set("innerHTML",App.Lang.AddedToTrip)}}else{this.button.removeClass("selected");this.isSelected=false;if(b){this.button.set("innerHTML",App.Lang.AddToTrip)}}}}};App.travelplan=function(a){this.init(a)};App.travelplan.NAME="TravelPlan";App.travelplan.NS="TPN";App.travelplan.prototype={init:function(a){this.owner=a.host;this.refreshUrl=a.refresh;this.productsinplan={};this.onResize();this.initRows();App.CustomEvent.subscribe("DeleteHandler:onDelete",this.refresh,this);App.CustomEvent.subscribe("TravelPlan:updated",this.refresh,this);this.initCloseLink()},initCloseLink:function(){var a=App.Y.one(".day.tip .closelink");if(a){a.on("click",function(b){App.Y.Cookie.set("closeAccomodationTip",1,{path:"/"});b.target.ancestor(".day").setStyle("display","none")})}},initRows:function(){try{this.owner.all(".day.selected").each(function(b){b.plug(App.travelbar)})}catch(a){App.Y.log(a)}try{this.owner.all(".event a.green").each(function(b){b.plug(App.overlay)})}catch(a){App.Y.log(a)}try{this.owner.all(".event a.delete").each(function(b){b.plug(App.DeleteHandler,{row:"div.event"})})}catch(a){App.Y.log(a)}},onResize:function(){var a=parseInt(this.owner.getComputedStyle("height"));var b=parseInt(this.owner.one(".wrapper").getComputedStyle("height"));if(b>a){this.owner.addClass("scroll")}else{this.owner.removeClass("scroll")}},refresh:function(){var b={on:{success:this.getDone},context:this};var a=App.Y.io(this.refreshUrl,b)},getDone:function(b,a,c){if(a.responseText.length>0){this.owner.set("innerHTML",a.responseText);this.initRows();this.onResize();this.initCloseLink();this.updateSelected()}},updateSelected:function(){try{App.Y.one(".popup.addtoplan").each(function(b){})}catch(a){}}};App.travelbar=function(a){this.init(a)};App.travelbar.NAME="TravelBar";App.travelbar.NS="TBE";App.travelbar.prototype={init:function(a){this.owner=a.host;this.header=this.owner.one(".header");this.header.on("click",this.onClick,this)},onClick:function(a){this.owner.toggleClass("expanded");this.owner.ancestor(".travelplan").TPN.onResize()}};App.datepromo=function(a){this.init(a)};App.datepromo.NAME="DatePromo";App.datepromo.NS="DPOP";App.datepromo.settings={visible:false,draggable:false,zIndex:1000,modal:false};App.datepromo.prototype={init:function(a){this.owner=a.host;this.overlaysettings=App.Y.clone(App.datepromo.settings);this.overlay=new YAHOO.widget.Overlay(this.owner.get("id"),this.overlaysettings);this.overlay.render(document.body);this.overlay.cfg.setProperty("context",["calendarcontainer","tl","tr",["beforeShow","windowResize"]]);if(a.show){this.overlay.show()}App.Y.one(".linkbutton_big").on("click",this.onClick,this)},onClick:function(a){var b=App.Calendar.cal.getInterval();if(b.length==0){App.Y.one("#"+this.owner.get("id")).setStyle("display","block");this.overlay.show();a.preventDefault()}}};App.step1promo=function(a){this.init(a)};App.step1promo.NAME="Step1Promo";App.step1promo.NS="SOP";App.step1promo.settings={visible:false,width:"628px",height:"162px",close:true,draggable:false,zIndex:1000,modal:false};App.step1promo.prototype={init:function(b){if(typeof(b.eventDates)!="undefined"){this.dates=b.eventDates}else{this.dates=[]}if(typeof(b.earliest)!="undefined"){this.earliestDates=b.earliest}else{this.earliestDates=[]}this.owner=b.host;this.nr=this.owner.get("id").replace("promo","");var a="infobox"+this.nr;try{this.overlaysettings=App.Y.clone(App.step1promo.settings);this.overlaysettings.contentBox=a;this.overlay=new YAHOO.widget.Overlay(a,this.overlaysettings);this.overlay.render(document.body);this.overlay.cfg.setProperty("context",["calendarcontainer","tl","tr",["beforeShow","windowResize"]])}catch(d){App.Y.log(d)}this.owner.on("click",this.onClick,this);try{App.Y.all("#"+a+" .tasks .popup").each(function(e){e.plug(App.overlay)});App.Y.one("#"+a+" .container-close").on("click",this.closeClick,this)}catch(c){App.Y.log(c)}},onClick:function(a){if(this.owner.hasClass("selected")){this.close()}else{this.open()}a.preventDefault()},close:function(){this.overlay.hide();this.owner.removeClass("selected");this.renderCalDates(false)},open:function(){var a=this.owner.ancestor().one(".selected");if(a){a.SOP.close()}this.overlay.show();this.owner.addClass("selected");this.renderCalDates(true)},renderCalDates:function(a){if(a){App.Calendar.highlights=this.dates;App.Calendar.earliestDates=this.earliestDates}else{App.Calendar.earliestDates=new Date();App.Calendar.highlights=[]}App.Calendar.cal.RenderHighlights()},closeClick:function(a){a.preventDefault();this.close()}};App.searchbar={};App.searchbar.bar=function(a){this.init(a)};App.searchbar.bar.NAME="SearchbarManager";App.searchbar.bar.NS="SBM";App.searchbar.bar.CLASSNAME="selected";App.searchbar.bar.prototype={init:function(a){this.owner=a.host;this.form=this.owner.one("form");this.sortbox=this.owner.one(".dropbox.sort");this.sortselected=this.owner.one("#sortexpand .selected");this.sortkeyname=this.sortbox.one(".sortkey");this.storage=this.owner.one("#searchbarsort");this.storage.set("value",this.sortselected.one(".value").get("innerHTML"));this.owner.all(".dropbox").each(function(b){b.plug(App.searchbar.expandable)});this.owner.all(".searchboxwrapper").each(function(b){b.plug(App.searchbar.field)});this.owner.all("#sortexpand li").on("click",this.clickSort,this);this.owner.one(".linkbutton").on("click",this.submitSearch,this);this.form.on("submit",this.submitSearch,this)},clickSort:function(a){this.sortselected.removeClass("selected");this.sortselected=a.currentTarget;this.sortselected.addClass("selected");this.sortkeyname.set("innerHTML",this.sortselected.one(".text").get("innerHTML"));this.storage.set("value",this.sortselected.one(".value").get("innerHTML"));this.sortbox.SBE.collapse();a.preventDefault();this.submitSearch()},submitSearch:function(f){this.owner.all(".dropbox").each(function(e){e.SBE.collapse()});var c=this.form.get("id");var d=this.form.get("action");var a={method:"POST",form:{id:c},on:{success:this.onSuccess},context:this};var b=App.Y.io(d,a);if(f){f.preventDefault()}},onSuccess:function(a,b,c){App.CustomEvent.fire("Searchbar:updated")}};App.searchbar.expandable=function(a){this.init(a)};App.searchbar.expandable.NAME="SearchbarExpander";App.searchbar.expandable.NS="SBE";App.searchbar.expandable.CLASSNAME="selected";App.searchbar.expandable.prototype={init:function(a){this.owner=a.host;this.expanded=false;this.owner.on("click",this.onClick,this);App.Y.one("body").on("click",this.onOutsideClick,this)},expand:function(){this.owner.addClass(App.searchbar.expandable.CLASSNAME);this.expanded=true},setOutsideClick:function(){this.outside=App.Y.one("body").on("click",this.onOutsideClick,this)},collapse:function(){this.expanded=false;this.owner.removeClass(App.searchbar.expandable.CLASSNAME)},onOutsideClick:function(a){if(this.owner.contains(a.target)){}else{this.collapse()}},onClick:function(b){var a=b.target.ancestor(".expand");if(a){}else{if(this.owner.hasClass(App.searchbar.expandable.CLASSNAME)){b.preventDefault();this.collapse()}else{b.preventDefault();this.expand();this.setOutsideClick()}}}};App.searchbar.field=function(a){this.init(a)};App.searchbar.field.NAME="SearchbarFieldPlaceholder";App.searchbar.field.NS="SFP";App.searchbar.field.prototype={init:function(a){this.owner=a.host;this.owner.on("click",this.hide,this);this.field=this.owner.one("input");this.placeholder=this.owner.one(".placeholder");this.shown=true;this.field.on("focus",this.hide,this);this.field.on("blur",this.show,this);if(this.field.get("value").length>0){this.hide()}},hide:function(a){if(this.shown){this.placeholder.setStyle("display","none");this.field.focus();this.shown=false}},show:function(a){if(this.field.get("value")==0&&!this.shown){this.placeholder.setStyle("display","block");this.shown=true}}};App.promoscroll=function(a){this.init(a)};App.promoscroll.NAME="PromotionScroller";App.promoscroll.NS="PS";App.promoscroll.prototype={init:function(c){this.owner=c.host;this.list=this.owner.one("ul");var b=this.list.one("li");if(b.next()){this.scrollwidth=b.next().getX()-b.getX()}else{this.scrollwidth=0}this.leftContainer=this.owner.one(".left");this.rightContainer=this.owner.one(".right");this.leftIcon=this.leftContainer.one(".icon");this.rightIcon=this.rightContainer.one(".icon");this.leftIcon.on("click",this.left,this);this.rightIcon.on("click",this.right,this);this.itemcount=this.list.all("li").size();var a=parseInt(this.owner.getComputedStyle("width"));this.itemsinview=Math.floor(a/this.scrollwidth);this.maxwidth=(this.itemcount-this.itemsinview)*this.scrollwidth;this.animation=new App.Y.Anim({node:this.list,duration:0.5});this.setDisabled()},left:function(a){this.scroll(this.scrollwidth);a.preventDefault()},right:function(a){this.scroll(-this.scrollwidth);a.preventDefault()},scroll:function(b){var c=parseInt(this.list.getStyle("left"));var a=c+b;if(a>0||a<(-this.maxwidth)){}else{this.animation.set("to",{left:a});this.animation.run();this.setDisabled(a)}},setDisabled:function(a){if(typeof(a)=="undefined"){var a=parseInt(this.list.getStyle("left"))}if(isNaN(a)||a>=0){this.leftContainer.addClass("disabled")}else{this.leftContainer.removeClass("disabled")}if(a<=-this.maxwidth){this.rightContainer.addClass("disabled")}else{this.rightContainer.removeClass("disabled")}}};App.Calendar={};App.Calendar.Extends={};App.Calendar.highlights=[];App.Calendar.prevhighlights=[];(function(){function b(c,d){this._iState=0;d=d||{};d.multi_select=true;this.promoDate=App.Y.one("#datepromo");b.superclass.constructor.call(this,c,d);this.beforeSelectEvent.subscribe(this._intervalOnBeforeSelect,this,true);this.selectEvent.subscribe(this._intervalOnSelect,this,true);this.beforeDeselectEvent.subscribe(this._intervalOnBeforeDeselect,this,true);this.deselectEvent.subscribe(this._intervalOnDeselect,this,true);this.datesChangedEvent=new YAHOO.util.CustomEvent("datesChangedEvent",this)}b._DEFAULT_CONFIG=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;try{YAHOO.lang.extend(b,YAHOO.widget.Calendar,{_dateString:function(f){var e=[];e[this.cfg.getProperty(b._DEFAULT_CONFIG.MDY_YEAR_POSITION.key)-1]=f.getFullYear();e[this.cfg.getProperty(b._DEFAULT_CONFIG.MDY_MONTH_POSITION.key)-1]=(f.getMonth()+1);e[this.cfg.getProperty(b._DEFAULT_CONFIG.MDY_DAY_POSITION.key)-1]=f.getDate();var c=this.cfg.getProperty(b._DEFAULT_CONFIG.DATE_FIELD_DELIMITER.key);return e.join(c)},_dateIntervalString:function(e,d){var c=this.cfg.getProperty(b._DEFAULT_CONFIG.DATE_RANGE_DELIMITER.key);return(this._dateString(e)+c+this._dateString(d))},getInterval:function(){var c=this.getSelectedDates();if(c.length>0){var e=c[0];var d=c[c.length-1];return[e,d]}else{return[]}},setInterval:function(f,g){var e=(f<=g);var d=e?f:g;var c=e?g:f;this.cfg.setProperty("selected",this._dateIntervalString(d,c),false);this._iState=2},resetInterval:function(){this.cfg.setProperty("selected",[],false);this._iState=0},_intervalOnBeforeSelect:function(e,d,c){this._iState=(this._iState+1)%3;if(this._iState==0){this.deselectAll();this._iState++}},_intervalOnSelect:function(g,f,e){var d=this.getSelectedDates();if(d.length>1){var c=d[0];var h=d[d.length-1];this.cfg.setProperty("selected",this._dateIntervalString(c,h),false)}this.render();this.RenderHighlights();if(this.promoDate){this.promoDate.setStyle("display","none")}},_intervalOnBeforeDeselect:function(e,d,c){if(this._iState!=0){return false}},_intervalOnDeselect:function(i,g,f){if(this._iState!=0){this._iState=0;this.deselectAll();var h=g[0];var e=YAHOO.widget.DateMath.getDate(h[0],h[1]-1,h[2]);var c=this.getCalendarPage(e);if(c){c.beforeSelectEvent.fire();this.cfg.setProperty("selected",this._dateString(e),false);c.selectEvent.fire([h])}return false}},RenderHighlights:function(){for(var c=0;c<App.Calendar.prevhighlights.length;c++){App.Calendar.prevhighlights[c].removeClass("highlight");App.Calendar.prevhighlights[c].removeClass("selectedhighlight")}if(App.Calendar.highlights.length>0){if(App.Calendar.cal.isDateOOM(App.Calendar.earliestDates)){App.Calendar.cal.setYear(App.Calendar.earliestDates.getFullYear());App.Calendar.cal.setMonth(App.Calendar.earliestDates.getMonth());App.Calendar.cal.render()}}for(var c=0;c<App.Calendar.highlights.length;c++){var d=this.getCellIndex(App.Calendar.highlights[c]);if(d>=0){var f="#"+this.id+"_cell"+d;var e=App.Y.one(f);if(e){App.Calendar.prevhighlights.push(e);e.addClass("highlight");if(e.hasClass("selected")){e.addClass("selectedhighlight")}}}}},RenderHighlightsChangeMonth:function(){for(var c=0;c<App.Calendar.prevhighlights.length;c++){App.Calendar.prevhighlights[c].removeClass("highlight");App.Calendar.prevhighlights[c].removeClass("selectedhighlight")}for(var c=0;c<App.Calendar.highlights.length;c++){var d=this.getCellIndex(App.Calendar.highlights[c]);if(d>=0){var f="#"+this.id+"_cell"+d;var e=App.Y.one(f);if(e){App.Calendar.prevhighlights.push(e);e.addClass("highlight");if(e.hasClass("selected")){e.addClass("selectedhighlight")}}}}}})}catch(a){}App.Calendar.Extends.IntervalCalendar=b})();App.Calendar.MakeCalendar=function(e){var g={};var f={};var c={};var b={};var d={};g["sv-SE"]=["S�ndag","M�ndag","Tisdag","Onsdag","Torsdag","Fredag","L�rdag"];f["sv-SE"]=["S�n","M�n","Tis","Ons","Tors","Fre","L�r"];c["sv-SE"]=["S�","M�","Ti","On","To","Fr","L�"];b["sv-SE"]=["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];d["sv-SE"]=["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"];g["nb-NO"]=["S�ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L�rdag"];f["nb-NO"]=["S�n","Man","Tir","Ons","Tor","Fre","L�r"];c["nb-NO"]=["S�","Ma","Ti","On","To","Fr","L�"];b["nb-NO"]=["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"];d["nb-NO"]=["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"];g["de-DE"]=["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"];f["de-DE"]=["So","Mo","Di","Mi","Do","Fr","Sa"];c["de-DE"]=["So","Mo","Di","Mi","Do","Fr","Sa"];b["de-DE"]=["Januar","Februar","M�rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];d["de-DE"]=["Jan","Feb","M�r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"];try{App.Calendar.cal=new App.Calendar.Extends.IntervalCalendar("calendarcontainer");App.Calendar.cal.cfg.setProperty("multi_select",true);App.Calendar.cal.cfg.setProperty("show_weekdays",true);App.Calendar.cal.cfg.setProperty("start_weekday",1);App.Calendar.cal.cfg.setProperty("mindate",App.Calendar.cal.today);if(typeof(e)!="undefined"&&typeof(g[e])!="undefined"){App.Calendar.cal.cfg.setProperty("WEEKDAYS_LONG",g[e]);App.Calendar.cal.cfg.setProperty("WEEKDAYS_MEDIUM",f[e]);App.Calendar.cal.cfg.setProperty("WEEKDAYS_SHORT",c[e]);App.Calendar.cal.cfg.setProperty("MONTHS_LONG",b[e]);App.Calendar.cal.cfg.setProperty("MONTHS_SHORT",d[e])}App.Calendar.cal.render();App.Calendar.cal.selectEvent.subscribe(function(){interval=this.getInterval();if(interval.length==2){inDate=interval[0];inTxt=inDate.getFullYear()+"-"+(inDate.getMonth()+1)+"-"+inDate.getDate();if(interval[0].getTime()!=interval[1].getTime()){outDate=interval[1];outTxt=outDate.getFullYear()+"-"+(outDate.getMonth()+1)+"-"+outDate.getDate()}else{outDate=inDate;outTxt=outDate.getFullYear()+"-"+(outDate.getMonth()+1)+"-"+outDate.getDate()}App.Y.one("#startdate").set("value",inTxt);App.Y.one("#enddate").set("value",outTxt);this.datesChangedEvent.fire()}},App.Calendar.cal,true);App.Calendar.cal.changePageEvent.subscribe(App.Calendar.cal.RenderHighlightsChangeMonth,App.Calendar.cal,true)}catch(a){App.Y.log(a)}};App.linkoverlay=function(a){this.init(a)};App.linkoverlay.NAME="LinkMap";App.linkoverlay.NS="LIMP";App.linkoverlay.settings={width:"582px",fixedcenter:false,close:true,draggable:false,zindex:1000,modal:true,visible:false};App.linkoverlay.prototype={init:function(a){if(typeof(a.links)!="undefined"){this.owner=a.links}else{this.owner=a.host}this.overlayid=a.overlay;this.settings=App.Y.clone(App.linkoverlay.settings);if(a.callback){this.callback=a.callback}if(a.nocallback){this.nocallback=a.nocallback}this.settings.hideaftersubmit=false;if(typeof(a.reload)!="undefined"&&a.reload){this.reload=true}else{this.reload=false}if(this.overlayid){this.makeOverlay()}this.overlayContainer=App.Y.one("#"+this.overlayid);this.questionStore=this.overlayContainer.one("input.questionstorage");this.messageBox=this.overlayContainer.one("textarea");this.optionalTrigger=this.overlayContainer.one("input.optionaltrigger");this.errorStore=this.overlayContainer.one("p.error");this.reloadIfSingleButtton=false;if(a.reloadIfSingleButtton){this.reloadIfSingleButtton=true;var b=this.overlayContainer.all("div.linkbutton");if(b.size()==1){delete (this.callback);this.reload=true;delete (this.questionStore)}}this.bindEvents()},makeOverlay:function(){this.dialog=new YAHOO.widget.Dialog(this.overlayid,this.settings);this.dialog.render(document.body);this.dialog.cfg.setProperty("hideaftersubmit",false)},bindEvents:function(){this.owner.on("click",this.onClick,this);this.overlayContainer.all("div.linkbutton").on("click",this.submitClick,this);var a=this.overlayContainer.all("input");if(a){a.on("keypress",this.listenToEnter,this)}if(this.messageBox){this.initMessageBox();this.messageBox.on("keyup",this.messageType,this)}if(this.optionalTrigger){this.optionalTrigger.on("change",this.optionalChange,this);this.optionalChange()}},initMessageBox:function(){this.messageContainer=this.overlayContainer.one("div.emailtext");this.personalMessage=App.Y.Node.create("<div></div>");this.emailMessage=this.messageContainer.get("innerHTML");this.emailMessage=this.emailMessage.substring(0,this.emailMessage.indexOf("#message#"));this.messageContainer.set("innerHTML",this.emailMessage);this.messageContainer.appendChild(this.personalMessage)},messageType:function(c){var b=this.messageBox.get("value");if(b.length>255){b=b.substring(0,255);this.messageBox.set("value",b)}b=b.replace(/\n/g,"<br />");this.personalMessage.set("innerHTML",b);var a=Math.ceil(parseInt(this.personalMessage.getComputedStyle("height"))+10);if(a<40){a=40}this.messageBox.setStyle("height",a+"px")},optionalChange:function(a){if(this.optionalTrigger.get("checked")){this.overlayContainer.all("label.optional").setStyle("display","block")}else{this.overlayContainer.all("label.optional").setStyle("display","none")}this.dialog.center()},onClick:function(a){this.show();a.preventDefault()},show:function(){this.dialog.show();this.dialog.center()},listenToEnter:function(a){if(a.charCode==13){this.dialogSubmit(a);a.preventDefault()}},submitClick:function(b){if(b.currentTarget.hasClass("loading")){b.preventDefault();return}this.overlayContainer.all("div.linkbutton").addClass("loading");var a=App.Y.Node.create("<span></span>");a.addClass("loader");b.currentTarget.appendChild(a);this.dialogSubmit(b);b.preventDefault()},dialogSubmit:function(b){try{delete (this.dialog.callback.success);if(this.reload){this.dialog.callback.success=App.Y.bind(this.reloadCallback,this)}else{if(this.questionStore){if(b.currentTarget.hasClass("yes")){this.questionStore.set("value",1);if(this.callback){this.dialog.callback.success=App.Y.bind(this.yesCallback,this)}}else{if(this.nocallback){this.dialog.callback.success=App.Y.bind(this.noCallback,this)}else{if(this.reloadIfSingleButtton){this.dialog.callback.success=App.Y.bind(this.reloadCallback,this)}}this.questionStore.set("value",0)}}else{this.dialog.callback.success=App.Y.bind(this.doCallback,this)}}if(!this.dialog.callback.success){this.dialog.callback.success=App.Y.bind(this.closeCallback,this)}this.dialog.submit()}catch(a){App.Y.log(a)}},closeCallback:function(a){this.dialog.hide()},yesCallback:function(a){this.dialog.hide();if(this.callback){this.callback()}},noCallback:function(a){this.dialog.hide();if(this.nocallback){this.nocallback()}},doCallback:function(b){var a=App.Y.JSON.parse(b.responseText);if(a&&a.Success&&this.callback){this.dialog.hide();this.callback()}else{if(typeof(a.Error)!="undefined"){if(this.errorStore){this.errorStore.set("innerHTML",a.Error);this.errorStore.setStyle("display","block")}}}},reloadCallback:function(b){var a=App.Y.JSON.parse(b.responseText);if(a&&a.Success){this.overlayContainer.all("div.linkbutton").removeClass("loading");this.dialog.hide();window.location.reload()}else{if(typeof(a.Error)!="undefined"){if(this.errorStore){this.errorStore.set("innerHTML",a.Error);this.errorStore.setStyle("display","block")}}}}};App.langtoggle=function(a){this.init(a)};App.langtoggle.NAME="LangToggle";App.langtoggle.NS="LANG";App.langtoggle.prototype={init:function(a){this.owner=a.host;this.lang=this.owner.get("name");this.owner.on("click",this.onClick,this)},onClick:function(a){YAHOO.util.Cookie.set("lang",this.lang,{path:"/"});a.preventDefault();window.location.reload()}};App.TripVoter=function(a){this.init(a)};App.TripVoter.NAME="TripVoter";App.TripVoter.NS="TVTR";App.TripVoter.prototype={init:function(a){this.owner=a.host;this.status=this.owner.next(".othervotes");this.tripId=parseInt(this.owner.one(".tripid").get("innerHTML"));this.upcount=this.status.one(".upvotes .count");this.downcount=this.status.one(".downvotes .count");var b=this.owner.one(".vote.selected");this.votecount=false;if(b){if(b.hasClass("voteup")){this.votecount=this.upcount}else{if(b.hasClass("votedown")){this.votecount=this.downcount}}}this.initEvents()},initEvents:function(){this.voters=this.owner.all(".vote");this.voters.on("click",this.onClick,this)},onClick:function(d){try{this.vote=false;this.voteNode=d.currentTarget;if(d.currentTarget.hasClass("voteup")){this.vote="up"}else{if(d.currentTarget.hasClass("votedown")){this.vote="down"}}if(this.vote){var b={method:"POST",data:"vote="+this.vote+"&id="+this.tripId,on:{success:this.afterVote},context:this};this.beforeVote();d.currentTarget.addClass(this.vote+"waiting");var c=App.Y.io(d.currentTarget.get("href"),b)}}catch(a){}d.preventDefault()},beforeVote:function(){this.voters.removeClass("selected");if(this.votecount){var a=parseInt(this.votecount.get("innerHTML"))-1;if(a<=0){a=0;this.votecount.ancestor(".votestatus").addClass("disabled")}else{this.votecount.ancestor(".votestatus").removeClass("disabled")}this.votecount.set("innerHTML",a)}},afterVote:function(b,a,c){this.voteNode.removeClass(this.vote+"waiting");this.voteNode.addClass("selected");if(this.vote=="up"){this.votecount=this.upcount}else{this.votecount=this.downcount}var d=parseInt(this.votecount.get("innerHTML"))+1;this.votecount.ancestor(".votestatus").removeClass("disabled");this.votecount.set("innerHTML",d)}};App.AttendVoter=function(a){this.init(a)};App.AttendVoter.NAME="AttendVoter";App.AttendVoter.NS="ATVT";App.AttendVoter.prototype={init:function(a){this.owner=a.host;this.thanks=this.owner.one("#voterthanks");this.owner.all("li").on("click",this.onClick,this);if(this.thanks){this.thanks.all(".closelink").on("click",this.closeThanks,this)}},onClick:function(d){this.owner.all("li").removeClass("selected");var a=false;if(d.currentTarget.hasClass("yes")){a="yes"}else{if(d.currentTarget.hasClass("no")){a="no"}else{a="maybe"}}if(this.thanks){this.thanks.setStyle("height","0px");this.thanks.all(".inner div").setStyle("display","none");this.thanks.one("."+a).setStyle("display","block")}d.currentTarget.addClass("selected");var b={method:"POST",data:"vote="+a,on:{success:this.afterVote},context:this};var c=App.Y.io(d.currentTarget.one("a").get("href"),b);d.preventDefault()},closeThanks:function(a){if(parseInt(this.thanks.getComputedStyle("height"))>0){this.anim.setAtts({to:{height:0}});this.anim.run()}if(a){a.preventDefault()}},afterVote:function(b,a,d){if(this.thanks){var e=this.thanks.one(".inner");var c=parseInt(e.getComputedStyle("height"))+parseInt(e.getStyle("paddingTop"))+parseInt(e.getStyle("paddingBottom"))+5;if(!this.anim){this.anim=new App.Y.Anim({node:this.thanks,to:{height:c},easing:App.Y.Easing.bounceOut})}else{this.anim.setAtts({to:{height:c}})}this.anim.run()}}};App.AvailTable=function(a){this.init(a)};App.AvailTable.Name="AvailTable";App.AvailTable.NS="AVT";App.AvailTable.prototype={init:function(a){this.owner=a.host;this.table=this.owner.ancestor("table");this.form=this.owner.ancestor("form");this.checkbox=this.owner.one('input[type="checkbox"]');this.owner.on("click",this.onClick,this)},onClick:function(d){if(this.owner.hasClass("inactive")){return}var a=this.owner.one(".occasionValue");if(this.owner.hasClass("selected")){this.owner.removeClass("selected");a.set("value","0")}else{this.owner.addClass("selected");a.set("value","1")}this.updateTrip();var b=App.Y.one("#addtotravelplan");var c=App.Y.one("#addedtotrip");if(this.table.all("tr.selected")){if(c){c.setStyle("display","block")}}else{if(c){c.setStyle("display","none")}}if(typeof(pageTracker)!="undefined"){pageTracker._trackPageview("/Products/AddedToTrip")}d.preventDefault()},updateTrip:function(){var d=this.form.get("action");var c=this.form.get("id");var a={method:"POST",form:{id:c},on:{complete:this.tripUpdated},context:this};var b=App.Y.io(d,a)},tripUpdated:function(b,c,a){if(this.owner.hasClass("selected")){this.checkbox.set("checked",true)}else{this.checkbox.set("checked",false)}this.table.all('tr input[type="checkbox"]').set("checked",false);this.table.all('tr.selected input[type="checkbox"]').set("checked",true)}};App.formmonitor=function(a){this.init(a)};App.formmonitor.NAME="FormMonitor";App.formmonitor.NS="FMT";App.formmonitor.prototype={init:function(a){this.owner=a.host;this.owner.all("input").on("change",this.onChange,this);App.Calendar.cal.datesChangedEvent.subscribe(this.onChange,this,true)},onChange:function(a){this.run()},run:function(){var c=App.Y.one("#whenform").get("action");var b={method:"POST",form:{id:"whenform"}};var a=App.Y.io(c,b)}};App.AccommodationForm=function(a){this.init(a)};App.AccommodationForm.NAME="AccomodationForm";App.AccommodationForm.NS="ACF";App.AccommodationForm.prototype={init:function(a){this.owner=a.host;this.form=this.owner.one("form");this.pid=this.form.one("#search_pid");this.datefrom=this.form.one("#search_datefrom");this.dateto=this.form.one("#search_dateto");this.pr=this.form.one("#search_pr");if(this.owner.all("input[type=radio]")){this.owner.all("input[type=radio]").on("click",this.eventChange,this);this.owner.all("select").on("change",this.populationChange,this);this.owner.one(".linkbutton").on("click",this.onClick,this);this.form.on("submit",this.showLoading,this);this.populationChange()}},onClick:function(a){App.Y.one("#BookIframe").IFW.showLoading();this.form.submit()},eventChange:function(c){var a=c.currentTarget.get("value");var b=a.split(";");this.pid.set("value",b[0]);this.datefrom.set("value",b[1]);this.dateto.set("value",b[2])},populationChange:function(c){this.owner.one("#options_rooms");var b="";var a=this.owner.one("#options_rooms").get("value");this.owner.all(".roomwrapper").each(function(g){var e=parseInt(g.get("id").replace("roomwrapper",""));if(e<=a){g.addClass("expanded");if(b.length>0){b+="r"}b+=g.one(".adults").get("value")}else{g.removeClass("expanded")}var f=g.one(".children").get("value");var d="agecontainer_"+e+"_";if(f>0){b+="a"}g.all(".age").each(function(h){var i=parseInt(h.get("id").replace(d,""));if(i<=f){h.addClass("expanded");if(i>1){b+="c"}b+=h.one("select").get("value")}else{h.removeClass("expanded")}})});this.pr.set("value",b);this.onResize()},onResize:function(){var a=parseInt(this.owner.getComputedStyle("height"));var b=parseInt(this.owner.one(".wrapper").getComputedStyle("height"));if(b>a){this.owner.addClass("scroll")}else{this.owner.removeClass("scroll")}}};App.IframeWatcher=function(a){this.init(a)};App.IframeWatcher.NAME="IframeWatcher";App.IframeWatcher.NS="IFW";App.IframeWatcher.prototype={init:function(a){this.owner=a.host;this.owner.on("load",this.loadingDone,this);App.Y.all("a.iframeloading").on("click",this.showLoading,this)},showLoading:function(){App.Y.one("#BookTicker").setStyle("display","block");App.Y.one("#content").removeClass("result");App.Y.one("#content").addClass("searching")},loadingDone:function(a){App.Y.one("#BookTicker").setStyle("display","none");App.Y.one("#content").removeClass("searching");App.Y.one("#content").addClass("result")}};App.MapHandler=function(a){this.init(a)};App.MapHandler.NAME="MapHandler";App.MapHandler.NS="Map";App.MapHandler.prototype={init:function(a){this.owner=a.host;this.form=App.Y.one("#mapdata");this.maxLat=App.Y.one("#maxLat");this.maxLong=App.Y.one("#maxLong");this.minLat=App.Y.one("#minLat");this.minLong=App.Y.one("#minLong");this.pins=[];if(typeof(a.noupdate)=="undefined"||a.noupdate==false){YEvent.Capture(App.Map,EventsList.changeZoom,this.mapUpdated,this);YEvent.Capture(App.Map,EventsList.endPan,this.mapUpdated,this);YEvent.Capture(App.Map,EventsList.endAutoPan,this.mapUpdated,this);App.CustomEvent.subscribe("TravelPlan:updated",this.mapUpdated,this);App.CustomEvent.subscribe("Searchbar:updated",this.mapUpdated,this);this.mapUpdated()}},clear:function(){var a=this.pins.pop();while(a){a.MP.remove();a=this.pins.pop()}},mapUpdated:function(a){var b=App.Map.getBoundsLatLon();this.maxLat.set("value",b.LatMax);this.maxLong.set("value",b.LonMax);this.minLat.set("value",b.LatMin);this.minLong.set("value",b.LonMin);this.refresh()},refresh:function(){var d=this.form.get("action");var b={method:"POST",form:{id:"mapdata"},on:{success:this.onRefreshRequest},context:this};try{var c=App.Y.io(d,b)}catch(a){App.Y.log(a)}},onRefreshRequest:function(f,c,d){var a=App.Y.JSON.parse(c.responseText);if(a){this.clear();var g=[];try{for(var b=0;b<a.Products.length;b++){if(a.Products[b].IsInTrip){g.push(a.Products[b])}else{this.MakeMapPin(a.Products[b].Long,a.Products[b].Lat,a.Products[b].MainCategory,a.Products[b].Name,a.Products[b].Category,a.Products[b].ProductUrl,a.Products[b].IsInTrip,a.Products[b].img,a.Products[b].CssOption)}}}catch(h){App.Y.log(h)}for(var b=0;b<g.length;b++){this.MakeMapPin(g[b].Long,g[b].Lat,g[b].MainCategory,g[b].Name,g[b].Category,g[b].ProductUrl,g[b].IsInTrip,g[b].imgs,aveforlater[b].CssOption)}}},MakeMapPin:function(k,a,p,d,i,m,f,j,h){var o=YUtility.createNode("div");o.className="pin "+p;if(typeof(f)!="undefined"&&f){o.className=o.className+" selected"}if(typeof(h)!="undefined"){o.className=o.className+" "+h}var r=YUtility.createNode("div");r.className="overlay";var l=YUtility.createNode("div");l.className="bubblecorner";var c=YUtility.createNode("div");c.className="icon";var n=YUtility.createNode("img");n.src=j;var e=YUtility.createNode("p");e.innerHTML=d;var s=YUtility.createNode("p");s.className="desc";s.innerHTML=i;var u=new YGeoPoint(a,k);var t=new YCustomOverlay(u);YUtility.appendNode(r,n);YUtility.appendNode(r,e);YUtility.appendNode(r,s);if(m){var g=YUtility.createNode("p");g.className="moreinfo";g.innerHTML=App.Lang.ClickForMoreInfo;YUtility.appendNode(r,g)}var q=YUtility.createNode("p");q.className="moreinfoadded";q.innerHTML=App.Lang.AddedToTrip;YUtility.appendNode(r,g);YUtility.appendNode(r,l);YUtility.appendNode(o,c);YUtility.appendNode(o,r);YUtility.appendNode(t,o);App.Map.addOverlay(t);var b=App.Y.one(o);b.plug(App.MapPin,{url:m});this.pins.push(b)}};App.MapPin=function(a){this.init(a)};App.MapPin.NAME="MapPin";App.MapPin.NS="MP";App.MapPin.prototype={init:function(a){this.overlaysettings=App.Y.clone(App.overlay.settings);this.owner=a.host;this.url=a.url;this.overlay=false;this.owner.on("mouseover",this.onHover,this);this.owner.on("mouseout",this.onLeave,this);this.owner.on("click",this.onClick,this)},onHover:function(a){this.owner.addClass("hover")},onLeave:function(a){this.owner.removeClass("hover")},render:function(){this.overlay=new YAHOO.widget.Panel("overlay"+this.owner._yuid,this.overlaysettings);this.overlay.setBody("<iframe src='"+this.url+"' frameborder='0'></iframe>");this.overlay.render(document.body);this.overlay.hideEvent.subscribe(function(){App.CustomEvent.fire("TravelPlan:updated")});App.CustomEvent.subscribe("Overlay:close",function(){this.overlay.hide()},this)},show:function(){if(!this.overlay){this.render()}this.overlay.show();this.overlay.center()},onClick:function(a){if(this.url){this.show()}a.preventDefault()},remove:function(){this.owner.ancestor().removeChild(this.owner)}};App.FormSubmitAndGo=function(a){this.init(a)};App.FormSubmitAndGo.NAME="FormSubmitAndGo";App.FormSubmitAndGo.NS="FSAG";App.FormSubmitAndGo.prototype={init:function(a){this.locked=false;this.owner=a.host;this.form=this.owner.ancestor("form");this.clickurl=this.owner.get("href");this.owner.on("click",this.onClick,this);this.form.on("submit",this.formSubmit,this);this.fields=this.form.all("input");if(this.fields){this.fields.on("keypress",this.listenToEnter,this)}},onClick:function(a){if(this.locked){a.preventDefault();return}this.locked=true;this.clickurl=a.currentTarget.get("href");this.submitForm();a.preventDefault()},validateForm:function(){var b=true;try{this.form.all("input.mandatory").each(function(c){if(c.get("value").length<2){b=false}})}catch(a){}this.formok=b;if(!this.formok){try{this.form.one("#fieldmissing").setStyle("display","block")}catch(a){}}else{try{this.form.one(".error").setStyle("display","none")}catch(a){}}},listenToEnter:function(a){if(a.charCode==13){this.submitForm();a.preventDefault()}},formSubmit:function(a){this.submitForm();a.preventDefault()},submitForm:function(){this.validateForm();if(this.formok){this.addLoading();var d=this.form.get("action");var c=this.form.get("id");var a={method:"POST",form:{id:c},on:{success:this.onFormSubmitted},context:this};var b=App.Y.io(d,a)}else{this.locked=false}},addLoading:function(){this.owner.ancestor().addClass("loading");var a=App.Y.Node.create("<span></span>");a.addClass("loader");this.owner.appendChild(a)},onFormSubmitted:function(d,b,c){try{var a=App.Y.JSON.parse(b.responseText)}catch(f){}if(typeof(a)!="undefined"&&typeof(a.Success)!="undefined"&&a.Success&&this.clickurl){window.location=this.clickurl}else{try{if(typeof(a.Error)=="string"&&a.Error!=null){if(this.form.one(".errormessage")){this.form.one(".errormessage_text").set("innerHTML",a.Error);this.form.one(".errormessage").addClass("show")}}}catch(g){App.Y.log(g)}}}};App.DeleteHandler=function(a){this.init(a)};App.DeleteHandler.NAME="DeleteHandler";App.DeleteHandler.NS="DH";App.DeleteHandler.prototype={init:function(a){try{this.owner=a.host;if(typeof(a.row)!="undefined"){this.rowident=a.row}else{this.rowident="tr"}this.row=this.owner.ancestor(this.rowident);this.parent=this.row.ancestor();if(a.confirm){this.confirm=a.confirm}else{this.confirm=false}this.owner.on("click",this.onClick,this)}catch(b){App.Y.log(b)}},onClick:function(a){if(this.confirm!=false){if(typeof(this.mySimpleDialog)=="undefined"){this.mySimpleDialog=new YAHOO.widget.SimpleDialog("confirmdialog"+this.owner._yuid,{fixedcenter:false,modal:true,visible:true,draggable:false,close:false,zIndex:100,width:"300px"});this.mySimpleDialog.setHeader("<h2>"+App.Lang.ConfirmDialogHeader+"</h2>");this.mySimpleDialog.setBody(this.confirm);this.mySimpleDialog.setFooter("<div class='linkbutton yes'><a href='#'>"+App.Lang.ConfirmDialogYes+"<span class='side'></span></a></div><div class='linkbutton no'><a href='#'>"+App.Lang.ConfirmDialogNo+"<span class='side'></span></a></div>");this.mySimpleDialog.render(document.body);App.Y.one("#confirmdialog"+this.owner._yuid).addClass("inviteoverlay confirmoverlay");App.Y.one("#confirmdialog"+this.owner._yuid+" .yes").on("click",this.handleYes,this);App.Y.one("#confirmdialog"+this.owner._yuid+" .no").on("click",this.handleNo,this)}this.mySimpleDialog.show();this.mySimpleDialog.center()}else{this.deleteRow()}a.preventDefault()},handleYes:function(a){this.mySimpleDialog.hide();this.deleteRow();a.preventDefault()},handleNo:function(a){this.mySimpleDialog.hide();a.preventDefault()},deleteRow:function(){var a=this.owner.get("href");var c={method:"get",on:{complete:this.deleted},context:this};try{var d=App.Y.io(a,c)}catch(b){App.Y.log(b)}},deleted:function(){var a=this.owner.ancestor(this.rowident);this.parent.removeChild(a);App.CustomEvent.fire("DeleteHandler:onDelete");try{this.reindexRows()}catch(b){App.Y.log(b)}},reindexRows:function(){var a=1;if(this.rowident=="tr"){this.parent.all("tr").each(function(b){if(a%2==0){b.addClass("even");b.removeClass("odd")}else{b.removeClass("even");b.addClass("odd")}a++})}}};App.SelectAll=function(a){this.init(a)};App.SelectAll.NAME="SelectAll";App.SelectAll.NS="SELALL";App.SelectAll.prototype={init:function(a){this.owner=a.host;this.owner.on("click",this.onChange,this);var b=this.owner.get("name");this.checkboxes=App.Y.all("input."+b+"select");this.checkboxes.each(function(c){c.on("click",this.setStatusFromBoxes,this)},this);this.setStatusFromBoxes()},onChange:function(a){this.setBoxes(this.owner.get("checked"))},setBoxes:function(a){this.checkboxes.each(function(b){b.set("checked",a)});App.Y.one("#whenform").FMT.run()},setStatusFromBoxes:function(c){var a=this.checkboxes.size();var b=0;this.checkboxes.each(function(d){if(d.get("checked")){b++}});if(a==b){this.owner.set("checked",true)}else{this.owner.set("checked",false)}}};App.PopupScroller=function(a){this.init(a)};App.PopupScroller.NAME="PopupScroller";App.PopupScroller.NS="PSCH";App.PopupScroller.prototype={init:function(c){this.owner=c.host;var a=parseInt(this.owner.getComputedStyle("height"));var b=parseInt(this.owner.ancestor().getComputedStyle("height"));if(a>b){this.owner.ancestor().setStyle("overflow","auto");this.owner.ancestor().one("#sidebar").setStyle("height",a+"px")}}};YUI().use("node",function(b){function a(){this.publish("DeleteHandler:onDelete");this.publish("TravelPlan:updated");this.publish("Searchbar:updated");this.publish("Overlay:close")}b.augment(a,b.EventTarget);App.CustomEvent=new a()});