var Template={evaluate:function(object,template,pattern){this.template=template.toString();this.pattern=pattern||this._pattern;return this.gsub(this.template,this.pattern,function(match){if(object==null)return(match[1]+'');var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3],pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=Template.startsWith(match[1],'[')?match[2].replace(/\\\\]/g,']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);} return before+Template.interpret(ctx);});},interpret:function(value){return value==null?'':String(value);},lastIndexOf:function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;},startsWith:function(string,pattern){return string.lastIndexOf(pattern,0)===0;},prepareReplacement:function(replacement){if(jQuery.isFunction(replacement))return replacement;return function(match){return Template.evaluate(match,replacement)};},gsub:function(source,pattern,replacement){var result='',match;replacement=this.prepareReplacement(replacement);if(typeof pattern=='string') pattern=RegExp.escape(pattern);if(!(pattern.length||pattern.source)){replacement=replacement('');return replacement+source.split('').join(replacement)+replacement;} while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=Template.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}} return result;},_pattern:/(^|.|\r|\n)(#\{(.*?)\})/};var d={htmlTemplate:"<#{tag} id='#{id}' class='#{className}'>#{inner}",simpleHtmlTemplate:"<#{tag}>#{inner}",maxNumber:Number.MAX_VALUE,minNumber:Number.MIN_VALUE,template:function(object,template){return Template.evaluate(object,template);},html:function(object){return Template.evaluate(object,this.htmlTemplate);},dom:function(object){return $(this.html(object));},simpleDom:function(object){return $(Template.evaluate(object,this.simpleHtmlTemplate));},rand:function(magnitude){if(!magnitude)magnitude=100;return Math.floor(Math.random()*magnitude);},randNeg:function(magnitude){return this.rand(magnitude)*this.bin();},bin:function(){return((this.time()%2==0)?1:-1);},id:function(id){return $('#'+id);},time:function(){return(new Date()).getTime();},px:function(pixels){return pixels+"px";},mpx:function(pixels){return'-'+pixels+"px";},rpx:function(value){return value.replace('px','');},tag:function(element){return $(element).get(0).tagName.toLowerCase();},isCheckbox:function(element){return(this.tag(element)==='input'&&$(element).attr('type')==='checkbox');},isCombo:function(element){return(this.tag(element)==='select');},noCache:function(file){return file+'?t='+this.time();}};;(function(){var initializing=false,fnTest=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(prop){var _super=this.prototype;initializing=true;var prototype=new this();initializing=false;for(var name in prop){prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,prop[name]):prop[name];} function Class(){if(!initializing&&this.init) this.init.apply(this,arguments);} Class.prototype=prototype;Class.constructor=Class;Class.extend=arguments.callee;return Class;};})();;var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0;}} else if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7");} catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always";} catch(e){if(playerVersion[0]==6){fp6Crash=true;}} if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX);} catch(e){}}} if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}} catch(e){}}} var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);/*@cc_on ie = true; @if (@_win32) windows = true; @elif (@_mac) mac = true; @end @*/return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac};}();var onDomLoad=function(){if(!ua.w3cdom){return;} addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState);}} catch(e){}} if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions();}},10);} if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null);} addLoadEvent(callDomLoadFunctions);}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions();}} function callDomLoadFunctions(){if(isDomLoaded){return;} if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t);} catch(e){return;}} isDomLoaded=true;if(timer){clearInterval(timer);timer=null;} var dl=domLoadFnArr.length;for(var i=0;i0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj);} setVisibility(id,true);} else if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i]);} else{displayAltContent(obj);}}} else{setVisibility(id,true);}}} function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i';}} el.outerHTML=''+par+'';objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id);} else if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k]);} else if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k]);} else if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k]);}}} for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l]);}}} el.parentNode.replaceChild(e,el);r=e;} else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m]);} else if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m]);}}} for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n]);}} el.parentNode.replaceChild(o,el);r=o;}} return r;} function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p);} function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id);} else{win.attachEvent("onload",function(){removeObjectInIE(id);});}} else{obj.parentNode.removeChild(obj);}}} function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null;}} obj.parentNode.removeChild(obj);}} function getElementById(id){var el=null;try{el=doc.getElementById(id);} catch(e){} return el;} function createElement(el){return doc.createElement(el);} function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn];} function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false;} function createCSS(sel,decl){if(ua.ie&&ua.mac){return;} var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"));} h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl);}}} function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v;} else{createCSS("#"+id,"visibility:"+v);}} function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s;} var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;idate)?1:(this=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;} var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);} if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);} if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);} if(x.hour||x.hours){this.addHours(x.hour||x.hours);} if(x.month||x.months){this.addMonths(x.month||x.months);} if(x.year||x.years){this.addYears(x.year||x.years);} if(x.day||x.days){this.addDays(x.day||x.days);} return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(valuemax){throw new RangeError(value+" is not a valid value for "+name+".");} return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;} if(!x.second&&x.second!==0){x.second=-1;} if(!x.minute&&x.minute!==0){x.minute=-1;} if(!x.hour&&x.hour!==0){x.hour=-1;} if(!x.day&&x.day!==0){x.day=-1;} if(!x.month&&x.month!==0){x.month=-1;} if(!x.year&&x.year!==0){x.year=-1;} if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());} if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());} if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());} if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());} if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());} if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());} if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());} if(x.timezone){this.setTimezone(x.timezone);} if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);} return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;} var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}} return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;} return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;} if(!last&&q[1].length===0){last=true;} if(!last){var qx=[];for(var j=0;j0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}} if(rx[1].length1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];} if(args){for(var i=0,px=args.shift();i2)?n:(n+(((n+2000)Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");} var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});} return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;} for(var i=0;ithis.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''),this.list=this.root.find(".mega-select-list"),this.trigger=this.root.find(".mega-select-trigger"),this.result=this.root.find(".mega-select-result"),this.board=this.root.find(".mega-select-board")},defaultFormat:function(value,text){return'
'+text+"
"},defaultSelectedFormat:function(value,text){return"+"+value},mutate:function(){this.cloneCSS(),this.cloneOptions(),this.initEvents(),this.root.insertBefore(this.target.hide()),this.selectedOption&&this.selectedOption.click()},cloneCSS:function(){var length=this.properties.length;for(var i=0;i()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return content!=""&®exp.test(email)?(this.submitButton.attr("disabled","disabled"),!0):(content==""?(this.contentTextarea.addClass("error").fadeIn(100),$("#error-message-empty-fileds").removeClass("hidden"),regexp.test(email)||(this.emailField.addClass("error").fadeIn(100),$("#error-message-empty-fileds").fadeIn(100))):(this.emailField.addClass("error").fadeIn(100),$("#error-message-email").removeClass("hidden"),$("#error-message-email").fadeIn(100)),setTimeout(TP24.proxy(function(){this.contentTextarea.removeClass("error"),this.emailField.removeClass("error"),$("#error-message-empty-fileds").fadeOut(300),$("#error-message-email").fadeOut(300)},this),1500),!1)},this),success:TP24.proxy(function(){this.form.slideUp("fast"),this.successMessageTarget.text(this.successMessageTarget.data("success-message")),this.contentTextarea.removeClass("error"),this.emailField.removeClass("error"),$("#error-message-empty-fileds").hide(),$("#error-message-email").hide(),setTimeout(TP24.proxy(function(){this.successMessageTarget.text(this.originalPromptContent)},this),5e3)},this)})},initScoreRadios:function(){this.scoreRadios.change(TP24.proxy(function(){this.scoreLabels.removeClass("checked"),this.scoreRadios.filter(":checked").parent("label").addClass("checked")},this))}}),FancyFeedbackForm=Parent.extend({RUN:["initGlobals","initForm","initScoreRadios"],selector:"_feedback",prompt:null,form:null,contentTextarea:null,container:null,submitButton:null,scoreRadios:null,scoreLabels:null,initGlobals:function(){$("#error-message").hide(),this.container=$("#feedback"),this.button=$("#feedback-button"),this.form=$("#feedback-form"),this.successMessage=$("#success-message"),this.contentTextarea=this.form.find("textarea"),this.emailField=this.form.find("input"),this.submitButton=this.form.find(":submit"),this.scoreRadios=this.form.find(":radio"),this.scoreLabels=this.scoreRadios.parent("label")},initForm:function(){this.form.ajaxForm({beforeSubmit:TP24.proxy(function(){var email=$.trim(this.form[0]["feedback[email]"].value),content=$.trim(this.form[0]["feedback[content]"].value),regexp=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return content!=""&®exp.test(email)?(this.submitButton.attr("disabled","disabled"),$("#feedback-form").trigger("fancy-feedback-form:submit"),!0):(content==""?(this.contentTextarea.addClass("error").fadeIn(100),$("#error-message-empty-fileds").removeClass("hidden"),regexp.test(email)||(this.emailField.addClass("error").fadeIn(100),$("#error-message-empty-fileds").fadeIn(100))):(this.emailField.addClass("error").fadeIn(100),$("#error-message-email").removeClass("hidden"),$("#error-message-email").fadeIn(100)),setTimeout(TP24.proxy(function(){this.contentTextarea.removeClass("error"),this.emailField.removeClass("error"),$("#error-message-empty-fileds").fadeOut(300),$("#error-message-email").fadeOut(300)},this),1500),!1)},this),success:TP24.proxy(function(){this.form.slideUp("fast"),$.fancybox&&$.fancybox.close(),this.contentTextarea.removeClass("error"),this.emailField.removeClass("error"),this.successMessage.fadeIn(),setTimeout(TP24.proxy(function(){this.successMessage.fadeOut(),this.container.remove()},this),3e3),$("#error-message-empty-fileds").hide(),$("#error-message-email").hide(),this.button.addClass("green")},this)})},initScoreRadios:function(){this.scoreRadios.change(TP24.proxy(function(){this.scoreLabels.removeClass("checked"),this.scoreRadios.filter(":checked").parent("label").addClass("checked")},this))}}),Billboard=Parent.extend({RUN:["initGlobals"],selector:"_billboard",initGlobals:function(){this.root.advancedSlider({xmlSource:TP24_Billboard_Url,width:620,height:300,skin:"minimal-small",shuffle:!1,fadeSlideshowControls:!1,pauseSlideshowOnHover:!0,timerAnimation:!1,effectType:"fade",simpleSlideEasing:"easeInOutExpo",fadeNavigationArrows:!1,navigationButtonsNumbers:!0,shadow:!1,fadeSlideshowControls:!0,fadeNavigationArrows:!0,fadeNavigationButtons:!0})}}),EventTimer=function(){this.hasStarted=!1,this.timeStarted=null,this.start=function(){this.hasStarted!==!0&&(this.timeStarted=new Date,this.hasStarted=!0)},this.stop=function(){if(this.hasStarted===!0){var timeNow=new Date,secondsElapsed=(timeNow.getTime()-this.timeStarted.getTime())/1e3;return this._resetTimers(),secondsElapsed}return 0},this._resetTimers=function(){this.hasStarted=!1,this.timeStarted=null}},UserAddress={initProfileGlobals:function(){this.form=$("form#userAddress"),this.profileTypeRadios=this.form.find("input[type=radio][name^=userAddress]"),this.profileCurrentType=this.profileTypeRadios.filter(":checked").attr("id")||this.form.find("#userAddress-isCompanyActive").attr("id"),this.profileDivsParent=this.form.find("#is-person").parent(),this.profileDivs={"userAddress-isCompanyActive-0":this.profileDivsParent.children("#is-person"),"userAddress-isCompanyActive-1":this.profileDivsParent.children("#is-company"),"userAddress-isCompanyActive":this.profileDivsParent.children("#is-person")}},showProfile:function(radioID){for(var id in this.profileDivs)id!=radioID&&this.profileDivs[id].detach();var div=this.profileDivs[radioID];$(div.attr("id")).length||this.profileDivsParent.append(div)},initProfile:function(){this.initProfileGlobals(),this.profileCurrentType&&(this.showProfile(this.profileCurrentType),_this=this,this.profileTypeRadios.click(function(event){_this.showProfile($(event.target).attr("id"))}))}},Newsletter=Parent.extend({RUN:["initGlobals","initAutocomplete"],selector:"_newsletter-additional-data",initGlobals:function(){$("#_newsletter-additional-data .datepicker:first").datepicker({dateFormat:"yy-mm-dd",minDate:null,changeMonth:!0,changeYear:!0,defaultDate:new Date(1984,0,1),yearRange:"1920:2014"}),this.ibInput=this.get("#dep")},initAutocomplete:function(){this.list=TP24_Flight_Airports_File,TP24.include(this.list,TP24.proxy(function(event){var singleTranslation=TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS.length==1,forceMatchContains=TP24.CONFIG.LOCALE.FORCE_AUTOCOMPLETION_MATCH_CONTAINS;TP24.SUPPORT.workers?(window.TP24_Flight_Airports_Codes=event.data.TP24_Flight_Airports_Codes,this.airports=event.data.TP24_Flight_Airports):this.airports=window.TP24_Flight_Airports,$.each(TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS,TP24.proxy(function(index,locale){locale in this.airports&&TP24.autocompleter(this.ibInput,this.airports[locale],{matchContains:!!index||singleTranslation||forceMatchContains})},this))},this))}});$(".enableWaitScr").click(function(event){var message=$(this).data("message")||TP24.CONFIG.LOCALE.PLEASE_WAIT_MESSAGE;$("body").append('

'+ message+'

X
'),$("#waitScr").fadeIn("fast")}),$(".switchToggle").click(function(event){var hideDiv=$(this).attr("data-hide"),showDiv=$(this).attr("data-show");return $(hideDiv).toggle(),$(showDiv).toggle(),!1}),"TP24_MOBILE"in window||$("input[placeholder], textarea[placeholder]").placeholder(),$(".acceptTerms").hover(function(event){$("#terms:has(input[type=checkbox]:not(':checked'))").addClass("error")}),$("#terms input[type=checkbox]:not(':checked')").change(function(event){$("#terms").removeClass("error").toggleClass("success")}),$(document).ready(function(){var $slideBox=$(".sliding-box"),$slideTrack=$(".sliding-track"),jsContentSlidingTrackHeight=$(".js-content-sliding-track-height").height()||$("#main").height()-50,slidingBoxHeight,slidingTrackOffset,slidingTrackHeight,slidingBoxTop,scrollSliderController,widthController,runControllers;if($slideBox.length>0&&$slideTrack.length>0){$slideTrack.css("height",jsContentSlidingTrackHeight),slidingBoxTop=$slideBox.offset().top-parseFloat($slideBox.css("marginTop").replace(/auto/,0))-20,widthController=function(){slidingBoxHeight=$slideBox.height(),slidingTrackOffset=$slideTrack.offset(),slidingTrackHeight=$slideTrack.height()},scrollSliderController=function(){var $window=$(window),winHeight=$window.height(),scroll=$window.scrollTop(),allowMovement=slidingBoxHeightslidingBoxHeight,onTop=scroll<=slidingBoxTop,onBottom=slidingBoxHeight+scroll>slidingTrackHeight+slidingTrackOffset.top,onMove=scroll>=slidingBoxTop&&!onTop&&!onBottom,$slideBox=$(".sliding-box");$slideBox.removeClass("fixed fixed-bottom"),allowMovement&&(onTop?$slideBox.removeClass("fixed fixed-bottom"):onMove?$slideBox.removeClass("fixed-bottom").addClass("fixed"):onBottom&&$slideBox.removeClass("fixed").addClass("fixed-bottom"))},runControllers=function(){widthController(),scrollSliderController()},runControllers(),$(window).scroll(scrollSliderController).resize(scrollSliderController),$slideBox.on("click.toExpand change.forUpdate",runControllers);var counter=$(".jodometer"),startNumber=$(counter).data("number");$(counter).jOdometer({increment:3,counterStart:startNumber,counterEnd:startNumber,numbersImage:"/img/jodometer_numbers.png",formatNumber:!0,spaceNumbers:2,widthDot:8,delayTime:7e3,easing:"swing"})}$("select").length>0&&($('select:not([value!=""])').addClass("placeholder"),$("select.placeholder > option:first-child").addClass("placeholder"),$("select").change(function(){this.value?$(this).removeClass("placeholder"):$(this).addClass("placeholder")}));var googlePlus=$("#googleplus");if(googlePlus.length>0&&window.location.protocol!=="https:"){var lazyLoadGooglePlus=function(){var scroll=$(this).scrollTop(),showFrom=googlePlus.offset().top-$(window).height();scroll>=showFrom&&head.js("//apis.google.com/js/plusone.js",function(){gapi.plus.go()})};$(window).scroll(lazyLoadGooglePlus)}$("#PrintElement").live("click",function(){return $ ("#subpage").printElement({printMode:"popup"}),!1}),typeof FlightCalendarOffer!="undefined"&&FlightCalendarOffer.prototype.initCounter(),$("[data-role=link]").click(function(){_this=$(this),_this.addClass("clicked");var url=_this.data("href"),link=_this.find("a");return typeof url!="undefined"?_this.attr("target")=="_blank"?window.open(url):window.location=url:link.attr("target")=="_blank"?window.open(link.attr("href")):window.location=link.attr("href"),!1}),$("a#remove-search-query-cookie").click(function(e){var parent=$(this).parent(),removeUrl=$("a.close").attr("href");return $.ajax({type:"get",url:removeUrl,data:{searchQueryCookieID:parent.data("id")},beforeSend:function(){parent.animate({backgroundColor:"#F80"},300)},success:function(json){json.deleted?parent.slideUp(300,function(){parent.remove()}):parent.animate({backgroundColor:"#fff"},300),$.cookie(json.name,json.value,json.params)}}),!1});if(typeof SearchQueryCookie!="undefined"){var expiryDate=new Date;expiryDate.setTime(expiryDate.getTime()+72e5),$.cookie(SearchQueryCookie.name,SearchQueryCookie.value,{expires:expiryDate,path:"/"})}$("[data-focus]").click(function(){var target=$(this).data("focus");return $(target).effect("pulsate",{times:2},800),!1}),$("[data-scroll]").click(function(){var target=$(this).data("scroll");return $.scrollTo(target,500,{easing:"easeOutQuad"}),!1}),$("[data-click]").click(function(){var target=$(this).data("click");return $(target).click(),!1}),$("a").bind("click",function(){$("*").removeClass("tapped"),$(this).addClass("tapped")});var idx=window.location.toString().indexOf("#_=_");idx>0&&(window.location=window.location.toString().substring(0,idx));var editableFirstName=$(".editableFirstNameDashboard");editableFirstName.length>0&&(editableFirstName.editable("/user/dashboard/edit-account-name",{name:"firstName",width:150,height:20,indicator:"Saving...",tooltip:"Click to edit...",cancel:"Cancel",submit:"OK"}),editableFirstName.editable("/user/dashboard/edit-account-name",{name:"lastName",width:150,height:20,indicator:"Saving...",tooltip:"Click to edit...",cancel:"Cancel",submit:"OK"})),UserAddress.initProfile();if(typeof Globalize!="undefined"){var culture=Globalize.culture(),cookieMessages=culture.messages.cookies;$.cookieCuttr({cookieNotificationLocationBottom:!0,cookieAnalyticsMessage:cookieMessages.policyMessage,cookieAcceptButtonText:cookieMessages.accept,cookieWhatAreLinkText:cookieMessages.learnMore})}});var emailConfirmationValidation=function(){if("TP24_MOBILE"in window){var x=document.getElementById("profile-email"),y=document.getElementById("profile-emailConfirmation");y.value=x.value}};console.log("tp24 loaded"),namespace.TP24=TP24,namespace.TP24_LOCALE=TP24_LOCALE,namespace.Parent=Parent,namespace.PaymentForm=PaymentForm,namespace.Voucher=Voucher,namespace.LiveTranslation=LiveTranslation,namespace.StaticPageSidebar=StaticPageSidebar,namespace.PaymentSms=PaymentSms,namespace.WorldMap=WorldMap,namespace.ChromeFrame=ChromeFrame,namespace.MegaSelect=MegaSelect,namespace.FeedbackForm=FeedbackForm,namespace.FancyFeedbackForm=FancyFeedbackForm,namespace.Billboard=Billboard,namespace.Newsletter=Newsletter,namespace.EventTimer=EventTimer,namespace.emailConfirmationValidation=emailConfirmationValidation,function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])}(),typeof define=="function"&&define.amd&&define("tp24-amd",[],function(){return namespace})})(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}());(function(global,undefined){console.log("HotelSearchQuery Started - Deprecated");var namespace={HotelSearchQuery:Parent.extend({list:null,destination:null,checkin:null,checkout:null,roomTemplate:null,childAgeTemplate:null,selector:"_hotel-search",RUN:["initAutocompletion","initGlobals","initCalendar","initRooms"],initGlobals:function(){this.roomTemplate='


'+TP24.t("Room")+': #{roomNumber}
',this.childAgeTemplate='
',this.destination=this.get("#destinationInput"),this.checkin=this.get("#checkin"),this.checkout=this.get("#checkout"),this.roomsNumber=this.get("#roomsNumber"),this.rooms=this.get("#Rooms"),TP24.observe("DESTINATIONLIST:destinationSelected",this.destinationSelected,this)},initAutocompletion:function(){this.list=TP24_Hotel_Destinations_File,TP24.include(this.list,TP24.proxy(function(event){var TP24_Hotel_Destinations=TP24.SUPPORT.workers?event.data.TP24_Hotel_Destinations:window.TP24_Hotel_Destinations,singleTranslation=TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS.length==1;$.each(TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS,TP24.proxy(function(index,locale){locale in TP24_Hotel_Destinations&&TP24.autocompleter(this.destination,TP24_Hotel_Destinations[locale],{matchContains:!!index||singleTranslation,searchCodes:!1})},this))},this))},initCalendar:function(){var beforeShow=function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.HOTEL,"openCalenderSearch")};TP24.maskCalendar(this.checkin,this.checkout,{beforeShow:beforeShow})},initRooms:function(){this.roomsNumber.change(TP24.proxy(function(){var rooms="";for(var i=0;i0)var extraPaymentCharge=this.paymentCharge;else var extraPaymentCharge=0;var otherSubtotal=extraPaymentCharge+data.price;this.get("#product-subtotal-other").html(TP24.formatPrice(otherSubtotal));var total=this.productTotalPrice+otherSubtotal;this.get("#total-price").html(TP24.formatPrice(total)),this.get("#total-price").attr("data-total",total),$("#payment-credit-card-total").html(TP24.formatPrice(total));var totalInEuroSelector=$("#payment-credit-card-total-euro"),conversion=totalInEuroSelector.data("conversion");totalInEuroSelector.html(TP24.formatPrice(total/conversion,2,{currency:"\u20ac",round:!1}))},initPaymentMethodsWithExtraCharges:function(){this.paymentExpenses.html(TP24.formatPrice(this.paymentCharge)),this.totalPriceWithoutPaymentCharge=this.totalPrice.total,this.totalPriceTotal=this.totalPrice.element.data("total")+this.paymentCharge-this.voucherSubtotal.attr("data-price"),this.creditCards.change(TP24.proxy(this.creditCardOptionSelected,this));var loadPaymentType=function(event,data){this.terminalRadio==data.id?this.updateSidebarCharges(this.terminalPrice,"payment"):(this.updateSidebarCharges(0,"payment"),TP24.observe(this.event,this.catcher,this))};TP24.observe("TP24:PaymentTypeEnabled",loadPaymentType,this)},updateSidebarCharges:function(charge,type){var productSubtotalElementToUpdate="";type=="payment"&&(this.updatePaymentChargesForPayment(charge),productSubtotalElementToUpdate="#product-subtotal-other"),this.totalPrice.element.html(TP24.formatPrice(this.totalPrice.total));var otherSubtotal=this.paymentCharge+parseInt(this.voucherSubtotal.attr("data-price")*100)/100;this.otherSubtotal.attr("data-price",otherSubtotal),this.otherSubtotal.html(TP24.formatPrice(otherSubtotal)),this.paymentExpenses.html(TP24.formatPrice(charge))},updatePaymentChargesForPayment:function(charge){var total=0,otherTotal=0;this.paymentCharge=charge,total=this.totalPriceWithoutPaymentCharge+this.paymentCharge+parseInt(this.voucherSubtotal.attr("data-price")*100)/100,otherTotal=this.otherChargesWithoutPaymentCharges+this.paymentCharge+parseInt(this.voucherSubtotal.attr("data-price")*100)/100,this.totalPriceWithoutInstallmentCharge=total,this.otherChargesWithoutInstallmentCharges=otherTotal,this.totalPrice.total=total,this.otherSubtotal.price=otherTotal},creditCardOptionSelected:function(event){var element=$(event.target),option=d.tag(element)==="select"?element.children(":selected"):element;this.creditCardLastSelected=this.creditCards.val(),this.creditCardLocallyChargeable=option.data("locally-chargeable");var subtotal=option.data("card-price")||0;this.updateSidebarCharges(subtotal,"payment"),this.creditCardLocallyChargeable==0||!this.creditCardLocallyChargeable==undefined?$("#js-creditcard-locally-chargeable").fadeIn(300):$("#js-creditcard-locally-chargeable").fadeOut(300)}})};(function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])})(),typeof define=="function"&&define.amd&&define("hotels/HotelPriceBar",[],function(){return namespace})}(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}()),function(global,undefined){console.log("HotelUserCancellation Started - Deprecated");var namespace={HotelUserCancellation:Parent.extend({RUN:["initGlobals","initForm"],roomsPaid:null,roomsFees:null,refundableAmount:null,voucher:null,refundedAmount:null,creditCardAmount:null,refundMethod:null,initGlobals:function(){this.paid=$("#sidebar-total-paid"),this.roomsPaid=$("#sidebar-rooms-paid"),this.roomsFees=$("#sidebar-rooms-fees"),this.refundableAmount=$("#sidebar-refundable-amount"),this.voucher=$("#sidebar-voucher"),this.refundedAmount=$("#sidebar-refunded-amount"),this.creditCardAmount=$("#credit-card-amount-to-be-refunded"),this.refundMethod=$("#refund-method"),this.rooms=$("input[type=checkbox].room-selector")},initForm:function(){var _this=this;_this.rooms.change(function(){_this.showHide(),_this.calculatePrices ()}),_this.showHide(),_this.calculatePrices()},showHide:function(){var numberOfChecked=$("input[type=checkbox].room-selector").filter(":checked").length;numberOfChecked>0?this.refundMethod.removeClass("hide"):this.refundMethod.addClass("hide"),$.each(this.rooms,function(){var roomIndex=$(this).data("index");$(this).is(":checked")?$("ul.price-details > li[data-index="+roomIndex+"]").removeClass("hide"):$("ul.price-details > li[data-index="+roomIndex+"]").addClass("hide")})},calculatePrices:function(){var roomsPrice=0,fees=0;$.each($(".room-selector:checked"),function(){roomsPrice+=$(this).data("price"),fees+=$(this).data("fee")}),this.roomsPaid.html(TP24.formatPrice(roomsPrice)),this.roomsFees.html(TP24.formatPrice(fees));var amountToRefund=this.getAmountToRefund(roomsPrice,fees);this.refundableAmount.html(TP24.formatPrice(amountToRefund)),this.refundableAmount.data("price",amountToRefund),this.creditCardAmount.html(TP24.formatPrice(amountToRefund)),amountToRefund==0&&(this.paid.data("price")==0||this.refundedAmount.data("price")>0)?$(".price-totals").addClass("hide"):$(".price-totals").removeClass("hide")},getAmountToRefund:function(roomsPrice,fees){var refundedAmount=this.refundedAmount.data("price"),totalPaid=this.paid.data("price");return Math.max(Math.min(roomsPrice-fees,totalPaid-refundedAmount),0)}})};(function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])})(),typeof define=="function"&&define.amd&&define("hotels/HotelUserCancellation",[],function(){return namespace})}(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}()),function(global,undefined){console.log("HotelCatalogueHotel Started");var namespace={HotelCatalogueHotel:Parent.extend({checkin:null,checkout:null,RUN:["initGlobals","initCalendar"],initGlobals:function(){this.checkin=$("#checkin"),this.checkout=$("#checkout"),this.roomsAndPersons=$("[class ^=js-roomsAndPersons-]"),this.selectAdults=$("[class ^=js-selectAdults-]"),this.selectChildren=$("[class ^=js-selectChildren-]"),this.selectRoomsAndPersons=$(".js-selectRoomsAndPersons"),this.roomsAndPersonsSumTextField=$("input[name=guests]"),this.roomsAndPersonsSumDiv=$(".js-roomsAndPersonsSumDiv"),this.numberOfRooms=$("#roomsNumber"),this.addRoomButton=$(".js-add-room"),this.removeRoomButton=$(".js-remove-room"),this.displayNumberOfRoomsAndPersons(),this.roomsAndPersonsSumTextField.val(this.roomsAndPersonsSumDiv.html()),this.setProperClasses(),this.displayRoomsAndPersonsSelectionVisibility(),this.numberOfChildrenChange(),this.addRoom(),this.removeRoom(),this.eventsToChangeRoomsAndPersonsSumDiv(),this.checkForButtonsVisibility(),this.checkAvailabilityForm()},initCalendar:function(){var beforeShow=function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.HOTEL,"openCalenderSearch")};TP24.maskCalendar(this.checkin,this.checkout,{beforeShow:beforeShow})},setProperClasses:function(){this.roomsAndPersons.not(".hide").each(function(){$(this).addClass("roomWasSelected")})},checkAvailabilityForm:function(){var _this=this,form=$("#js-checkAvailabilityForm");form.submit(function(){_this.roomsAndPersons.not(".roomWasSelected").each(function(){$(this).remove()}),$("[class^=js-ageOfChilderSelect-]").each(function(){$(this).hasClass("hide")&&$(this).remove()})})},checkForRemoveRoomButtonVisibility:function(){var numberOfRooms=this.roomsAndPersons.not(".hide").length;numberOfRooms<=1?this.removeRoomButton.addClass("hide"):this.removeRoomButton.removeClass("hide")},checkForAddRoomButtonVisibility:function(){var numberOfRooms=this.roomsAndPersons.not(".hide").length;numberOfRooms>=5?this.addRoomButton.addClass("hide"):this.addRoomButton.removeClass("hide")},checkForButtonsVisibility:function(){this.checkForRemoveRoomButtonVisibility(),this.checkForAddRoomButtonVisibility()},displayRoomsAndPersonsSelectionVisibility:function(){var _this=this;this.roomsAndPersonsSumTextField.click(function(){_this.selectRoomsAndPersons.removeClass("hide"),_this.checkForButtonsVisibility()}),this.onDoneOrCancelClick()},onDoneOrCancelClick:function(){var _this=this;$(".js-done-selection").click(function(){var numberOfRooms=_this.roomsAndPersons.not(".hide").length;_this.roomsAndPersons.each(function(){$(this).removeClass("roomWasSelected"),$(this).hasClass("hide")||$(this).addClass("roomWasSelected")}),_this.numberOfRooms.val(numberOfRooms),_this.roomsAndPersonsSumTextField.val(_this.roomsAndPersonsSumDiv.html())}),$("body").click(function(e){!$(e.target).closest(".js-selectRoomsAndPersons").length&&!$(e.target).closest(".guests").length&&$(".js-selectRoomsAndPersons").addClass("hide")}),$(".js-cancel-selection, .js-done-selection").click(function(){$(".js-selectRoomsAndPersons").addClass("hide")})},addRoom:function(){var _this=this;$(".js-add-room").click(function(){var numberOfRooms=_this.roomsAndPersons.not(".hide").length;$(".js-roomsAndPersons-"+numberOfRooms).removeClass("hide"),$(".js-selectAdults-"+numberOfRooms).removeClass("hide"),$(".js-selectChildren-"+numberOfRooms).removeClass("hide"),_this.checkForButtonsVisibility()})},removeRoom:function(){var _this=this;$(".js-remove-room").click(function(){var numberOfRooms=_this.roomsAndPersons.not(".hide").length;numberOfRooms>1&&($(".js-roomsAndPersons-"+(numberOfRooms-1)+" select").val(""),$(".js-roomsAndPersons-"+(numberOfRooms-1)).addClass("hide"),$(".js-selectAdults-"+(numberOfRooms-1)).addClass("hide"),$(".js-selectChildren-"+(numberOfRooms-1)).addClass("hide")),_this.checkForButtonsVisibility()})},numberOfChildrenChange:function(){this.selectChildren.change(function(){var i,$this=$(this),children=$this.val(),className=$this.attr("class"),classID=className.match(/js-selectChildren-(\d+)/)[1];for(i=0;i<=1;i++)$(".js-ageOfChilderSelect-"+parseFloat(classID)+"_"+i).addClass("hide");if(children>0)for(i=0;i1&&(personWord="Persons"),numberOfRooms>1&&(roomWord="Rooms"),this.roomsAndPersonsSumDiv.html(numberOfRooms+" "+TP24.t(roomWord)+", "+numberOfPersons+" "+TP24.t(personWord))}})};(function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])})(),typeof define=="function"&&define.amd&&define("hotels/HotelCatalogueHotel",[],function(){return namespace})}(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}()),function(window,undefined){$("body").hasClass("hotel-personal")&&(console.log("Personal"),$(document).ready(function(){var invoice=$("#invoice"),company=$("#profile-isCompanyActive"),autoloadValues=[],_autoInitValues=[];invoice.hide(),invoice.length>0&&(company.is(":checked")&&(company.parent("p").toggleClass("active-check"),invoice.show()),company.click(function(){invoice.toggle(),$(this).parent("p").toggleClass("active-check")})),$("#guestRoomInfo-0-0-firstName").one("blur",function(){var profileFirstName=$("#profile-firstName");profileFirstName.val()===""&&profileFirstName.val($(this).val())}),$("#guestRoomInfo-0-0-lastName").one("blur",function(){var profileLastName=$("#profile-lastName");profileLastName.val()===""&&profileLastName.val($(this).val())}),$("#guestRoomInfo-0-0-gender").one("blur",function(){$("#profile-gender").val($(this).val())}),$("input.autoload").each(function(){_autoInitValues[$(this).name]=$(this).value,$(this).on("focus",function(){autoloadValues[$(this).name]=$(this).value,$(this).value===_autoInitValues[$(this).name]&&($(this).value="")}).on("blur",function(){$(this).value===""&&($(this).value=_autoInitValues[$(this).name])})}),$("input.nongreek").each(function(){this.on("change",function(){var val=this.value,regEx=new RegExp("[a-zA-Z ]{"+val.length+"}","i"),regExDeny=new RegExp("[!@#$%^&*()]");val.search(regEx)==-1||val.search(regExDeny)!=-1?(alert("Please enter your name in latin characters just as appear in your passport or id card"),$(this).addClass("error")):$(this).removeClass("error")})})}))}(window),define("hotels/HotelPersonal",function(){}),function(window,undefined){$(document).ready(function(){if($("body").hasClass("hotel-payment")){var paymentPageTrackingCategory=TP24.CONFIG.TRACKER.CATEGORIES.HOTEL+"/Payment Page";TP24.track(paymentPageTrackingCategory,"Payment page loaded"),$("#flash").length>0&&TP24.track(paymentPageTrackingCategory,"Payment page loaded","Validation error(s)"),$("#slide-info").on("click",function(){TP24.track(paymentPageTrackingCategory,"Click on More info")});var paymentVoucherButton=!1;$("#payment-voucherButton").on("click",function(){paymentVoucherButton||($(document).ajaxStop(function(){var voucherCodeElement=$("#payment-voucherCode"),voucherCode=voucherCodeElement.val();voucherCodeElement.hasClass("error")&&TP24.track(paymentPageTrackingCategory,"Invalid voucher",voucherCode)}),paymentVoucherButton=!0)}),$("#payment").on("submit",function(){var paymentType=$('input[name="payment[selectedMethodIndex]"]:checked').parent("label").text();TP24.track(paymentPageTrackingCategory,"Selected Payment Option",paymentType);var creditCardVendorElement=$("#payment-creditCardVendor");if(creditCardVendorElement.is(":visible")){var creditCardVendor=creditCardVendorElement.find("option:selected").text();creditCardVendor=creditCardVendor.replace(/ *\([^)]*\) */g,""),TP24.track(paymentPageTrackingCategory,"Selected Credit Card Vendor/Type",creditCardVendor+" | "+paymentType)}$("#terms").hasClass("success")==0&&TP24.track(paymentPageTrackingCategory,"Unchecked Terms & Conditions")});var creditCardSelector=$("#credit-card");if(creditCardSelector.is(":visible")&&creditCardSelector.parent().find("ul.error").length>0){var invalidCreditCardValidationErrors=[],creditCardVendorElement=$("#payment-creditCardVendor");creditCardVendorElement.val()===""&&invalidCreditCardValidationErrors.push(creditCardVendorElement.attr("id").replace("payment-","")),$("#credit-card input.error, #credit-card select.error").each(function(){invalidCreditCardValidationErrors.push($(this).attr("id").replace("payment-",""))});var invalidCreditCardValidationError=invalidCreditCardValidationErrors.join(" | ");invalidCreditCardValidationError!==""&&TP24.track(paymentPageTrackingCategory,"Invalid Credit Card",invalidCreditCardValidationError)}}})}(window),define("hotels/tracking/HotelPaymentTracking",function(){}),function(window,undefined){$("body").hasClass ("hotel-confirmation")&&(console.log("ConfirmationTracking"),$(document).ready(function(){var confirmationPageTrackingCategory=TP24.CONFIG.TRACKER.CATEGORIES.HOTEL+"/Confirmation Page";TP24.track(confirmationPageTrackingCategory,"Confirmation page loaded"),$("#notes a").on("click",function(){TP24.track(confirmationPageTrackingCategory,"Click on terms & conditions")})}))}(window),define("hotels/tracking/HotelConfirmationTracking",function(){}),function(window,undefined){$("body").hasClass("hotel-personal")&&(console.log("HotelPersonalTracking"),$(document).ready(function(){var personalPageTrackingCategory=TP24.CONFIG.TRACKER.CATEGORIES.HOTEL+"/Personal Page";TP24.track(personalPageTrackingCategory,"Personal page loaded"),$("#flash").length>0&&TP24.track(personalPageTrackingCategory,"Personal page loaded","Validation error(s)"),$('form[name="personalForm"]').submit(function(){$('input[type=hidden][name*="isAdult"][value="1"]').each(function(){var passengerGender=$(this).prev("select").val ();TP24.track(personalPageTrackingCategory,"Passenger Gender",passengerGender)});var residenceCity=$("#profile-city").val(),residenceCountry=$("#profile-countryCode").find("option:selected").text(),residence=residenceCity+", "+residenceCountry,newsletterSubscription=$("#profile-isOnNewsletter").is(":checked")?1:0,invoiceSelected=$("#profile-isCompanyActive").is(":checked")?1:0;residenceCity!=null&&residenceCountry!=null&&TP24.track(personalPageTrackingCategory,"City of Residence",residence),TP24.track(personalPageTrackingCategory,"Newsletter Subscription","(Boolean 1 OR 0 - true OR false)",newsletterSubscription),TP24.track(personalPageTrackingCategory,"Invoice Selected","(Boolean 1 OR 0 - true OR false)",invoiceSelected)})}))}(window),define("hotels/tracking/HotelPersonalTracking",function(){}),define("tp24-hotel",["hotels/HotelSearchQuery","hotels/HotelPriceBar","hotels/HotelUserCancellation","hotels/HotelCatalogueHotel","hotels/HotelPersonal","hotels/tracking/HotelPaymentTracking","hotels/tracking/HotelConfirmationTracking","hotels/tracking/HotelPersonalTracking"],function(){console.log("Hotel Started")});(function(global,undefined){var namespace={},FlightSearchQuery=Parent.extend({list:null,obInput:null,ibInput:null,obDate:null,ibDate:null,ibTime:null,roundTrip:null,toBeHiddenByRadio:null,moreOptions:null,airports:null,depList:null,arrList:null,defaultCountriesPerContinent:null,source:null,selector:"_flight-search",RUN:["initAutocomplete","initGlobals","initCalendar","initRoundTrip","initAirportList","passengersValidation","initGeodata"],initGlobals:function(){this.obInput=this.get("#dep"),this.ibInput=this.get("#arr"),this.obDate=this.get("#obDate"),this.ibDate=this.get("#ibDate"),this.roundTrip=this.get("input[type=radio]"),this.toBeHiddenByRadio=this.get(".round-trip-hidden"),this.ibTime=this.get("#ibTime").parent(),this.moreOptions=this.get("#flight-form-more-options"),this.depList=this.get("#dep-list"),this.arrList=this.get("#arr-list"),this.adults=this.get("#passengersAdult"),this.children=this.get("#passengersChild"),this.infants=this.get("#passengersInfant"),this.defaultCountriesPerContinent=TP24.CONFIG.LOCALE.DEFAULT_COUNTRIES_PER_CONTINENT},initAutocomplete:function(){this.list=TP24_Flight_Airports_File,TP24.include(this.list,TP24.proxy(function(event){var singleTranslation=TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS.length==1,forceMatchContains=TP24.CONFIG.LOCALE.FORCE_AUTOCOMPLETION_MATCH_CONTAINS;TP24.SUPPORT.workers?(window.TP24_Flight_Airports_Codes=event.data.TP24_Flight_Airports_Codes,this.airports=event.data.TP24_Flight_Airports):this.airports=window.TP24_Flight_Airports,$.each(TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS,TP24.proxy(function(index,locale){locale in this.airports&&(TP24.autocompleter(this.obInput,this.airports[locale],{matchContains:!!index||singleTranslation||forceMatchContains}),TP24.autocompleter(this.ibInput,this.airports[locale],{matchContains:!!index||singleTranslation||forceMatchContains}))},this))},this))},getAirportTextByAirportCode:function(airportCode){var airportCodeFormatted="("+airportCode+")",airportText=!1,locale=TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS [0];return!!this.airports&&locale in this.airports&&$.each(this.airports[locale],function(index,text){if(text.search(airportCodeFormatted)!==-1){airportText=text;return}}),airportText},initCalendar:function(){var beforeShow=function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"openCalenderSearch")};TP24.maskCalendar(this.obDate,this.ibDate,{beforeShow:beforeShow})},initRoundTrip:function(){this.roundTrip.change(TP24.proxy(this.handleRoundTrip,this)),TP24.observe(TP24.CONFIG.HIDEABLE.EVENT+"flight-form-more-options",this.handleIbTime,this),this.handleRoundTrip()},handleRoundTrip:function(){this.roundTrip.eq(0).is(":checked")?this.toBeHiddenByRadio.show():this.toBeHiddenByRadio.hide(),this.handleIbTime(undefined,this.moreOptions.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR))},handleIbTime:function(){this.roundTrip.eq(0).is(":checked")&&arguments[1]===TP24.CONFIG.HIDEABLE.ENABLED_STATE?this.ibTime.show():this.ibTime.hide()},addOptions:function(element,number,isAdult){var previous=element.val ();element.empty();for(var i=isAdult||0;i<=number;i++){var option=$("").html(i).val(i);element.append(option)}element.children("option").size()>=previous-1&&element.val(previous)},passengersValidation:function(){this.adults.change(TP24.proxy(function(event){var select=$(event.target).closest("select");this.addOptions(this.infants,select.val()),this.addOptions(this.children,9-select.val())},this)),this.children.change(TP24.proxy(function(event){var select=$(event.target).closest("select"),option,i;this.addOptions(this.adults,9-select.val(),1),this.addOptions(this.infants,9-select.val())},this)),this.adults.add(this.children).change()},initAirportList:function(){this.depList.click(TP24.proxy(function(){this.source="dep",TP24.fire("DESTINATIONLIST:airportListOpened"),TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"openAirportsDepartureSearch")},this)),this.arrList.click(TP24.proxy(function(){this.source="arr",TP24.fire("DESTINATIONLIST:airportListOpened"),TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"openAirportsArrivalSearch")},this)),TP24.observe("DESTINATIONLIST:airportSelected",this.airportSelected,this)},airportSelected:function(event,data){$("input[name="+this.source+"]").val(data.text)},initGeodata:function(){return;var _this,geoData}}),FlightPriceBar=Parent.extend({selectedOptions:null,options:null,totals:null,subtotals:null,prices:{},baggages:null,accessories:null,ancillaryServices:null,baggagesPrice:{},accessoriesPrice:{},ancillaryServicesPrice:{},insurancePrice:{},notificationPrice:{},creditCards:null,installments:null,paymentCharge:0,installmentLastSelected:0,installmentCharge:0,creditCardsRadio:"payment-type-CreditCard",instantBankRadio:"payment-type-InstantBank",terminalRadio:"payment-type-Terminal",paypalRadio:"payment-type-PayPal",creditCardLastSelected:"",instantBankPrice:0,terminalPrice:0,totalPriceWithoutPaymentCharge:0,otherChargesWithoutPaymentCharges:0,totalPriceWithoutInstallmentCharge:0,otherChargesWithoutInstallmentCharges:0,shouldSubstractInstallmentCharges:!1,totalPrice:{},hierarchyTemplate:"[data-hierarchy^=#{group}]",subtotalsTemplate:"[id=product-subtotal-#{name}]",totalsTemplate:"[id=product-total-#{group}]",selectedClass:"selected-option",selectedSelector:".selected-option",event:"PAYMENT:addon-update-price",selector:"_pricebar",RUN:["initGlobals","initPrices","initBaggages","initAccessories","initAncillaryServices","initInsurance","initNotification","initInstallmentsSurcharge","initPaymentMethodsWithExtraCharges","initCatcher","initThrower","triggerChanges","checkForZeroPrice"],initGlobals:function(){this.options=$("[data-price]"),this.selectedOptions=this.options.filter(this.selectedSelector),this.totals=this.get("[id^=product-total]"),this.subtotals=this.get("[id^=product-subtotal]"),this.baggages=$("#addons-baggageAncillaryServicesTotalPrice"),this.accessories=$("select[id^=addons-accessories]"),this.ancillaryServices=$("tr[id^=ancillaryServiceOption]"),this.insurance=$("[id^=addons-insurance-]"),this.creditCards=$("#payment-creditCardVendor"),this.numberOfInstallments=$("#payment-numberOfInstallments"),this.totalPrice.element=this.get("#total-price"),this.totalPrice.total=this.totalPrice.element.data("total"),this.instantBankPrice=$("#instant-bank-charge").data("charge"),this.terminalPrice=$("#terminal-charge").data("charge"),this.paypalPrice=$("#paypal-charge").data("charge"),this.otherTotal=$("#product-total-other"),this.totalElement=$("#total-price")},initInstallmentsSurcharge:function(){this.installmentCharge=0,this.totalPriceWithoutInstallmentCharge=this.totalElement.data("total"),this.otherChargesWithoutInstallmentCharges=this.otherTotal.data("price"),this.numberOfInstallments.change(TP24.proxy(this.installmentOptionSelected,this))},initBaggages:function(){this.baggagesPrice.total=0,this.baggages.on("updateBaggagePrice",TP24.proxy(function(event,oldPrice,newPrice){var total=this.totalPrice.total-Number(oldPrice)+Number(newPrice),otherTotal="other"in this.prices?this.prices.other-Number(oldPrice)+Number(newPrice):0;this.baggagesPrice.total=Number(newPrice),this.subtotals.filter("#product-subtotal-baggages").html(TP24.formatPrice(this.baggagesPrice.total)),this.totalPrice.element.html(TP24.formatPrice(total)),this.totalPrice.total=total;var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotalElement.html(TP24.formatPrice(otherTotal)),this.prices.other=otherTotal,this.checkForZeroPrice("#product-subtotal-baggages",newPrice)},this))},initAccessories:function(){this.accessoriesPrice.total=0,this.accessories.each(TP24.proxy(function(index,value){var select=$(value);this.accessoriesPrice[select.attr("id")]=select.children().eq(select.val()).data("accessory-price"),this.accessoriesPrice.total+=this.accessoriesPrice[select.attr("id")]},this)),this.accessories.change(TP24.proxy(function(event){var option=$(event.target).children(":selected"),selectID=option.parent().attr("id"),subtotal=this.accessoriesPrice.total-this.accessoriesPrice [selectID]+option.data("accessory-price"),total=this.totalPrice.total-this.accessoriesPrice.total,otherTotal="other"in this.prices?this.prices.other-this.accessoriesPrice.total:0;this.accessoriesPrice[selectID]=option.data("accessory-price"),this.accessoriesPrice.total=subtotal,this.subtotals.filter("#product-subtotal-accessories").html(TP24.formatPrice(subtotal)),total+=this.accessoriesPrice.total,this.totalPrice.element.html(TP24.formatPrice(total)),this.totalPrice.total=total;var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotal+=this.accessoriesPrice.total,otherTotalElement.html(TP24.formatPrice(otherTotal)),this.prices.other=otherTotal,this.checkForZeroPrice("#product-subtotal-accessories",this.accessoriesPrice.total)},this))},initInsurance:function(){$("a.insurance-link").on("click",function(e){e.preventDefault(),$(this).siblings("a").toggle(),$(this).closest("label").find(".insurance-description").toggle(),$(this).closest("label").find (".insurance-preview").toggle()}),this.insurancePrice.total=0,this.insurance.each(TP24.proxy(function(index,value){var option=$(value);this.insurancePrice[option.attr("id")]=option.data("insurance-price"),option.is(":checked")&&(this.insurancePrice.total+=this.insurancePrice[option.attr("id")])},this)),this.insurance.change(TP24.proxy(function(event){var option=$(event.target),checked=option.is(":checked"),selectID=option.attr("id"),subtotal=checked?this.insurancePrice.total+this.insurancePrice[selectID]:this.insurancePrice.total-this.insurancePrice[selectID],total=this.totalPrice.total-this.insurancePrice.total+subtotal,otherTotal="other"in this.prices?this.prices.other-this.insurancePrice.total+subtotal:0;this.insurancePrice.total=subtotal,this.totalPrice.total=total,this.prices.other=otherTotal,this.totalPrice.element.html(TP24.formatPrice(total)),this.subtotals.filter("#product-subtotal-insurance").html(TP24.formatPrice(subtotal));var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotalElement.html(TP24.formatPrice(otherTotal)),this.checkForZeroPrice("#product-subtotal-insurance",this.insurancePrice.total)},this))},initNotification:function(){var notificationArrival=$("#notification-arrival"),notificationArrivalInfo=$("#notification-arrival-info"),smsEmailOption=$("#addons-notification-1");notificationArrival.change(TP24.proxy(function(event){var smsAndEmailNotificationPrice=parseFloat(smsEmailOption.data("price")),smsArrivalPrice=parseFloat(notificationArrival.data("extra")),priceDiff=notificationArrival.is(":checked")?smsArrivalPrice:-smsArrivalPrice;notificationArrival.is(":checked")?notificationArrivalInfo.show("fast"):notificationArrivalInfo.hide("fast"),smsEmailOption.data("price",smsAndEmailNotificationPrice+priceDiff),smsEmailOption.trigger("click")},this))},initAncillaryServices:function(){this.ancillaryServicesPrice.total=0,this.ancillaryServices.live("initPricebar",TP24.proxy(function(){this.ancillaryServicesPrice.total=0,$("tr[id^=ancillaryServiceOption]").each(TP24.proxy(function(index,value){var select=$(value);this.ancillaryServicesPrice[select.attr("id")]=select.data("ancillaryservices-price"),this.ancillaryServicesPrice.total+=Number(this.ancillaryServicesPrice[select.attr("id")])},this))},this)),this.ancillaryServices.live("updatePricebarAdd",TP24.proxy(function(event,id){this.ancillaryServicesPrice.total=Number(this.ancillaryServicesPrice.total);var otherTotal="other"in this.prices?this.prices.other-this.ancillaryServicesPrice.total:0,total=this.totalPrice.total-this.ancillaryServicesPrice.total;this.ancillaryServicesPrice[id]=$(id).data("ancillaryservices-price"),this.ancillaryServicesPrice.total+=Number(this.ancillaryServicesPrice[id]),total+=this.ancillaryServicesPrice.total,this.totalPrice.element.html(TP24.formatPrice(total)),this.totalPrice.total=total;var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotal+=this.ancillaryServicesPrice.total,otherTotalElement.html(TP24.formatPrice(otherTotal)),this.prices.other=otherTotal,this.subtotals.filter("#product-subtotal-ancillaryServices").html(TP24.formatPrice(this.ancillaryServicesPrice.total)),this.checkForZeroPrice("#product-subtotal-ancillaryServices",this.ancillaryServicesPrice.total)},this)),this.ancillaryServices=$("tr[id^=ancillaryServiceOption]").live("updatePricebarRemove",TP24.proxy(function(event,id){this.ancillaryServicesPrice.total=Number(this.ancillaryServicesPrice.total);var total=this.totalPrice.total-this.ancillaryServicesPrice.total,otherTotal="other"in this.prices?this.prices.other-this.ancillaryServicesPrice.total:0;this.ancillaryServicesPrice[id]=$(id).data("ancillaryservices-price"),this.ancillaryServicesPrice.total-=Number(this.ancillaryServicesPrice[id]),total+=this.ancillaryServicesPrice.total,this.totalPrice.element.html(TP24.formatPrice(total)),this.totalPrice.total=total;var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotal+=this.ancillaryServicesPrice.total,otherTotalElement.html(TP24.formatPrice(otherTotal)),this.prices.other=otherTotal,this.subtotals.filter("#product-subtotal-ancillaryServices").html(TP24.formatPrice(this.ancillaryServicesPrice.total)),this.checkForZeroPrice("#product-subtotal-ancillaryServices",this.ancillaryServicesPrice.total)},this))},initPaymentMethodsWithExtraCharges:function(){this.paymentCharge=$("#product-subtotal-paymentCharges").data("price"),this.totalPriceWithoutPaymentCharge=this.totalElement.data("total")-this.paymentCharge,this.otherChargesWithoutPaymentCharges=this.otherTotal.data("price")-this.paymentCharge,this.creditCards.change(TP24.proxy(this.creditCardOptionSelected,this));var loadPaymentType=function(event,data){this.creditCardsRadio==data.id?this.creditCardOptionSelected({target:this.creditCards.children("option[value="+this.creditCardLastSelected+"]")}):this.instantBankRadio==data.id?(this.updateSidebarCharges(this.instantBankPrice,"payment"),this.hideInstallments()):this.terminalRadio==data.id?(this.updateSidebarCharges(this.terminalPrice,"payment"),this.hideInstallments()):(this.updateSidebarCharges(0,"payment"),this.hideInstallments())};TP24.observe("TP24:PaymentTypeEnabled",loadPaymentType,this)},initPrices:function(){this.selectedOptions.each(TP24.proxy(function(index,value){var element=$(value),hierarchy=element.data("hierarchy").split("-"),group=hierarchy[0],name=hierarchy[1];if(hierarchy.length===3){var subgroup=hierarchy[2];this.prices[group+subgroup+name]=element.data("price")}this.prices[group+name]||(this.prices[group+name]=0),this.prices[group+name]+=element.data("price")},this)),this.totals.each(TP24.proxy(function(index,value){var element=$(value),group=element.attr("id").split("-")[2];this.prices[group]=element.data("price")},this))},initCatcher:function(){TP24.observe(this.event,this.catcher,this)},initThrower:function(){this.options.click(TP24.proxy(function(event){var element=$(event.target),hierarchy=element.data("hierarchy").split("-"),group=hierarchy[0],subgroup=null,name=hierarchy[1];hierarchy.length===3&&(subgroup=hierarchy[2]),this.options.filter(d.template({group:group},this.hierarchyTemplate)).not(element).removeClass(this.selectedClass),element.addClass(this.selectedClass);var price=d.isCheckbox(element)&&!element.is(":checked")?0:element.data("price");TP24.fire(this.event,{group:group,name:name,subgroup:subgroup,price:price})},this))},hideInstallments:function(){this.numberOfInstallments.val(0).change(),$("#installment-select").hide(),$("#installment-details").hide(),$("#installments-checkbox").attr("checked",!1)},creditCardOptionSelected:function(event){var element=$(event.target),option=d.tag(element)==="select"?element.children(":selected"):element;this.creditCardLastSelected=this.creditCards.val(),this.creditCardLocallyChargeable=option.data("locally-chargeable");var subtotal=option.data("card-price")||0;this.updateSidebarCharges(subtotal,"payment"),this.hideInstallments()},installmentOptionSelected:function(){this.installmentLastSelected=parseInt(this.numberOfInstallments.val());var subtotal=this.installmentLastSelected>1?this.installmentChargesFromTotalPriceWithoutInstallmentCharge():0;this.updateSidebarCharges(subtotal,"installments")},updateInstallmentAndPaymentChargesForInstallments:function(charge){var total=0,otherTotal=0;this.installmentCharge=charge,this.shouldSubstractInstallmentCharges=this.installmentCharge>0,total=this.totalPriceWithoutInstallmentCharge+this.installmentCharge,otherTotal=this.otherChargesWithoutInstallmentCharges+this.installmentCharge,this.totalPriceWithoutInstallmentCharge=total-this.installmentCharge,this.otherChargesWithoutInstallmentCharges=otherTotal-this.installmentCharge,this.totalPriceWithoutPaymentCharge=total-this.paymentCharge,this.otherChargesWithoutPaymentCharges=otherTotal-this.paymentCharge,this.totalPrice.total=total,this.prices.other=otherTotal},updateInstallmentAndPaymentChargesForPayment:function(charge){var total=0,otherTotal=0;this.paymentCharge=charge;var additionalCharge=this.shouldSubstractInstallmentCharges?this.installmentCharge:0;this.shouldSubstractInstallmentCharges=!1,total=this.totalPriceWithoutPaymentCharge+this.paymentCharge-additionalCharge,otherTotal=this.otherChargesWithoutPaymentCharges+this.paymentCharge-additionalCharge,this.installmentCharge=0,this.totalPriceWithoutInstallmentCharge=total,this.otherChargesWithoutInstallmentCharges=otherTotal,this.totalPrice.total=total,this.prices.other=otherTotal},updateSidebarCharges:function(charge,type){var productSubtotalElementToUpdate="";type=="payment"?(this.updateInstallmentAndPaymentChargesForPayment(charge),productSubtotalElementToUpdate="#product-subtotal-paymentCharges"):type=="installments"&&(this.updateInstallmentAndPaymentChargesForInstallments(charge),productSubtotalElementToUpdate="#product-subtotal-installmentCharges"),this.totalPrice.element.html(TP24.formatPrice(this.totalPrice.total)),this.subtotals.filter(productSubtotalElementToUpdate).html (TP24.formatPrice(charge));var otherTotalElement=this.totals.filter(d.template({group:"other"},this.totalsTemplate));otherTotalElement.html(TP24.formatPrice(this.prices.other)),this.updatePaymentInfoForNotEuroCurrency()},updatePaymentInfoForNotEuroCurrency:function(){this.creditCardLocallyChargeable==0||!this.creditCardLocallyChargeable==undefined?$("#js-creditcard-locally-chargeable").fadeIn(300):$("#js-creditcard-locally-chargeable").fadeOut(300),$("#payment-credit-card-total").html(TP24.formatPrice(this.totalPrice.total));var totalInEuroSelector=$("#payment-credit-card-total-euro"),conversion=totalInEuroSelector.data("conversion");totalInEuroSelector.html(TP24.formatPrice(this.totalPrice.total/conversion,2,{currency:"\u20ac",round:!1}))},catcher:function(){var data=arguments[1],total=this.totalPrice.total-this.prices[data.group];this.prices[data.group]=this.prices[data.group]-this.prices[data.group+data.name],data.subgroup?(this.prices[data.group+data.name]=this.prices[data.group+data.name]-this.prices[data.group+data.subgroup+data.name],this.prices[data.group+data.subgroup+data.name]=data.price,this.prices[data.group+data.name]=this.prices[data.group+data.name]+this.prices[data.group+data.subgroup+data.name]):this.prices[data.group+data.name]=data.price,this.prices[data.group]=this.prices[data.group]+this.prices[data.group+data.name],this.subtotals.filter(d.template({name:data.name},this.subtotalsTemplate)).html(TP24.formatPrice(this.prices[data.group+data.name]));var totalElement=this.totals.filter(d.template({group:data.group},this.totalsTemplate));totalElement.html(TP24.formatPrice(this.prices[data.group])),total+=this.prices[data.group],this.installmentCharge=this.installmentChargesFromTotalPrice(),this.totalPrice.element.html(TP24.formatPrice(total)),this.totalPrice.total=total,this.totalPriceWithoutPaymentCharge=total-this.paymentCharge,this.totalPriceWithoutInstallmentCharge=total-this.installmentCharge,this.otherChargesWithoutPaymentCharges=this.prices.other- this.paymentCharge,this.otherChargesWithoutInstallmentCharges=this.prices.other-this.installmentCharge;var numberOfInstallments=parseInt(this.installmentLastSelected);numberOfInstallments>1&&(data.name=="sms"||data.name=="servicePackages"||data.name=="voucher")&&(this.shouldSubstractInstallmentCharges=!0,this.installmentCharge=this.installmentChargesFromTotalPrice(),this.numberOfInstallments.val(numberOfInstallments).change()),this.updatePaymentInfoForNotEuroCurrency(),this.checkForZeroPrice("#product-subtotal-"+data.name,this.prices[data.group+data.name])},installmentChargesFromTotalPriceWithoutInstallmentCharge:function(){return+(this.totalPriceWithoutInstallmentCharge*(this.installmentLastSelected+1)*TP24App.Config.installmentsInterest).toFixed(2)},installmentChargesFromTotalPrice:function(){var numberOfInstallments=parseInt(this.installmentLastSelected);return numberOfInstallments>1?+((this.totalPrice.total-this.installmentCharge)*(numberOfInstallments+1)*TP24App.Config.installmentsInterest).toFixed(2):0},triggerChanges:function(){$("#payment-creditCardVendor").trigger("change"),this.numberOfInstallments.val(0).change()},checkForZeroPrice:function(element,price){price==0?$(element).parent().hide():$(element).parent().show(),this.prices.other==0?$("#pricebar-other-charges").hide():$("#pricebar-other-charges").show()}}),FlightFilter=Parent.extend({sliderRanges:{},isTrackerFilterUsed:!1,obUseDepTime:null,ibUseDepTime:null,sliderTarget:null,priceMin:null,priceMax:null,filterPriceMin:null,filterPriceMax:null,visibleMinPrice:null,visibleMaxPrice:null,sliderPrice:null,isRoundTrip:null,reloading:null,submitTimeout:0,form:null,RUN:["initGlobals","initFilters","initSliderPrice","initForm","initLegs"],initGlobals:function(){this.sliderRanges=TP24_Flight_Results_Filter_initData,this.obUseDepTime=$('[name="filter[obUseDepTime]"]'),this.ibUseDepTime=$('[name="filter[ibUseDepTime]"]'),this.sliderTarget=$(".slider-target"),this.filterPriceMin=$("#filter-priceMin"),this.filterPriceMax=$("#filter-priceMax"),this.sliderPrice=$("#slider-price"),this.isRoundTrip=$("#hidden-isRoundtrip").val()=="1",this.reloading=$("#reloading"),this.results=$("#results"),this.form=$("form#filterCriteria"),this.visibleMinPrice=$("#slider-min-visible-price"),this.visibleMaxPrice=$("#slider-max-visible-price"),this.toggleAllPaymentMethods=$("#filter-toggle-paymentMethods"),this.paymentMethods=$("[id^=filter-paymentMethods]"),this.toggleAllAirlines=$("#filter-toggle-airlines"),this.airlines=$("[id^=filter-airlineCodes]")},initFilters:function(){$.each(["ob","ib"],TP24.proxy(function(index,value){this.showTimeSlider(value)},this)),this.obUseDepTime.change(TP24.proxy(function(){this.showTimeSlider("ob")},this)),this.ibUseDepTime.change(TP24.proxy(function(){this.showTimeSlider("ib")},this)),this.sliderTarget.attr("readonly","readonly"),this.priceMin=parseInt(this.filterPriceMin.val(),10),this.priceMax=parseInt(this.filterPriceMax.val(),10),this.visibleMinPrice.children("span").html(TP24.formatPrice(this.priceMin,0)),this.visibleMaxPrice.children("span").html(TP24.formatPrice(this.priceMax,0)),this.toggleAllPaymentMethods.click(TP24.proxy(function(event){$(event.target).is(":checked")?this.paymentMethods.attr("checked",!0):this.paymentMethods.attr("checked",!1)},this)),this.toggleAllAirlines.click(TP24.proxy(function(event){$(event.target).is(":checked")?this.airlines.attr("checked",!0):this.airlines.attr("checked",!1)},this))},initSliderPrice:function(){var config={};config.range=!0,config.min=this.sliderRanges.price.min,config.max=this.sliderRanges.price.max,config.values=[this.priceMin,this.priceMax],config.slide=TP24.proxy(function(event,ui){this.filterPriceMin.val(ui.values[0]),this.filterPriceMax.val(ui.values[1]),this.updateVisiblePrice(TP24.formatPrice(ui.values[0],0),TP24.formatPrice(ui.values[1],0))},this),config.change=TP24.proxy(function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"filterPriceResult"),this.trackerFilterUsed(),this.submitFilter()},this),this.sliderPrice.slider(config)},initLegs:function(){var legTypes=this.isRoundTrip?["ob","ib"]:["ob"],directions=["Dep","Arr"];for(var i in legTypes)for(var j in directions)(function(_this){var id=legTypes[i]+directions[j]+"Time",inputMin="#filter-"+id+"Min",inputMax="#filter-"+id+"Max",minVal=_this.convertHoursToMinutes($(inputMin).val()),maxVal=_this.convertHoursToMinutes($(inputMax).val());$("#slider-min-visible-"+id).html($(inputMin).val()),$("#slider-max-visible-"+id).html($(inputMax).val()),$("#slider-"+id).slider({range:!0,min:_this.convertHoursToMinutes(_this.sliderRanges[id].min),max:_this.convertHoursToMinutes(_this.sliderRanges[id].max),values:[minVal,maxVal],slide:function(event,ui){var minTime=_this.convertMinutesToHours(ui.values[0]),maxTime=_this.convertMinutesToHours(ui.values[1]);$(inputMin).val(minTime),$(inputMax).val(maxTime),$("#slider-min-visible-"+id).html(minTime),$("#slider-max-visible-"+id).html(maxTime)},change:function(){directions==="Dep"?TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"filterDepartureTimeResult"):TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"filterReturnTimeResult"),_this.trackerFilterUsed(),_this.submitFilter()}})})(this)},updateVisiblePrice:function(min,max){this.visibleMinPrice.children("span").html(min),this.visibleMaxPrice.children("span").html(max)},initForm:function(){this.form.find("input[type!=text]").change(TP24.proxy(function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"filterOther"),this.trackerFilterUsed(),this.submitFilter()},this)),this.form.ajaxForm({target:"#results",beforeSubmit:TP24.proxy(function(){this.reloading.css("height",d.px(this.results.height())).fadeIn("fast")},this),success:TP24.proxy(function(){this.reloading.fadeOut("fast")},this)})},showTimeSlider:function(leg){var arrTime=$("#"+leg+"ArrTime"),depTime=$("#"+leg+"DepTime"),checked=this[leg+"UseDepTime"].filter(":checked").val();checked==1?(arrTime.hide(),depTime.show()):(arrTime.show(),depTime.hide())},convertHoursToMinutes:function(value){var hoursAndMinutes=value.split(":");return parseInt (hoursAndMinutes[0],10)*60+parseInt(hoursAndMinutes[1],10)},convertMinutesToHours:function(minutes){var hours=parseInt(minutes/60,10);return minutes-=hours*60,hours=hours<10?"0"+hours:hours,minutes=minutes<10?"0"+minutes:minutes,[hours,minutes].join(":")},submitFilter:function(){clearTimeout(this.submitTimeout),this.submitTimeout=setTimeout(TP24.proxy(function(){this.form.submit()},this),350)},trackerFilterUsed:function(){this.isTrackerFilterUsed||(TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"filterUsedResult"),this.isTrackerFilterUsed=!0)}}),FlightFacebookTracking=Parent.extend({cookieName:"tp24_facebookUserID",RUN:["trackFacebookPost"],trackFacebookPost:function(){var cookieValue=$.cookie(this.cookieName);cookieValue&&cookieValue!="undefined"&&(TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"facebookDiscountPostedSuccess"),$.cookie(this.cookieName,"undefined"))}}),AirportLounges=Parent.extend({selector:"_lounges-form",RUN:["initGlobals","initButtons","initRadios"],buttons:null,radios:{},directions:["outbound","inbound"],buttonSelector:".book-lounge-button",radioSelectorPrefix:'input[name="addons[airportLounges][',radioSelectorSuffix:']"]',checkedButtons:{},checkedButtonClass:"btn-remove",checkedTextDataAttr:"checked-text",uncheckedTextDataAttr:"unchecked-text",initGlobals:function(){this.buttons=this.get(this.buttonSelector),$.each(this.directions,TP24.proxy(function(_,direction){var selector=this.radioSelectorPrefix+direction+this.radioSelectorSuffix;this.radios[direction]=this.get(selector)},this))},initButtons:function(){this.buttons.click(TP24.proxy(function(event){var _this=$(event.target).closest(this.buttonSelector),direction=_this.data("direction"),value=_this.data("value"),radio=this.radios[direction];radio.filter(":checked").val()==value?(radio.filter("[value=0]").click(),this.uncheckButton(_this),this.checkedButtons[direction]=null):(this.uncheckButton(this.checkedButtons[direction]),radio.filter("[value="+value+"]").click(),this.checkButton(_this))},this))},initRadios:function(){$.each(this.radios,TP24.proxy(function(_,radio){var value=radio.filter(":checked").val();if(typeof value!="undefined"&&value!=0){var button=radio.filter(":checked").next().find(this.buttonSelector);this.checkButton(button)}},this))},checkButton:function(button){button.addClass(this.checkedButtonClass),button.html(button.data(this.uncheckedTextDataAttr));var direction=button.data("direction");this.checkedButtons[direction]=button},uncheckButton:function(button){button&&(button.removeClass(this.checkedButtonClass),button.html(button.data(this.checkedTextDataAttr)))}}),OfferCountdown=Parent.extend({RUN:["initSwf"],initSwf:function(){var flashvars={},params={};params.wmode="transparent",flashvars.configPath="/offers-flights.xml",swfobject.embedSWF("/swf/counter.swf","offers_flash","320","80","9.0.124",null,flashvars,params)}}),PolishOfferCountdown=Parent.extend({RUN:["initSwf"],initSwf:function(){var flashvars={},params={};params.wmode="transparent",flashvars.configPath="/offers-flights-polish.xml",swfobject.embedSWF("/swf/counter.swf","offers_flash","320","80","9.0.124",null,flashvars,params)}}),FlightResults=Parent.extend({RUN:["initResults"],initResults:function(){var _flightResultsObject=this;$(".select-flight").live("click",function(event){var _this=$(this);_this.parents(".leg").find(".selected").removeClass("selected"),_this.parents("tr").addClass("selected"),_this.parents("div.leg").find("tr.segment").each(function(){$(this).hasClass("disabled")&&$(this).removeClass("disabled")}),_flightResultsObject.checkIfConnectionsHaveMinimumTimeDifference(_this)}),this.trackPriceRadarConsistency()},trackPriceRadarConsistency:function(){if(window.trackPriceRadarData!==undefined){var trackPriceRadarData=$.parseJSON(window.trackPriceRadarData);TP24.track("Flights / Price Radar","Track Consistency ",trackPriceRadarData.label,trackPriceRadarData.percentage)}},checkIfConnectionsHaveMinimumTimeDifference:function(_clickedObject){var _this=this,inBoundTime="",outBoundTime="",selected={};_clickedObject.parents("div.leg").hasClass("inbound")?(selected=_clickedObject.parents(".fare").find(".outbound").find("tr.selected"),inBoundTime=_clickedObject.parents("tr.segment").find("td.depart").data("timestamp"),_clickedObject.parents(".fare").find(".outbound").find("tr.segment").each(function(){outBoundTime=$(this).find("td.arrive").data("timestamp"),_this.fadeElementsWithMinimumTimeDifference(_this,this,outBoundTime,inBoundTime)}),_this.checkIfSelectedElementHasFaded(_clickedObject,selected,"outbound")):(selected=_clickedObject.parents(".fare").find(".inbound").find("tr.selected"),outBoundTime=_clickedObject.parents("tr.segment").find("td.arrive").data("timestamp"),_clickedObject.parents(".fare").find(".inbound").find("tr.segment").each(function(){inBoundTime=$(this).find("td.depart").data("timestamp"),_this.fadeElementsWithMinimumTimeDifference(_this,this,outBoundTime,inBoundTime)}),_this.checkIfSelectedElementHasFaded(_clickedObject,selected,"inbound"))},getMinuteDifference:function(outBoundTime,inBoundTime){return inBoundTime/60-outBoundTime/60},fadeElementsWithMinimumTimeDifference:function(_flightResultsObject,_currentObject,_outBoundTime,_inBoundTime){_flightResultsObject.getMinuteDifference(_outBoundTime,_inBoundTime)<180?$(_currentObject).addClass("disabled"):$(_currentObject).removeClass("disabled")},checkIfSelectedElementHasFaded:function(_clickedObject,_selectedObject,_boundType){_selectedObject.hasClass("disabled")&&$(_clickedObject.parents(".fare").find("."+_boundType).find("tr.segment").get().reverse()).each(function(){$(this).hasClass("disabled")||($(this).parents(".leg").find(".selected").removeClass("selected"),$(this).addClass("selected"),$(this).find("input").prop("checked",!0))})}}),FlightCityLandingPage=Parent.extend({RUN:["initConfig","initTable"],selector:"_offers",config:{aaSorting:[[4,"asc"]],sPaginationType:"full_numbers",bLengthChange:!1,bFilter:!0,bSort:!0,bInfo:!1,iDisplayLength:25,bAutoWidth:!0,oLanguage:{}},initConfig:function(){this.config.oLanguage.sUrl="/js/plugins/translations/"+TP24.getLocale("LANG")+".txt"},initTable:function(){this.root&&this.root.dataTable(this.config)}}),FlightsUnder100=Parent.extend({RUN:["initGlobals","initAjaxForm","initTicker","initTracking"],flightsUnder100:null,loadingElement:null,form:null,initGlobals:function(){this.flightsUnder100=".flights-under-100",this.loadingElement=$("#cheap-flight-results"),this.form=$("#flight-offers form")},initAjaxForm:function(){this.form.ajaxForm({target:".airports-wrapper",beforeSubmit:TP24.proxy(function(){this.beforeSubmit()},this),success:TP24.proxy(function(){this.afterSubmit()},this)}),this.form.find("select").change(TP24.proxy(function(){this.form.submit()},this))},initTicker:function(){$(this.flightsUnder100).vTicker({speed:700,pause:3500,animation:"fade",mousePause:!0,showItems:13})},initTracking:function(){$("a.flights-under-100-results").live("click",function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FLIGHT,"clickFlightsUnder100")})},beforeSubmit:function(){this.loadingElement.fadeOut("fast")},afterSubmit:function(){this.loadingElement.fadeIn("slow"),this.initTicker()}}),FlightCalendarOffer=Parent.extend({RUN:["initGlobals","initDates","initOutboundDatepicker","initInboundDatepicker","initForm"],outboundCalendarOffer:null,inboundCalendarOffer:null,outboundDates:null,inboundDates:null,outboundDateInput:null,inboundDateInput:null,obMinDate:null,ibMinDate:null,loadingPrice:null,loadingCalendar:null,form:null,counter:null,datepickerDefaults:{changeMonth:!1,defaultDate:null,buttonImage:"",duration:"",maxDate:"1y",numberOfMonths:1},initGlobals:function(){this.form=$("#calendarOffer"),this.outboundCalendarOffer=$("#outboundCalendarOffer"),this.inboundCalendarOffer=$("#inboundCalendarOffer"),this.outboundDateInput=$("input[name=obDate]"),this.inboundDateInput=$("input[name=ibDate]"),this.loadingPrice=$(".offer-price"),this.loadingCalendar=$(".date-picker-wrapper *"),this.datepickerDefaults.dayNamesMin=$.datepicker.regional [TP24.CONFIG.LOCALE.LANG].dayNamesShort,FlightCalendarOffer_datesWithFlights.inboundDates.length===0&&FlightCalendarOffer_datesWithFlights.outboundDates.length!=0&&(this.datepickerDefaults.numberOfMonths=2),this.obMinDate=new Date},initDates:function(){var outboundDateStrings=FlightCalendarOffer_datesWithFlights.outboundDates,inboundDateStrings=FlightCalendarOffer_datesWithFlights.inboundDates;this.minimumStay=FlightCalendarOffer_minimumStay,this.outboundDates=[],this.inboundDates=[];if(outboundDateStrings!=null){for(var i in outboundDateStrings)this.outboundDates[i]=this.createDateFromString(outboundDateStrings[i]);if(inboundDateStrings.length!==0)for(var i in inboundDateStrings)this.inboundDates[i]=this.createDateFromString(inboundDateStrings[i])}this.setObMinDate(),this.setIbMinDate()},initOutboundDatepicker:function(){var outboundCalendarOfferOptions=$.extend({beforeShowDay:this.buildGetDayStyleForFunction(this.outboundDates),onSelect:TP24.proxy(function(){var outboundDate=this.outboundCalendarOffer.datepicker("getDate");this.obMinDate=outboundDate,this.setDateInputValue(this.outboundCalendarOffer,this.outboundDateInput),this.setIbMinDate(),this.inboundCalendarOffer.length>0&&this.setDateInputValue(this.inboundCalendarOffer,this.inboundDateInput)},this)},this.datepickerDefaults);this.outboundCalendarOffer.datepicker(outboundCalendarOfferOptions),this.outboundCalendarOffer.datepicker("setDate",this.obMinDate),$("#outboundCalendarOffer .ui-datepicker-title").prepend(''+TP24.t("Departure")+": ")},initInboundDatepicker:function(){var inboundCalendarOfferOptions=$.extend({beforeShowDay:this.buildGetDayStyleForFunction(this.inboundDates),onSelect:TP24.proxy(function(){this.setDateInputValue(this.inboundCalendarOffer,this.inboundDateInput)},this)},this.datepickerDefaults);this.inboundCalendarOffer.datepicker(inboundCalendarOfferOptions),this.inboundCalendarOffer.datepicker("setDate",this.ibMinDate),$("#inboundCalendarOffer .ui-datepicker-title").prepend(''+TP24.t("Return")+": ")},initForm:function(){this.form.ajaxForm({target:"#flight-offers-show",beforeSubmit:TP24.proxy(function(){this.loadingPrice.animate({opacity:".6"},200),this.loadingCalendar.animate({opacity:".4"},200)},this),success:TP24.proxy(function(){this.init(),this.initCounter()},this)}),this.setDateInputValue(this.outboundCalendarOffer,this.outboundDateInput),this.setDateInputValue(this.inboundCalendarOffer,this.inboundDateInput)},initCounter:function(){this.counter=$("#counter"),this.counter.length>0&&this.counter.countdown({image:"/img/digits-small.png",startTime:typeof time_countdown!="undefined"?time_countdown:"00:00:00:00"})},buildGetDayStyleForFunction:function(legDates){return TP24.proxy(function(date){return this.getDayStyleFor(legDates,date)},this)},getDayStyleFor:function(legDates,day){for(var i in legDates)if(day.getTime()==legDates[i].getTime())return[!0,"hasFlight"];return[!1]},setObMinDate:function(){var now=new Date,today=new Date(now.getFullYear(),now.getMonth(),now.getDate());for(var i in this.outboundDates)if(this.outboundDates[i].getTime()>=today.getTime()){this.outboundCalendarOffer.datepicker("option","minDate",this.outboundDates[i]),this.obMinDate=this.outboundDates[i];break}},setIbMinDate:function(){var ibMinStay=new Date(this.obMinDate.getFullYear(),this.obMinDate.getMonth(),this.obMinDate.getDate());ibMinStay.setDate(ibMinStay.getDate()+this.minimumStay);for(var i in this.inboundDates)if(this.inboundDates[i].getTime()>=ibMinStay.getTime()){this.inboundCalendarOffer.datepicker("option","minDate",this.inboundDates[i]),this.ibMinDate=this.inboundDates[i];break}},setDateInputValue:function(calendarDatepicker,input){var date=calendarDatepicker.datepicker("getDate"),inputValue=this.formatDate(calendarDatepicker,date);input.val(inputValue)},formatDate:function(calendarDatepicker,date){var dateFormat=calendarDatepicker.datepicker("option","dateFormat");return $.datepicker.formatDate(dateFormat,date)},createDateFromString:function(dateString){var dateValues=dateString.split(",");return new Date(dateValues[0],dateValues[1]-1,dateValues[2])}}),FlightCalendarOfferWidget=Parent.extend({RUN:["initGlobals","initForm","onSelect"],loadingOffers:null,form:null,select:null,options:null,initGlobals:function(){this.form=$("#calendarOffer"),this.select=$("#calendarOfferSelect"),this.options={target:"#flight-offers-widget"}},initForm:function(){var that=this;this.form.ajaxForm({target:"#flight-offers-widget",success:function(data){$("#flight-offers-widget").fadeOut(300,function(){$("#flight-offers-widget").html(data),$("#flight-offers-widget").fadeIn(300)})}})},onSelect:function(){var that=this;this.select.change(function(){that.form.submit()})}}),FlightAccessories=Parent.extend({RUN:["initGlobals"],initGlobals:function(){this.select=$('select[id^="addons-accessories-"]'),this.onSelect()},onSelect:function(){this.select.change(function(event){var priceElement=$("#"+event.target.id+"-price");priceElement.fadeOut(300,function(){priceElement.html($(event.target).val()+" x "),priceElement.fadeIn(300)});var removeMessageElement=$("#"+event.target.id+"-message-remove"),successMessageElement=$("#"+event.target.id+"-message");successMessageElement.fadeOut(300,function(){removeMessageElement.fadeOut(300,function(){$(event.target).val()==0?(removeMessageElement.fadeIn(300),removeMessageElement.removeClass("hidden"),successMessageElement.addClass("hidden")):(successMessageElement.fadeIn(300),removeMessageElement.addClass("hidden"),successMessageElement.removeClass("hidden"))})})})}}),FlightInstallments=Parent.extend({RUN:["initGlobals"],initGlobals:function(){this.installmentsValidationMessage=$("#installments-validation-message"),this.installmentsErrorMessage=$("#installments-booking-expiry-error-message"),this.installmentCheck=$("#installments-checkbox"),this.installmentSelect=$("#installment-select"),this.installmentDetails=$("#installment-details"),this.creditCardNumber=$("#payment-creditCardNumber"),this.numberOfInstallments=$("#payment-numberOfInstallments"),this.onChange(),this.onSelect()},hideInstallments:function(){this.installmentSelect.hide(),this.installmentDetails.hide(),this.numberOfInstallments.val(0).change()},getInstallmentPrice:function(){return Math.round(100*window.FlightPriceBar.prototype.totalPrice.total/this.numberOfInstallments.val())/100},onChange:function(){this.installmentCheck.is(":checked")&&this.installmentSelect.show(),this.creditCardNumber.on("keydown",TP24.proxy(function(event){this.hideInstallments(),this.installmentCheck.attr("checked",!1),this.installmentsValidationMessage.hide()},this)),this.installmentCheck.change(TP24.proxy(function(event){this.installmentCheck.is(":checked")?$.ajax({type:"POST",data:{creditCardSuperBin:this.creditCardNumber.val(),amount:window.FlightPriceBar.prototype.totalPrice.total},url:window.location.pathname+"/installments-credit-card-validate?bookingID="+urlParams().bookingID+"&format=json",dataType:"json",beforeSend:TP24.proxy(function(){this.creditCardNumber.removeClass("error")},this),success:TP24.proxy(function(json){json.status!="creditCardSupported"?(this.installmentsValidationMessage.html(json.output),this.installmentCheck.attr("checked",!1),this.installmentSelect.hide(),this.installmentDetails.hide(),(json.status=="emptyCreditCardNumber"||json.status=="notFullCreditCardSuperBin")&&this.creditCardNumber.addClass("error"),this.installmentsValidationMessage.show()):(this.installmentsValidationMessage.hide(),this.installmentSelect.fadeIn(200),this.installmentDetails.fadeIn(200)),this.numberOfInstallments.val(0).change()},this),error:TP24.proxy(function(){window.location.href=window.location.origin,this.installmentsErrorMessage.show(),this.installmentsValidationMessage.hide()},this)}):this.hideInstallments()},this))},onSelect:function(){this.installmentSelect.change(TP24.proxy(function(event){var installmentQuantityElement=$("#installments-quantity"),installmentPriceElement=$("#installments-price"),installment=this.getInstallmentPrice();installmentQuantityElement.html(this.numberOfInstallments.val()+" x "),installmentPriceElement.html(TP24.formatPrice(installment)+" = "+$("#total-price").html()),this.numberOfInstallments.val()?this.installmentDetails.fadeIn(200):(this.numberOfInstallments.find("option").first().attr("selected","selected"),this.installmentDetails.hide())},this))}}),FlightAncillaryServices=Parent.extend({RUN:["initGlobals"],initGlobals:function(){var options=$.parseJSON(ancillaryServices);this.categoryTab=$('li[id^="verticalTab"]'),this.selectType=$('select[id^="addons-ancillaryServicesType"]'),this.addToCartButton=$('button[id^="addons-ancillaryServicesAddToCart"]'),this.removeFromCartButton=$('a[id^="addons-ancillaryServicesRemoveFromCart"]'),this.onLoad(),this.onClick(options),this.onSelect(options)},onClick:function(options){this.categoryTab.click(function(){$($("#"+this.id+" a").attr("href")).hide(),$($("#"+this.id+" a").attr("href")).fadeIn("slow")}),this.addToCartButton.click(TP24.proxy(function(event){var button=$("#"+event.delegateTarget.id);button.hide(),button.removeClass("active");var fareIndex=button.data("fareindex"),legIndex=button.data("legindex"),segmentIndex=button.data("segmentindex"),route=button.data("route"),category=button.data("category"),selectType=$("#addons-ancillaryServicesType"+category+"-"+fareIndex+legIndex+segmentIndex),selectPassenger=$("#addons-ancillaryServicesPassenger"+category+"-"+fareIndex+legIndex+segmentIndex),flightSsrID=$("#addons-ancillaryServicesType"+category+"-"+fareIndex+legIndex+segmentIndex+" option[value='"+selectType.val()+"']").attr("data-ssrid"),passengerIndex=$("#addons-ancillaryServicesPassenger"+category+"-"+fareIndex+legIndex+segmentIndex).val(),selectedPassengerName=$("#addons-ancillaryServicesPassenger"+category+"-"+fareIndex+legIndex+segmentIndex+" option[value='"+selectPassenger.val()+"']").text(),optionIndex=this.getOptionIndex(options,fareIndex,legIndex,segmentIndex,passengerIndex,flightSsrID),selectedOptionIndex=options[optionIndex].index,selectedOptionDescription=options[optionIndex].description,price=options[optionIndex].price,formattedPrice=options[optionIndex].formattedPrice;$("#addons-cart-remove-success").remove();var jsonData={passengerName:selectedPassengerName,selectedOptionDescription:selectedOptionDescription,passengerIndex:passengerIndex,fareIndex:fareIndex,legIndex:legIndex,segmentIndex:segmentIndex,optionIndex:optionIndex,price:price,formattedPrice:formattedPrice,route:route,category:category};$.ajax({type:"POST",data:{optionIndex:selectedOptionIndex},url:window.location.pathname+"/ancillary-services-add-to-cart?bookingID="+urlParams().bookingID+"&format=json",dataType:"json",success:TP24.proxy(function(){this.appendToCart(category,jsonData),selectType.val("default"),$("#"+selectType.attr("id")).trigger("change"),$("#ancillaryServiceOption-"+passengerIndex+fareIndex+legIndex+segmentIndex+selectedOptionIndex).trigger("updatePricebarAdd",["#ancillaryServiceOption-"+passengerIndex+fareIndex+ legIndex+segmentIndex+selectedOptionIndex])},this),error:TP24.proxy(function(xhr,status,error){window.location.href=window.location.origin},this)})},this)),this.removeFromCartButton.live("click",function(){$("#"+this.id).hide();var passengerIndex=$(this).data("passengerindex"),fareIndex=$(this).data("fareindex"),legIndex=$(this).data("legindex"),segmentIndex=$(this).data("segmentindex"),optionIndex=$(this).data("optionindex"),category=$(this).data("category"),selectType=$("#addons-ancillaryServicesType"+category+"-"+fareIndex+legIndex+segmentIndex),option=$("#ancillaryServiceOption-"+passengerIndex+fareIndex+legIndex+segmentIndex+optionIndex);$("#addons-cart-remove-success").remove(),$("#addons-cart-"+category+"-update-message").show(),$("#addons-ancillaryServicesAddToCart-"+category+"-"+fareIndex+legIndex+segmentIndex).hide(),$.ajax({type:"POST",data:{optionIndex:optionIndex},url:window.location.pathname+"/ancillary-services-remove-from-cart?bookingID="+urlParams().bookingID+"&format=json",dataType:"json",success:function(json){$("#"+option.attr("id")).trigger("updatePricebarRemove",["#ancillaryServiceOption-"+passengerIndex+fareIndex+legIndex+segmentIndex+optionIndex]),$("#"+option.attr("id")).remove(),$("#addons-cart-"+category+"-update-message").append('
'+json.message+"
"),selectType.val("default"),$("#"+selectType.attr("id")).trigger("change"),$("#addons-cart-"+category+" tr[id^=ancillaryServiceOption]").length==0&&$("#addons-cart-"+category).hide()},error:function(xhr,status,error){window.location.href=window.location.origin}})})},onSelect:function(options){this.selectType.change(TP24.proxy(function(event){var selectBox=$("#"+event.delegateTarget.id),categoryNeedsDimensions=selectBox.data("categoryneedsdimensions"),fareIndex=selectBox.data("fareindex"),legIndex=selectBox.data("legindex"),segmentIndex=selectBox.data("segmentindex"),category=selectBox.data("category"),multiOptionsAllowed=selectBox.data("multioptionsallowed"),multiOptionsOfSameSsrAllowed=selectBox.data("multioptionsofsamessrallowed"),categorySelectedTranslation=selectBox.data("categoryselectedtranslation"),passengerOptions=selectBox.data("passengeroptions"),dimensionsInfo=$("#dimensions-info-"+category+"-"+fareIndex+legIndex+segmentIndex),addToCartButton=$("#addons-ancillaryServicesAddToCart-"+category+"-"+fareIndex+legIndex+segmentIndex),passengerSelectbox=$("#addons-ancillaryServicesPassenger"+category+"-"+fareIndex+legIndex+segmentIndex);$("#ancillaryServiceOptionDimensions-"+fareIndex+legIndex+segmentIndex).remove(),dimensionsInfo.hide();if($("#"+selectBox.attr("id")).val()=="default")addToCartButton.hide(),(multiOptionsAllowed!=1||multiOptionsOfSameSsrAllowed!=1)&&this.resetPassengerSelectBox(passengerSelectbox,passengerOptions);else{addToCartButton.show();var flightSsrID=$("#"+selectBox.attr("id")+" option[value='"+$("#"+selectBox.attr("id")).val()+"']").attr("data-ssrid");(multiOptionsAllowed!=1||multiOptionsOfSameSsrAllowed!=1)&&this.updatePassengerSelectBoxAccordingToCart(options,passengerSelectbox,passengerOptions,fareIndex,legIndex,segmentIndex,flightSsrID,categorySelectedTranslation,category,multiOptionsAllowed,multiOptionsOfSameSsrAllowed),categoryNeedsDimensions==1&&this.createDimensionsInfoContent(options,fareIndex,legIndex,segmentIndex,flightSsrID,category,dimensionsInfo)}($("#"+selectBox.attr("id")).val()=="noOptions"||passengerSelectbox.val()=="noOptions")&&addToCartButton.hide()},this))},onLoad:function(){this.loadSelectedOptions=$(TP24.proxy(function(){var optionsToLoad=$.parseJSON(selectedOptions);$.each(optionsToLoad,TP24.proxy(function(index,option){var jsonData={passengerName:option.passengerName,selectedOptionDescription:option.description,passengerIndex:option.passengerIndex,fareIndex:option.fareIndex,legIndex:option.legIndex,segmentIndex:option.segmentIndex,optionIndex:option.index,price:option.price,formattedPrice:option.formattedPrice,route:option.route,category:option.category};this.appendToCart (option.category,jsonData)},this)),$("tr[id^=ancillaryServiceOption]").trigger("initPricebar")},this))},getOptionIndex:function(options,fareIndex,legIndex,segmentIndex,passengerIndex,flightSsrID){for(var i=0;i'+categorySelectedTranslation+"")},createDimensionsInfoContent:function(options,fareIndex,legIndex,segmentIndex,flightSsrID,category,dimensionsInfo){var passengerIndex=$("#addons-ancillaryServicesPassenger"+category+"-"+fareIndex+legIndex+segmentIndex).val(),optionIndex=this.getOptionIndex (options,fareIndex,legIndex,segmentIndex,passengerIndex,flightSsrID);if(optionIndex!=-1)var weightUnit=options[optionIndex].weightUnit,dimensionsUnit=options[optionIndex].dimensionsUnit,maxWeight=options[optionIndex].maxWeight,maxLength=options[optionIndex].maxLength,maxHeight=options[optionIndex].maxHeight,maxWidth=options[optionIndex].maxWidth;var jsonData=new Array;jsonData.fareIndex=fareIndex,jsonData.legIndex=legIndex,jsonData.segmentIndex=segmentIndex,jsonData.maxWeight=maxWeight+" "+weightUnit,maxWeight>0&&maxLength>0&&maxHeight>0&&maxWidth>0&&weightUnit&&dimensionsUnit?(jsonData.maxDimensions=maxLength+" "+dimensionsUnit+" x "+maxHeight+" "+dimensionsUnit+" x "+maxWidth+" "+dimensionsUnit,$("#"+dimensionsInfo.attr("id")+" table tbody").append(_.template($("#ancillary-services-weight-dimensions-template").html(),jsonData)),$("#dimensions-"+category+"-"+fareIndex+legIndex+segmentIndex).show(),dimensionsInfo.fadeIn("slow")):weightUnit&&maxWeight>0&&maxLength==0&&maxHeight==0&&maxWidth==0&&($("#"+dimensionsInfo.attr("id")+" table tbody tr").append(_.template($("#ancillary-services-weight-template").html(),jsonData)),$("#dimensions-"+category+"-"+fareIndex+legIndex+segmentIndex).hide(),dimensionsInfo.fadeIn("slow"))},appendToCart:function(category,data){$("#addons-cart-"+category).show(),$("#addons-cart-"+category+" table tbody").append(_.template($("#ancillary-services-cart-template").html(),data))}}),FlightBaggageAncillaryServices=Parent.extend({RUN:["initGlobals"],initGlobals:function(){var isNonMixedLowCostRoundtrip=$.parseJSON(isNonMixedLowCostRoundtrip);this.selectBaggage=$('select[id^="addons-baggageAncillaryServices"]'),this.totalPrice=$("#addons-baggageAncillaryServicesTotalPrice"),this.totalPriceText=$("#"+this.totalPrice.attr("id")).text(),$("#addons-baggageAncillaryServicesTotalPrice").attr("data-price",0),this.onSelect(),this.selectBaggage.trigger("change")},onSelect:function(){this.selectBaggage.change(TP24.proxy(function(event){selectBox=$("#"+event.delegateTarget.id),this.updatePrice(selectBox),ancillaryIdentifier=event.delegateTarget.id.substr(event.delegateTarget.id.length-3),fareIndex=ancillaryIdentifier.charAt(0),legIndex=ancillaryIdentifier.charAt(1),passengerIndex=ancillaryIdentifier.charAt(2),isNonMixedLowCostRoundtrip=="true"&&(selectedOptionIndex=$("#"+selectBox.attr("id")).prop("selectedIndex"),complementaryLeg=legIndex==0?1:0,complementaryAncillaryIdentifier=fareIndex+complementaryLeg+passengerIndex,$("#addons-baggageAncillaryServices-"+complementaryAncillaryIdentifier+" option:eq("+selectedOptionIndex+")").attr("selected","selected"),selectBox=$("#addons-baggageAncillaryServices-"+complementaryAncillaryIdentifier),price=parseFloat($("#"+selectBox.attr("id")+" option[value='"+$("#"+selectBox.attr("id")).val()+"']").attr("data-price")),this.updatePrice(selectBox),price>0&&!$("#addons-baggageAncillaryServices-"+fareIndex+legIndex+passengerIndex).attr("disabled")?($("#"+selectBox.attr("id")).attr("disabled",!0),$("#"+selectBox.attr("id")).append('')):($("#"+selectBox.attr("id")).removeAttr("disabled"),$("#addons-baggageAncillaries-hidden"+complementaryAncillaryIdentifier).remove()))},this))},updatePrice:function(selectBox){selectedOption=$("#"+selectBox.attr("id")+" option[value='"+$("#"+selectBox.attr("id")).val()+"']"),priceElement=$("#addons-baggageAncillaryServicesPrice-"+selectBox.attr("id").split("-")[2]),priceElement.html(TP24.formatPrice(selectedOption.attr("data-price"))),oldPrice=$("#"+priceElement.attr("id")).attr("data-price")?parseFloat($("#"+priceElement.attr("id")).attr("data-price")):0,newPrice=parseFloat(selectedOption.attr("data-price")),oldTotalPrice=parseFloat($("#"+this.totalPrice.attr("id")).attr("data-price")),newTotalPrice=oldTotalPrice- oldPrice+newPrice,$("#"+priceElement.attr("id")).attr("data-price",newPrice),$("#"+this.totalPrice.attr("id")).attr("data-price",newTotalPrice),$("#"+this.totalPrice.attr("id")).html(this.totalPriceText+" "+TP24.formatPrice(newTotalPrice)),$("#"+this.totalPrice.attr("id")).trigger("updateBaggagePrice",[oldTotalPrice,newTotalPrice])}}),FlightIdentification=Parent.extend({RUN:["initGlobals"],formOfIdentificationSelectBoxes:$('[class^="formOfIdentificationSelectBox-"]'),initGlobals:function(){this.onChange()},onChange:function(){this.formOfIdentificationSelectBoxes.on("change",function(){var $this=$(this);$passengerIndex=$this.attr("name").substr(11,1),identityFields=".identityField-"+$passengerIndex,console.log("identityFields = "+identityFields),passportFields=".passportField-"+$passengerIndex,console.log("passportFields = "+passportFields),console.log("this.val = "+$this.val()),$this.val()=="passport"?(console.log("I am inside passport fields show condition"),$(identityFields).hide(),$(passportFields).show()):$this.val()=="identity"&&(console.log("I am inside identity fields show condition"),$(passportFields).hide(),$(identityFields).show())})}}),FlightNotificationTracking=Parent.extend({RUN:["sendTrackEvents"],sendTrackEvents:function(){$(".btn-primary").click(TP24.proxy(this.trackEvents,this))},trackEvents:function(){var version=$("#notification-arrival").attr("arrVersion");version=version?version:"1";var notificationPurchase=$("#addons-notification-1").is(":checked"),notificationArrivalPurchase=$("#notification-arrival").is(":checked");TP24.track("Flights / Payment","Notification Version",version),version=="1"?TP24.track("Flights / Payment","No arrival Notification sold",notificationPurchase):version=="2"?(TP24.track("Flights / Payment","Arrival free Notification sold",notificationPurchase),TP24.track("Flights / Payment","Arrival free Arrival Sold",notificationArrivalPurchase)):version=="3"&&(TP24.track("Flights / Payment","Arrival paid Notification sold",notificationPurchase),TP24.track("Flights / Payment","Arrival paid Arrival Sold",notificationArrivalPurchase))}});namespace.FlightSearchQuery=FlightSearchQuery,namespace.FlightPriceBar=FlightPriceBar,namespace.FlightFilter=FlightFilter,namespace.FlightFacebookTracking=FlightFacebookTracking,namespace.AirportLounges=AirportLounges,namespace.OfferCountdown=OfferCountdown,namespace.PolishOfferCountdown=PolishOfferCountdown,namespace.FlightResults=FlightResults,namespace.FlightCityLandingPage=FlightCityLandingPage,namespace.FlightsUnder100=FlightsUnder100,namespace.FlightCalendarOffer=FlightCalendarOffer,namespace.FlightCalendarOfferWidget=FlightCalendarOfferWidget,namespace.FlightAccessories=FlightAccessories,namespace.FlightInstallments=FlightInstallments,namespace.FlightAncillaryServices=FlightAncillaryServices,namespace.FlightBaggageAncillaryServices=FlightBaggageAncillaryServices,namespace.FlightIdentification=FlightIdentification,namespace.FlightNotificationTracking=FlightNotificationTracking,function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])}(),typeof define=="function"&&define.amd&&define("tp24-flight",[],function(){return namespace})})(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}());(function(global,undefined){var namespace={},FerrySearchQuery=Parent.extend({list:null,obInput:null,ibInput:null,obDate:null,ibDate:null,ibTime:null,roundTrip:null,toBeHiddenByRadio:null,moreOptions:null,airports:null,depList:null,arrList:null,defaultCountriesPerContinent:null,source:null,ports:null,selector:"_ferry-search",RUN:["initGlobals","initAutocomplete","initCalendar","initRoundTrip","passengersValidation","calendarErrorProof","sendTrackEvents"],initGlobals:function(){_this=this,this.obInput=this.get("#dep"),this.ibInput=this.get("#arr"),this.obDate=this.get("#ferry-obDate"),this.ibDate=this.get("#ferry-ibDate"),this.roundTrip=this.get("input[type=radio]"),this.toBeHiddenByRadio=this.get(".round-trip-hidden"),this.ibTime=this.get("#ibTime").parent(),this.moreOptions=this.get("#ferry-form-more-options"),this.depList=this.get("#dep-list"),this.arrList=this.get("#arr-list"),this.adults=this.get("#passengersAdult"),this.children=this.get("#passengersChild"),this.infants=this.get("#passengersInfant"),this.defaultCountriesPerContinent=TP24.CONFIG.LOCALE.DEFAULT_COUNTRIES_PER_CONTINENT},initAutocomplete:function(){this.list=TP24_Ferry_Ports_File,TP24.include(this.list,TP24.proxy(function(event){this.ports=TP24.SUPPORT.workers?event.data.TP24_Ferry_Ports:window.TP24_Ferry_Ports,$.each(TP24.CONFIG.LOCALE.AUTOCOMPLETION_LANGS,TP24.proxy(function(index,locale){locale in this.ports&&(TP24.autocompleter(this.obInput,this.ports[locale],{matchContains:!0,searchCodes:!1}),TP24.autocompleter(this.ibInput,this.ports[locale],{matchContains:!0,searchCodes:!1}))},this))},this))},getAirportTextByAirportCode:function(airportCode){},initCalendar:function(){var beforeShow=function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.FERRY,"openCalenderSearch")};TP24.maskCalendar(this.obDate,this.ibDate,{beforeShow:beforeShow})},initRoundTrip:function(){this.roundTrip.change(TP24.proxy(this.handleRoundTrip,this)),TP24.observe(TP24.CONFIG.HIDEABLE.EVENT+"ferry-form-more-options",this.handleIbTime,this),this.handleRoundTrip ()},handleRoundTrip:function(){this.roundTrip.eq(0).is(":checked")?this.toBeHiddenByRadio.show():this.toBeHiddenByRadio.hide(),this.handleIbTime(undefined,this.moreOptions.attr(TP24.CONFIG.HIDEABLE.STATE_ATTR))},handleIbTime:function(){this.roundTrip.eq(0).is(":checked")&&arguments[1]===TP24.CONFIG.HIDEABLE.ENABLED_STATE?this.ibTime.show():this.ibTime.hide()},addOptions:function(element,number,isAdult){var previous=element.val();element.empty();for(var i=isAdult||0;i<=number;i++){var option=$("").html(i).val(i);element.append(option)}element.children("option").size()>=previous-1&&element.val(previous)},passengersValidation:function(){this.adults.change(TP24.proxy(function(event){var select=$(event.target).closest("select");this.addOptions(this.infants,select.val()),this.addOptions(this.children,9-select.val())},this)),this.children.change(TP24.proxy(function(event){var select=$(event.target).closest("select"),option,i;this.addOptions(this.adults,9-select.val(),1),this.addOptions (this.infants,9-select.val())},this)),this.adults.add(this.children).change()},calendarErrorProof:function(){var _this=this,tripType=$("input[type='radio'][name='isRoundTrip']:checked").val();if(tripType==1){var selectedInboundDate=$("#ferry-ibDate").val(),inboundDate=_this.getDayMonthYear(selectedInboundDate);$("#outbound-days").children().each(function(){var dayMonth=$(this).find(".dayMonth").text(),year=$(this).find(".year").text(),outDate=dayMonth+"/"+year,outboundDate=_this.getDayMonthYear(outDate);if(outboundDate.year>inboundDate.year||outboundDate["year"]==inboundDate["year"]&&outboundDate.month>inboundDate.month||outboundDate["year"]==inboundDate["year"]&&outboundDate["month"]==inboundDate["month"]&&outboundDate.day>inboundDate.day)$(this).find("a").off("click"),$(this).find("a").removeAttr("href"),$(this).find("a").css("color","#b4b4b4")})}},getDayMonthYear:function(date){var date=$.trim(date),dayMonthYear=date.split("/"),year=parseInt(dayMonthYear.pop()),month=parseInt(dayMonthYear.pop()),day=parseInt(dayMonthYear.pop());return data={year:year,month:month,day:day},data},sendTrackEvents:function(){$(".btn-primary").click(TP24.proxy(this.trackEvents,this))},trackEvents:function(){var departure=$("#dep").val(),arrival=$("#arr").val(),obDate=$("#ferry-obDate").val(),ibDate=$("#ferry-ibDate").val(),passengersNumber=$("#passengersAdult").val(),vehiclesNumber=$("#vehicles").val();TP24.track("Ferries / Homepage","Select Ports",departure+"--"+arrival,TP24.time()),TP24.track("Ferries / Homepage","Type of trip",this.typeOfTrip(),TP24.time()),TP24.track("Ferries / Homepage","Days to trip",this.getDaysToTrip(obDate)),TP24.track("Ferries / Homepage","Trip duration",this.getTripDuration(ibDate,obDate)),TP24.track("Ferries / Homepage","Passenger number",passengersNumber),TP24.track("Ferries / Homepage","Vehicles number",vehiclesNumber)},typeOfTrip:function(){var isRoundTrip=$("#isRoundTrip-1").is(":checked");return isRoundTrip?"RoundTrip":"Oneway"},currentDate:function(){var now=new Date,month=now.getMonth()+1,day=now.getDate(),year=now.getFullYear();return day+"/"+month+"/"+year},getDay:function(date){var date=$.trim(date),day=date.split("/");return parseInt(day[0])},getMonth:function(date){var date=$.trim(date),month=date.split("/");return parseInt(month[1])},getYear:function(date){var date=$.trim(date),year=date.split("/");return parseInt(year[2])},getDaysToTrip:function(obDate){var obDateDay=this.getDay(obDate),obDateMonth=this.getMonth(obDate),obDateYear=this.getYear(obDate),currentDay=this.getDay(this.currentDate()),currentMonth=this.getMonth(this.currentDate()),currentYear=this.getYear(this.currentDate()),dayDifference=obDateDay-currentDay,monthDifference=(obDateMonth-currentMonth)*30,yearDifference=(obDateYear-currentYear)*360,daysToTrip;return yearDifference<=0&&monthDifference<=0?daysToTrip=dayDifference:yearDifference<=0?daysToTrip=monthDifference*dayDifference:daysToTrip=yearDifference*dayDifference,daysToTrip},getTripDuration:function(ibDate,obDate){var ibDateDay=this.getDay(ibDate),obDateDay=this.getDay(obDate),ibDateMonth=this.getMonth(ibDate),obDateMonth=this.getMonth(obDate),ibDateYear=this.getYear(ibDate),obDateYear=this.getYear(obDate),tripDuration,dayDifference=ibDateDay-obDateDay,monthDifference=(ibDateMonth-obDateMonth)*30,yearDifference=(ibDateYear-obDateYear)*360;return yearDifference<=0&&monthDifference<=0?tripDuration=dayDifference:yearDifference<=0?tripDuration=monthDifference*dayDifference:tripDuration=yearDifference*dayDifference,tripDuration}}),FerryResults=Parent.extend({RUN:["initFares"],selectedFareOb:null,selectedFareIb:null,initFares:function(){this.setupTripSelection(),this.updateInboundFares(),this.checkRadioButtons(),this.restoreSelectedFares("outbound"),this.restoreSelectedFares("inbound"),this.setupTripSelection(),$("#_send-email-for-FareAlert").length>0&&this.validateEmail()},validateEmail:function(){$("#submitButton").on("click",function(){var email=$.trim($("#userEmail-email").val()),regexp=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return regexp.test(email)?!0:($("#error-message-email").removeClass("hidden"),$("#error-message-email").fadeIn(100),setTimeout(TP24.proxy(function(){$("#error-message-email").fadeOut(300)},this),1500),email.focus,!1)})},setupTripSelection:function(){$(".-trips").each(function(){var radios=$(this).find(":radio");radios.change(function(){radios.parents(".tr-trip").removeClass("tr-trip-selected"),$(this).parents(".tr-trip").addClass("tr-trip-selected")})})},restoreSelectedFares:function(tripType){var selectedFare=$("."+tripType).data("fare-selected"),fares=$("."+tripType).find("[id^='ferry-']");selectedFare!=""&&$.each(fares,function(){var current=$(this).val();if(current==selectedFare)return $("."+tripType).find(".tr-trip").removeClass("tr-trip-selected"),$(this).attr("checked",!0),$(this).parents(".tr-trip").addClass("tr-trip-selected"),!1})},updateInboundFares:function(){var _this=this,obFares=$(".outbound").find("[id^='ferry-']");obFares.ready(function(){_this.checkInboundFares()}),obFares.on("change",function(){_this.checkInboundFares()})},checkInboundFares:function(){var ibFares=$(".inbound").find(".tr-trip"),outboundDate=$("#ferry-obDate").val(),inboundDate=$("#ferry-ibDate").val(),outBoundFareSelected=$(".outbound").find(".tr-trip-selected"),outBoundFareArrivalTime=outBoundFareSelected.find(".ferry-time:eq(1)").text().trim().substr(0,5),outboundFareArrTime=outBoundFareArrivalTime.split(":"),outboundFareArrHour=outboundFareArrTime[0],outboundFareArrMin=outboundFareArrTime[1],outBoundFareDepartureTime=outBoundFareSelected.find(".ferry-time:eq(0)").text().trim().substr(0,5),outboundFareDepTime=outBoundFareDepartureTime.split(":"),outboundFareDepHour=parseInt(outboundFareDepTime[0]),outboundFareDepMin=parseInt(outboundFareDepTime[1]),durationString=$(".outbound").find(".tr-trip-selected").find(".ferry-time:eq(2)").text().trim().substr(0,7).trim(),obYear=outboundDate.trim().substr(6,4),obMonth=outboundDate.trim().substr(3,2),obDay=outboundDate.trim().substr(0,2),ibYear=inboundDate.trim().substr(6,4),ibMonth=inboundDate.trim().substr(3,2),ibDay=inboundDate.trim().substr(0,2),ibDate=new Date(ibYear,ibMonth-1,ibDay),obFareDepDate=new Date(obYear,obMonth-1,obDay,outboundFareDepHour,outboundFareDepMin),obFareDepDateTemp=new Date(obYear,obMonth-1,obDay,outboundFareDepHour,outboundFareDepMin),durationHoursString,durationHours,durationMinutesString,durationMinutes,obFareArrivalDate;if(durationString.length>3)durationHoursString=durationString.substr(0,3).trim(),durationHours=parseInt(durationHoursString.match(/(\d+)/g)),durationMinutesString=durationString.substr(3,5).trim(),durationMinutes=parseInt(durationMinutesString.match(/(\d+)/g));else{var isHours=durationString.substr(durationString.length-1)=="h"?!0:!1;isHours?(durationHoursString=durationString.substr(0,3).trim(),durationHours=parseInt(durationHoursString.match(/(\d+)/g)),durationMinutes=0):(durationMinutesString=durationString.substr(0,3).trim(),durationMinutes=parseInt(durationMinutesString.match(/(\d+)/g)),durationHours=0)}obFareArrivalDate=obFareDepDateTemp.add(durationHours).hours(),obFareArrivalDate=obFareArrivalDate.add(durationMinutes).minutes(),outboundDate==inboundDate?obFareArrivalDate.toLocaleDateString()!=obFareDepDate.toLocaleDateString()?ibFares.each(function(){var fare=$(this).find(".ferry-radio");fare.find("input").removeAttr("checked"),fare.find("input").attr("disabled","disabled"),$(this).removeClass("tr-trip-selected")}):(this.setInboundFares(ibFares,outboundFareArrHour,outboundFareArrMin),this.setFirstAvailableInboundFare()):ibDate.getDate()==obFareArrivalDate.getDate()&&ibDate.getMonth()==obFareArrivalDate.getMonth()&&ibDate.getFullYear()==obFareArrivalDate.getFullYear()&&(this.setInboundFares(ibFares,outboundFareArrHour,outboundFareArrMin),this.setFirstAvailableInboundFare())},setFirstAvailableInboundFare:function(){$("input[class=inboundFare]:checked").size()==0?($("input[class=inboundFare]:radio:not(:disabled):first").prop("checked",!0),$("input[class=inboundFare]:radio:not(:disabled):first").parents(".tr-trip").addClass("tr-trip-selected")):$("input[class=inboundFare]:checked").parents(".tr-trip").addClass("tr-trip-selected")},setInboundFares:function(ibFares,outboundFareArrHour,outboundFareArrMin){ibFares.each(function(){var inBoundDepartureTime=$(this).find(".ferry-time:eq(0)").text().trim().substr(0,5),inBoundDepTime=inBoundDepartureTime.split(":"),inboundDepHour=inBoundDepTime[0],inboundDepMin=inBoundDepTime[1],fare=$(this).find(".ferry-radio");outboundFareArrHour>inboundDepHour?(fare.find("input").removeAttr("checked"),fare.find("input").attr("disabled","disabled"),$(this).removeClass("tr-trip-selected")):outboundFareArrHour==inboundDepHour?outboundFareArrMin>inboundDepMin?(fare.find("input").removeAttr("checked"),fare.find("input").attr("disabled","disabled"),$(this).removeClass("tr-trip-selected")):(fare.find("input[type=radio]:disabled").attr("disabled",!1),fare.find("input[type=radio]:enabled").parents(".tr-trip").removeClass("tr-trip-selected")):(fare.find("input[type=radio]:disabled").attr("disabled",!1),fare.find("input[type=radio]:enabled").parents(".tr-trip").removeClass("tr-trip-selected"))})},checkRadioButtons:function(){var enabledRadios=$("input[class=outboundFare]:radio"),disabledRadios=$("input[class=outboundFare]:radio:disabled");$("input[class=outboundFare]:radio:disabled").removeAttr("checked"),$("input[class=outboundFare]:radio:disabled").parents().removeClass("tr-trip-selected"),$("input[class=outboundFare]:radio:not(:disabled):first").prop("checked",!0),$("input[class=outboundFare]:radio:not(:disabled):first").parents(".tr-trip").addClass("tr-trip-selected"),enabledRadios.length===disabledRadios.length?$(".btn-large").hide():$(".btn-large").show()}}),FerryPayment=Parent.extend({RUN:["initGlobals","deliveryCourier","triggerDeliveryChargeUpdate","initBirthDate","initInsurance"],profileZip:$("#profile-zip"),profileCountry:$("#profile-countryCode"),profileCompanyZip:$(".companyZip"),profileCompanyCountry:$(".companyCountry"),zip:$("#addons-delivery-0-zip"),country:$("#addons-delivery-0-country"),differentAddress:$("#addons-delivery-0-useDifferentAddress"),addressDiv:$("#courier-address-div"),chargeLabel:$("#delivery-charge-display"),bookingID:$("#bookingID").data("booking-id"),obCompanyAbbr:$("#obCompanyAbbr").data("ob-company-abbr"),ibCompanyAbbr:$("#ibCompanyAbbr").data("ib-company-abbr"),isInternational:$("#isInternational").data("is-international"),insurance:$("[id^=addons-insurance-]"),tip:$("#delivery-tip"),initBirthDate:function(){this.obCompanyAbbr!="ANSF"&&this.ibCompanyAbbr!="ANSF"||!this.isInternational?($(".birthDate").hide(),$("[id^=addons-insurance-]:checked").length&&$(".birthDate").show()):$(".birthDate").show()},initGlobals:function(){$("#addons-delivery-office, #addons-delivery-port").change(function(){$(this).is(":checked")&&TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"delivery",price:0})}),$("#payment-creditCardVendor").change(function(){TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"paymentCharges",price:$("#payment-creditCardVendor :selected").data("card-price")})}),$("#addons-delivery-courier").change(function(){$(this).is(":checked")&&TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"delivery",price:$("#delivery-charge-display").data("amount")})}),$("#payment ul.tabs a").on("click",function(){var isCompanyActive=$(this).data("value");$('input[name="profile\\[isCompanyActive\\]"]').removeAttr("checked"),$('input[name="profile\\[isCompanyActive\\]"][value="'+isCompanyActive+'"]').attr("checked","checked")});var isCompany=$('#payment input[name="profile\\[isCompanyActive\\]"]:checked').val();$("#payment ul.tabs").data("tabs").click(parseInt(isCompany))},initInsurance:function(){$("a.insurance-link").on("click",function(e){e.preventDefault(),$(this).siblings("a").toggle(),$(this).closest("label").find(".insurance-description").toggle(),$(this).closest("label").find(".insurance-preview").toggle()}),this.insurance.change(function(){var insuranceChecked=$("[id^=addons-insurance-]:checked"),totalInsuranceAmount=0;insuranceChecked.each(function(){totalInsuranceAmount+=$(this).data("insurance-price")}),TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"insurance",price:totalInsuranceAmount})}),this.insurance.change(TP24.proxy(function(event){var insuranceChecked=$("[id^=addons-insurance-]:checked");insuranceChecked.length>0&&!$(".birthDate").is(":visible")&&$(".birthDate").show(),insuranceChecked.length===0&&$(".birthDate").is(":visible")&&(this.obCompanyAbbr!="ANSF"&&this.ibCompanyAbbr!="ANSF"||!this.isInternational?$(".birthDate").hide():$(".birthDate").show()),insuranceChecked.length>1&&(insuranceChecked.each(function(){$(this).prop("checked",!1)}),$(event.target).prop("checked",!0),insuranceChecked.trigger("change"))},this))},deliveryCourier:function(){this.differentAddress.click(TP24.proxy(this.showHideAddressDiv,this)),this.showHideAddressDiv()},showHideAddressDiv:function(){this.differentAddress.is(":checked")?this.addressDiv.show():this.addressDiv.hide()},triggerDeliveryChargeUpdate:function(){this.zip.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),this.country.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),this.profileZip.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),this.profileCountry.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),this.profileCompanyZip.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),this.profileCompanyCountry.change(TP24.proxy(function(){this.updateDeliveryCharges()},this)),$("#profile-isCompanyActive-0, #profile-isCompanyActive-1, #addons-delivery-0-useDifferentAddress").click(TP24.proxy(function(){this.updateDeliveryCharges()},this))},updateDeliveryCharges:function(){var geoData={};$("#addons-delivery-0-useDifferentAddress").is(":checked")?(geoData.zip=this.zip.val(),geoData.country=this.country.val()):($("#profile-isCompanyActive-0").is(":checked")&&(geoData.zip=this.profileZip.val(),geoData.country=this.profileCountry.val ()),$("#profile-isCompanyActive-1").is(":checked")&&(geoData.zip=$(".companyZip").val(),geoData.country=$(".companyCountry").val())),geoData.zip===""?this.tip.show():this.tip.hide();var _this=this;$.getJSON("/ferries/payment/calculate-cost?bookingID="+this.getUrlVars().bookingID,geoData,function(data){_this.chargeLabel.html(TP24.formatPrice(data)),_this.chargeLabel.data("amount",data),$("#addons-delivery-courier").is(":checked")&&TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"delivery",price:data})})},getUrlVars:function(){var vars=[],hash,hashes=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var i=0;i'+TP24.formatPrice(data.totalPrice)+""),$(".final-prices").each(function(index){$("#final-price-outbound-"+index).html(TP24.formatPrice(data.outbound[index])),$("#_final-discount-outbound-"+index).html(TP24.formatPrice(data.discounts.outbound[index])),typeof data.inbound!="undefined"&&($("#final-price-inbound-"+index).html(TP24.formatPrice(data.inbound[index])),$("#_final-discount-inbound-"+index).html(TP24.formatPrice(data.discounts.inbound[index])))}),_this.button.fadeOut("fast",function(){$(".btn-primary").fadeIn("fast")})),_this.showHideDiscount("outbound"),_this.showHideDiscount("inbound"),_this.root.removeClass("in-progress"),$("#waitScr").fadeOut("slow")},error:function(x,textStatus,m){textStatus==="timeout"?(_this.showTimeoutErrorMessage("There was no response from the server. Please try again"),_this.root.removeClass("in-progress"),$("#waitScr").fadeOut("slow")):textStatus==="parsererror"?(_this.showTimeoutErrorMessage("Session timeout. Please search again"),_this.root.removeClass("in-progress"),$("#waitScr").fadeOut("slow"),setTimeout(function(){window.location.href="/ferries"},2e3)):(_this.showTimeoutErrorMessage(textStatus),_this.root.removeClass("in-progress"),$("#waitScr").fadeOut("slow"))}})},this))},disableEnterKey:function(){$("._noEnterSubmit").keypress(function(e){if(e.which==13)return!1})},showTimeoutErrorMessage:function(txtmessage){$("html, body").animate({scrollTop:$("#main").offset().top},750),this.seatingPriceErrorLabel.html(''+txtmessage+""),this.seatingPriceErrorLabel.fadeIn("slow"),this.seatingPriceLabel.fadeOut("slow")},showErrorMessage:function(data){$("html, body").animate({scrollTop:$("#main").offset().top},750),this.seatingPriceErrorLabel.html(''+data.error+""),this.seatingPriceErrorLabel.fadeIn("slow"),this.seatingPriceLabel.fadeOut("slow"),this.seatingUlErrors.fadeOut(),this.seatingInputErrors.removeClass("error"),this.addErrorField(data.errorCode)},markUnavailableClasses:function(data){for(var i in data.errorClasses){var legType=i==0?"outbound":"inbound";for(var seatingClass in data.errorClasses[i])$("."+legType).find('select[id$="classAbbr"]').find('option[value="'+seatingClass+'"]:selected').parents("select").addClass("error")}},passengerNumberChange:function(){$("._passengers-num-class, ._vehicles-num-class").change(TP24.proxy(function(){$("#waitPassengerNumberScr").fadeIn("fast")},this))},haveAllPassengersSeatClass:function(leg){var adultPassengers=$('select[name="passengersAdult"]').val(),passengers=$("[class='_passenger-row'][id^='"+leg+"']"),haveClass=[];for(var i=0;i0?$.inArray(!1,childrenOutbound)!==-1&&$.inArray(!1,childrenInbound)!==-1?_this.atLeastOneAdult=!0:_this.atLeastOneAdult=!1:$.inArray(!1,childrenOutbound)!==-1?_this.atLeastOneAdult=!0:_this.atLeastOneAdult=!1,_this.atLeastOneAdult}function scrollToError(){pos=$("#seating-price-display-error-noAdults").offset().top,$("html,body").animate({scrollTop:pos},1e3)}var _this=this;$("select[name^='Passenger-outbound'][name$='[passengerDiscountType]'], select[name^='Passenger-inbound'][name$='[passengerDiscountType]']").on("change",function(){$("#seating-price-display-error").hide(),atLeastOneAdultExists()?($("#seating-price-display-error").hide(),$("#seating-price-display-error-noAdults").hide()):($("#seating-price-display-error-noAdults").removeClass ("hide").addClass("show"),$("#seating-price-display-error-noAdults").show(),scrollToError())}),$("#seating-ajaxButton").on("click",function(){$("#seating-price-display-error").hide(),$("#seating-price-display-error-noAdults").hide()})},showHideErrorMessages:function(legType){var _this=this;$("._passenger-row, ._vehicle-row").each(function(index){var gender=$("#Passenger-"+legType+"-"+index+"-gender"),ticketType=$("#Passenger-"+legType+"-"+index+"-passengerDiscountType"),passengerClassAbbr=$("#Passenger-"+legType+"-"+index+"-classAbbr"),vehicleClassAbbr=$("#Vehicle-"+legType+"-"+index+"-classAbbr"),vehiclePlateNumber=$("#Vehicle-"+legType+"-"+index+"-plateNumber");_this.validateField(gender),_this.validateField(ticketType),_this.validateField(passengerClassAbbr),_this.validateField(vehicleClassAbbr),_this.validateField(vehiclePlateNumber)})},showHideDiscount:function(legType){$("._passenger-row").each(function(index){$("#_final-discount-"+legType+"-"+index).html()=="0,00 \u20ac"||parseInt ($("#_final-discount-"+legType+"-"+index).html())<0?($("#_final-discount-"+legType+"-"+index).hide(),$("#_discount-"+legType+"-"+index).hide()):($("#_final-discount-"+legType+"-"+index).show(),$("#_discount-"+legType+"-"+index).show(),$("#Passenger-"+legType+"-"+index+"-passengerDiscountType option:selected").val()=="1"&&$("#_discount-"+legType+"-"+index).hide())})},validateField:function(field){field.removeClass("error"),field.val()==""&&field.addClass("error")},selectOutbound:function(){var _this=this,adultPassengers=$('select[name="passengersAdult"]').val(),outboundPassengers=$("[class='_passenger-row'][id^='outbound']"),inboundPassengers=$("[class='_passenger-row'][id^='inbound']");$("select.outbound, input.outbound").change(function(){var id=$(this).attr("id"),array=id.split("-"),indexAndName="inbound-"+array[2]+"-"+array[3],indexAndGender="inbound-"+array[2]+"-gender",gender=$("#Passenger-outbound-"+array[2]+"-gender").val();$("#Passenger-"+indexAndName).find("option[value="+$(this).val()+"]").length>0?$("#Passenger-"+indexAndName).val($(this).val()):$("#Passenger-"+indexAndName).val(0),$("#hidden-passenger-"+indexAndName).val($(this).val()),$("#Passenger-"+indexAndGender).val(gender),$("#Vehicle-"+indexAndName).val($(this).val()),$("#Vehicle-"+indexAndName).attr("disabled","disabled"),$("#hidden-vehicle-"+indexAndName).val($(this).val()),_this.validateField($(this))}),$.each([1,2,3,4,5,6,7,8,9],function(index,value){var passType=$("#Passenger-outbound-"+index+"-passengerDiscountType").val();passType=="1"&&($("#Passenger-outbound-"+index+"-classAbbr").hide(),$("#Passenger-inbound-"+index+"-classAbbr").hide(),$("._wholecabin-td-"+index+" label").hide(),$("#infant-outbound-"+index).removeClass("hide"),$("#infant-inbound-"+index).removeClass("hide"));var outboundClassIsCabin=$("#Passenger-outbound-"+index+"-classAbbr").find("option:selected").data("is-cabin"),outboundClassCheckbox=$("#Passenger-outbound-"+index+"-wholeCabin"),inboundClassCheckbox=$("#Passenger-inbound-"+ index+"-wholeCabin"),inboundClassIsCabin=$("#Passenger-inbound-"+index+"-classAbbr").find("option:selected").data("is-cabin");outboundClassIsCabin==1&&outboundClassCheckbox.is(":checked")&&$("#Passenger-outbound-"+index+"-wholeCabin-label").show(),inboundClassIsCabin==1&&inboundClassCheckbox.is(":checked")&&$("#Passenger-inbound-"+index+"-wholeCabin-label").show()}),outboundPassengers.each(function(){var index=$(this).data("id");$("select[name^='Passenger-outbound'][name$='[classAbbr]']").change(function(){var classCapacity=$("option:selected",this).attr("data-capacity"),isCabin=$("option:selected",this).attr("data-is-cabin"),discountType=$("#Passenger-outbound-"+index+"-passengerDiscountType").val();classCapacity>=adultPassengers&&isCabin==1&&discountType==1&&($("#infant-outbound-"+index).addClass("hide"),$("#Passenger-outbound-"+index+"-passengerDiscountType").val(0),$("#Passenger-outbound-"+index+"-classAbbr").show())})}),inboundPassengers.each(function(){var index=$(this).data("id");$("select[name^='Passenger-inbound'][name$='[classAbbr]']").change(function(){var classCapacity=$("option:selected",this).attr("data-capacity"),isCabin=$("option:selected",this).attr("data-is-cabin"),discountType=$("#Passenger-inbound-"+index+"-passengerDiscountType").val();classCapacity>=adultPassengers&&isCabin==1&&discountType==1&&($("#infant-inbound-"+index).addClass("hide"),$("#Passenger-inbound-"+index+"-passengerDiscountType").val(0),$("#Passenger-inbound-"+index+"-classAbbr").show())})}),$("select._seating-passenger-discount-type.outbound").change(function(){var id=$(this).attr("id"),array=id.split("-"),tripType=array[1],index=array[2],value=$(this).val(),checkBox=$("#Passenger-"+tripType+"-"+index+"-wholeCabin"),label=$("._wholecabin-td-"+index+" label"),outboundValue=$("#Passenger-outbound-"+index+"-passengerDiscountType").val(),inboundValue=$("#Passenger-inbound-"+index+"-passengerDiscountType").val();value=="1"?(outboundValue==inboundValue&&($("#infant-inbound-"+index).removeClass ("hide"),$("#Passenger-inbound-"+index+"-classAbbr").hide()),$("#Passenger-outbound-"+index+"-classAbbr").hide(),label.hide(),$("#infant-outbound-"+index).removeClass("hide")):($("#Passenger-"+tripType+"-"+index+"-classAbbr").show(),checkBox.is(":visible")&&label.show(),$("#infant-outbound-"+index).addClass("hide"),$("#infant-inbound-"+index).addClass("hide"),$("#Passenger-inbound-"+index+"-classAbbr").show())}),$("select._seating-passenger-discount-type.inbound").change(function(){var id=$(this).attr("id"),array=id.split("-"),tripType=array[1],index=array[2],value=$(this).val(),checkBox=$("#Passenger-"+tripType+"-"+index+"-wholeCabin"),label=$("._wholecabin-td-"+index+" label");value=="1"?($("#Passenger-inbound-"+index+"-classAbbr").hide(),label.hide(),$("#infant-inbound-"+index).removeClass("hide")):($("#Passenger-"+tripType+"-"+index+"-classAbbr").show(),$("#Passenger-inbound-"+index+"-classAbbr").show(),checkBox.is(":visible")&&label.show(),$("#infant-inbound-"+index).addClass("hide"))})},formChange:function(){var _this=this;$("#seating-pricing").change(TP24.proxy(function(){_this.button.is(":hidden")&&(_this.seatingPriceLabel.fadeOut("fast"),$(".btn-primary").fadeOut("fast",function(){_this.button.fadeIn("fast")})),_this.atLeastOneAdult!=null&&!_this.atLeastOneAdult?$("#seating-ajaxButton").prop("disabled",!0):$("#seating-ajaxButton").prop("disabled",!1)},this))},seatingChange:function(){var _this=this;$("._seating-class").change(TP24.proxy(function(event){var element=$(event.target),classCapacity=element.find("option:selected").data("capacity"),companyAbbr=element.parents().closest("[id$='-companyAbbr']").data("companyabbr");_this.validateField(element),_this.resetPassengerFinalPrice(element),_this.resetPassengerFinalDiscountPrice(element);if(!this.isClassCabin(element)){this.getCheckbox(element).removeAttr("checked"),this.getCheckbox(element).attr("disabled","disabled"),this.getCheckboxLabel(element).hide(),this.updateNextSiblings(element,!1),this.companyDoesSupportInfantDiscount (companyAbbr)&&(this.addInfantOption(element,this.getTotalNumberOfPassengers()),this.addIfantOptionToTheCurrentRow(element));return}if(this.canSelectWholeCabin(element,classCapacity)){this.getCheckbox(element).attr("checked","checked"),this.getCheckbox(element).removeAttr("disabled"),classCapacity>1?this.getCheckboxLabel(element).show():this.getCheckboxLabel(element).hide(),this.updateNextSiblings(element,!0,classCapacity-1);var lastAffectedPaxElement=this.getNextNthClassSibling(element,classCapacity-1),normalizeNumber=parseInt(this.passengerIndex(lastAffectedPaxElement))+1;classCapacity>1&&normalizeNumber0;if(!infantOptionFound){var infantTranslation=$("#infantTranslation").data("infant-translation");row.find("._seating-passenger-discount-type").append('")}},addIfantOptionToTheCurrentRow:function(element){var infantTranslation=$("#infantTranslation").data("infant-translation"),hasInfantOption=this.getCurrentRow(element).find('._seating-passenger-discount-type option[value="1"]').length>0,selectType=$("#Passenger-"+this.legType(element)+"-"+this.passengerIndex(element)+"-passengerDiscountType");hasInfantOption||selectType.append('")},removeInfantOption:function(element,numberOfRows){numberOfRows>0&&this.getNextSiblingRows(element,numberOfRows).find('._seating-passenger-discount-type option[value="1"]').remove(),this.isClassCabin(element)&&$("#Passenger-"+this.legType(element)+"-"+this.passengerIndex(element)+'-passengerDiscountType option[value="1"]').remove()},isClassCabin:function(element){var isCabin=element.find("option:selected").data("is-cabin");return isCabin=="1"?!0:!1}}),FerryPriceBar=Parent.extend({RUN:["initGlobals"],selector:"_pricebar",elements:{},amounts:{},totalWithoutExtraCharges:null,event:"PAYMENT:addon-update-price",initGlobals:function(){this.elements.voucher=$("#product-subtotal-voucher"),this.elements.delivery=$("#product-subtotal-delivery"),this.elements.insurance=$("#product-subtotal-insurance"),this.elements.installment=$("#product-subtotal-installmentCharges"),this.elements.paymentCharges=$("#product-subtotal-paymentCharges"),this.elements.total=$("#total-price"),this.elements.totalExtraCharges=$("#total-extra-charges"),this.amounts.voucher=this.elements.voucher.data("amount"),this.amounts.delivery=this.elements.delivery.data("amount"),this.amounts.paymentCharges=$("#payment-creditCardVendor :selected").data("card-price"),this.amounts.insurance=this.elements.insurance.data("amount"),this.amounts.installment=this.elements.installment.data("amount"),this.amounts.total=this.elements.total.data("amount"),this.totalWithoutExtraCharges=this.elements.total.data("total-without-extra-charges"),TP24.observe(this.event,this.catcher,this)},catcher:function(){var data=arguments[1];if(data.name in this.amounts){this.amounts[data.name]=data.price,this.elements[data.name].html(TP24.formatPrice(this.amounts[data.name]));var price=0,extra_charges=0;$("#birthDate").hasClass("birthDate")?(extra_charges=this.amounts.delivery+this.amounts.voucher+this.amounts.insurance+this.amounts.installment+this.amounts.paymentCharges,price=this.totalWithoutExtraCharges+extra_charges):(extra_charges=this.amounts.delivery+this.amounts.voucher+this.amounts.installment+this.amounts.paymentCharges,price=this.totalWithoutExtraCharges+extra_charges),price<0&&(price=0),this.elements.total.html(TP24.formatPrice(price)),this.elements.totalExtraCharges.html(TP24.formatPrice(extra_charges))}}}),FerryInstallments=Parent.extend({installmentLastSelected:0,installmentCharge:0,totalPriceWithoutInstallmentCharge:0,otherChargesWithoutInstallmentCharges:0,shouldSubstractInstallmentCharges:!1,RUN:["initGlobals","initInstallmentsSurcharge"],initGlobals:function(){this.installmentsValidationMessage=$("#installments-validation-message"),this.installmentsErrorMessage=$("#installments-booking-expiry-error-message"),this.installmentCheck=$("#installments-checkbox"),this.installmentSelect=$("#installment-select"),this.installmentDetails=$("#installment-details"),this.creditCardNumber=$("#payment-creditCardNumber"),this.numberOfInstallments=$("#payment-numberOfInstallments"),this.totalElement=$("#total-price"),this.onChange(),this.onSelect()},initInstallmentsSurcharge:function(){this.installmentCharge=0,this.totalPriceWithoutInstallmentCharge=this.totalElement.data("amount"),this.numberOfInstallments.change(TP24.proxy(this.installmentOptionSelected,this))},hideInstallments:function(){this.installmentSelect.hide(),this.installmentDetails.hide(),this.numberOfInstallments.val(0).change()},onChange:function(){this.installmentCheck.is(":checked")&&this.installmentSelect.show(),this.creditCardNumber.on("keydown",TP24.proxy(function(event){this.hideInstallments(),this.installmentCheck.attr("checked",!1),this.installmentsValidationMessage.hide()},this)),this.installmentCheck.change(TP24.proxy(function(event){var availableProviders=[];for(var provider in TP24App.Config.availableProviders)availableProviders.push(TP24App.Config.availableProviders[provider].toLowerCase());var isNumericCreditCard=$.isNumeric(this.creditCardNumber.val());this.installmentCheck.is(":checked")&&!isNumericCreditCard?(this.hideInstallments(),this._installmentsNotAvailable("Your credit card number is not valid")):this.installmentCheck.is(":checked")&&this.creditCardNumber.val().length>=8&&isNumericCreditCard?$.ajax({method:"POST",data:JSON.stringify({method:"credit_card_info",parameters:{credit_card_super_bin:this.creditCardNumber.val().substr(0,8),amount:this.totalElement.data("amount"),get_installments_info:"Y"}}),url:TP24App.Config.creditCardInfoUrl,dataType:"json",beforeSend:TP24.proxy(function(){this.creditCardNumber.removeClass("error")},this),success:TP24.proxy(function(json){var installmentsSupported=!1;if(typeof json.result.installment_supported_providers!="undefined"&&json.result.installment_supported_providers.length>0)for(i=0;i=0){installmentsSupported=!0;break}}installmentsSupported?(this.installmentsValidationMessage.hide(),this.installmentSelect.fadeIn(200),this.installmentDetails.fadeIn(200)):this._installmentsNotAvailable("Your credit card does not support installments"),this.numberOfInstallments.val(0).change()},this),error:TP24.proxy(function(response){typeof response.responseJSON!="undefined"&&response.responseJSON.errors.length>0?this._installmentsNotAvailable("Your credit card does not support installments"):(this.installmentsErrorMessage.show(),this.installmentsValidationMessage.hide())},this)}):this.installmentCheck.is(":checked")&&this.creditCardNumber.val().length<8?(this.hideInstallments(),this._installmentsNotAvailable("Your credit card number is not valid")):this.hideInstallments()},this))},_installmentsNotAvailable:function(message){var translated_message=Globalize.cultures[GLOBALIZE_LOCALE].messages.paymentErrorMessages[message];this.installmentsValidationMessage.html(''+translated_message+""),this.installmentCheck.attr("checked",!1),this.installmentSelect.hide(),this.installmentDetails.hide(),this.installmentsValidationMessage.show()},onSelect:function(){this.installmentSelect.change(TP24.proxy(function(event){var installmentQuantityElement=$("#installments-quantity"),installmentPriceElement=$("#installments-price"),installment=this.getInstallmentPrice();installmentQuantityElement.html(this.numberOfInstallments.val()+" x "),installmentPriceElement.html(TP24.formatPrice(installment)+" = "+$("#total-price").html()),this.numberOfInstallments.val()?this.installmentDetails.fadeIn(200):(this.numberOfInstallments.find("option").first().attr("selected","selected"),this.installmentDetails.hide())},this))},getInstallmentPrice:function(){return Math.round(100*this.totalElement.data("amount")/this.numberOfInstallments.val())/100},installmentOptionSelected:function(){this.installmentLastSelected=parseInt(this.numberOfInstallments.val());var subtotal=this.installmentLastSelected>1?this.installmentChargesFromTotalPriceWithoutInstallmentCharge():0;this.updateSidebarCharges(subtotal)},installmentChargesFromTotalPriceWithoutInstallmentCharge:function(){return+(this.totalPriceWithoutInstallmentCharge*(this.installmentLastSelected+1)*TP24App.Config.installmentsInterest).toFixed(2)},updateSidebarCharges:function(charge){var productSubtotalElementToUpdate="";productSubtotalElementToUpdate=$("#product-subtotal-installmentCharges"),productSubtotalElementToUpdate.data("amount",charge),productSubtotalElementToUpdate.html(TP24.formatPrice(charge)),$("#payment-numberOfInstallments").change(function(){TP24.fire("PAYMENT:addon-update-price",{group:"other",name:"installment",price:$("#product-subtotal-installmentCharges").data("amount")})})}}),FerryFlightOfferTracking=Parent.extend({RUN:["sendTrackEvents"],sendTrackEvents:function(){$("#flightOffer").on("flightOffer.impression",TP24.proxy(this.trackImpressionEvent,this)),$("#flightOffer").click(TP24.proxy(this.trackClickEvent,this))},trackImpressionEvent:function(){TP24.track("Ferries / Results","Flight Offers Impressions")},trackClickEvent:function(){TP24.track("Ferries / Results","Flight Offers Clicks")}});namespace.FerrySearchQuery=FerrySearchQuery,namespace.FerryResults=FerryResults,namespace.FerryPayment=FerryPayment,namespace.FerrySeating=FerrySeating,namespace.FerryPriceBar=FerryPriceBar,namespace.FerryInstallments=FerryInstallments,namespace.FerryFlightOfferTracking=FerryFlightOfferTracking,function(){var hasProp={}.hasOwnProperty,key;for(key in namespace)hasProp.call(namespace,key)&&(global[key]=namespace[key])}(),typeof define=="function"&&define.amd&&define("tp24-ferry-amd",[],function(){return namespace})})(function(){if(typeof exports=="object")return module.exports;if(typeof window!="undefined")return window}());var CarSearchQuery=Parent.extend({list:null,from:null,pickup:null,dropoff:null,selector:'_car-search',RUN:['initAutocompletion','initGlobals','initCalendar'],initGlobals:function() {this.from=this.get('#cars-destinationInput');this.pickup=this.get('#pickup');this.dropoff=this.get('#dropoff');},initAutocompletion:function() {this.list='/js/tp24-car-autocompletion-legacy.js';TP24.include(this.list,TP24.proxy(function(event){var carCollection=(TP24.SUPPORT.workers)?event.data.carCollection:window.carCollection;TP24.autocompleter(this.from,carCollection,{matchContains:false,searchCodes:false});},this));},initCalendar:function() {var beforeShow=function(){TP24.track(TP24.CONFIG.TRACKER.CATEGORIES.CAR,'openCalenderSearch');};TP24.maskCalendar(this.pickup,this.dropoff,{beforeShow:beforeShow});}});;$(document).ready(function(){var applyForJob=$(".apply-for-job");if(applyForJob.length>0){applyForJob.fancybox({fitToView:false,width:1000});}});;(function($){var TP24_DocumentReady=function(){this.actions=[];};TP24_DocumentReady.prototype={addAction:function(callback){this.actions.push(callback);},execute:function($){var that=this;$(document).ready(function(){$.each(that.actions,function(i,action){action($);});$('.plusone-btn').one('mouseover',function(){head.js('//apis.google.com/js/plusone.js');});$('.fb-like-btn').one('mouseover',function(){_this=$(this) head.js('//connect.facebook.net/en_US/all.js#xfbml=1',function(){_this.addClass('loaded');});});})}};var ready=new TP24_DocumentReady;ready.addAction(function($){var divs=$('div').find('[data-url]');$.each(divs,function(i,target){var targetData=$(target).data();$.ajax({url:targetData.url,dataType:'html',success:function(data){$(target).html(data);}});});});ready.execute($);})(jQuery);