function renderStars(category){var stars=' ';for(var i=0,count=(category-(category%10))/10;i';} if(category%10==5) stars+='';return stars;} function renderOfferLocation(item){var locationPath=''+item.obj_country+' / '+ item.obj_region+' / '+item.obj_city+'';if(item.obj_distBeach){locationPath+='';locationPath+='';locationPath+=''+item.obj_distBeach+' m';locationPath+='';$(function(){$('[data-toggle="tooltip"]').tooltip();})} if(item.obj_xLat<200){return''+'

'+locationPath+'

';} return'

'+locationPath+'

';} function renderOfferDate(item,isInfoBox){var days,daysText,spanNowrap='',spanNowrapClose='',returnDate=item.trp_rDepDateFullWithDOW,duration='';if(typeof item.trp_stay==typeof undefined||item.trp_stay==0){days=item.trp_durationM;daysText=((days*1>1)?offerTexts.days:offerTexts.day);} else {days=item.trp_stay;daysText=((days*1>1)?offerTexts.nights:offerTexts.night);} if(days) {if(item.hotelExtra&&!isInfoBox) days-=item.hotelExtra.trp_stay;duration=' '+spanNowrap+'('+days+' '+daysText+')'+spanNowrapClose;} if(item.hotelExtra){if(isInfoBox) duration='';else returnDate=item.hotelExtra.trp_depDateFullWithDOW;} return spanNowrap+item.trp_depDateFullWithDOW+spanNowrapClose+' - '+spanNowrap+returnDate+spanNowrapClose+duration;} function renderOfferZoover(ratings){var rating=0,zoover='',quantity='';try{rating=ratings.a.val;}catch(e){return zoover;} zoover+='
'+''+offerTexts.rating+' Zoover logo'+'
'+'
'+'
'+'
'+'
'+rating+'
'+'
';zoover+='
    ';for(var ratekey in ratings){if(ratings.hasOwnProperty(ratekey)){var rate=ratings[ratekey],val=rate.val;if(ratekey!='oc'&&val.length<2){val+='.0';}else if(ratekey=='oc'){quantity='

    '+''+rate.desc+' '+''+val+'

    ';continue;} zoover+='
  • '+''+rate.desc+''+''+val+''+'
  • ';}} return zoover+='
'+quantity+'
';} function renderAttributes(attributes,withoutDescriptions){if(withoutDescriptions){var attrs='
';attrs+=''+''+'
';var containerForMap='';var listContainer='

'+settings.mainCart.yourCart+' ('+contents.length+')

'+translations.close+' 
    '+list+'
'+containerForMap+'
'+btnsBottom+'
';$('body').append(listContainer.replace(/alternatives/g,''));$('#'+settings.mainCart.cartContainer+' .object-listing-elem').each(function(index){var $this=$(this);var data_ofr_id=$this.attr('data_ofr_id');var hrefLink=(gateApi?location.pathname.split(gatePrefix).shift()+gatePrefix+'/':'/')+(data_ofr_id.length>255?'l/':'')+data_ofr_id+'/';$this.find('.next-page').attr('href',hrefLink);$this.find('.image').find('a').attr('href',hrefLink);$this.find('.header-link').attr('href',hrefLink);});$('#'+settings.mainCart.cartContainer).addClass('cart');overlay();initOmnibus($('#'+settings.mainCart.cartContainer));}};function loadCart(){$(document).ready(function(){countCart();$('.object-listing-elem').each(function(index){that=$(this);dataofrid=that.attr('data_ofr_id');for(var i=0,len=contents.length;i0){$('#'+settings.compare.compareContainer).remove();$('.'+settings.mainCart.cartContainer).show();} else{$('.'+settings.mainCart.cartContainer).remove();cart.yourCart.removeClass('text-color-18');$('.container-fluid').removeClass('cart');}}}} else{localStorage.setItem(settings.name,JSON.stringify(contents));}});$('body').on('click','.btn-compare',function(event){event.preventDefault();renderCompare();cart.pointCompareInMap();$('html,body').animate({scrollTop:$('.'+settings.compare.typeCompare+':first').offset().top},1000);});$('body').on('click','.container-fluid .close',function(event){if($('.'+settings.compare.compareContainer).length>0){$('.'+settings.compare.typeCompare).remove();$('.'+settings.mainCart.cartContainer).show();overlay();cart.offersCompareInMap=[];} else{$('.'+settings.mainCart.cartContainer).remove();cart.yourCart.removeClass('text-color-18');$('.container-fluid').removeClass('cart');$('body').removeClass('cartActive').find('.bgCart').remove();}});$('body').on('click','.cart-delete',function(event){localStorage.removeItem(settings.name);$('#'+settings.mainCart.cartContainer+', .bgCart').remove();countCart();$('#'+settings.mainCart.idActiveElement+' .object-listing-elem .add-to-cart').addClass('adds0').removeClass('adds1').attr('data-cart','0');$('#'+settings.mainCart.idActiveElement+' .object-listing-elem .remove-from-cart').addClass('removes0').removeClass('removes1');$('#'+settings.mainCart.cartContainer+' .cart').removeClass('cart');contents=[];});$('body').on('click','#'+settings.mainCart.cartContainer+' .'+btnListingView,function(event){event.preventDefault();if($(this).index()==0){$('#'+settings.mainCart.cartOffersListing).show();$('#'+settings.map.cartLocationMapContainer).hide();$('#'+settings.mainCart.cartContainer+' .section-footer').show();$(this).siblings('a').removeClass('background-color-12 text-color-1').addClass('text-color-12');$(this).removeClass('text-color-12').addClass('background-color-12 text-color-1');} if($(this).index()==1){$('#'+settings.mainCart.cartContainer+' .section-footer').hide();$('#'+settings.mainCart.cartOffersListing).hide();$('#'+settings.map.cartLocationMapContainer).show();map=new LocationMap({contentManager:cart,mc:'#'+settings.map.cartLocationMapContainer});map.showMarkers(cart.offersCartInMap,false);$(this).siblings('a').removeClass('background-color-12 text-color-1').addClass('text-color-12');$(this).removeClass('text-color-12').addClass('background-color-12 text-color-1');}});$('body').on('click','#'+settings.mainCart.cartContainer+' .listing-showOnMap',function(event){event.preventDefault();$('#'+settings.mainCart.cartOffersListing).hide();$('#'+settings.map.cartLocationMapContainer).show();$('#'+settings.mainCart.cartContainer+' .section-footer').hide();$('#'+settings.mainCart.cartContainer+' a:eq(0)').removeClass('background-color-12 text-color-1').addClass('text-color-12');$('#'+settings.mainCart.cartContainer+' a:eq(1)').addClass('background-color-12 text-color-1').removeClass('text-color-12');map=new LocationMap({contentManager:cart,mc:'#'+settings.map.cartLocationMapContainer});map.showMarkers(cart.offersCartInMap,false);map.showSpecific($(this).attr('data-xcode'));});$('body').on('click','#'+settings.compare.compareContainer+' .listing-showOnMap',function(event){event.preventDefault();$('#'+settings.compare.compareList+' ol').hide();$('#'+settings.map.compareLocationMapContainer).show();$('#'+settings.compare.compareContainer+' a:eq(0)').removeClass('background-color-12 text-color-1').addClass('text-color-12');$('#'+settings.compare.compareContainer+' a:eq(1)').addClass('background-color-12 text-color-1').removeClass('text-color-12');map=new LocationMap({contentManager:cart,mc:'#'+settings.map.compareLocationMapContainer});map.showMarkers(cart.offersCompareInMap,false);map.showSpecific($(this).attr('data-xcode'));});$('body').on('click','#'+settings.compare.compareContainer+' .'+btnListingView,function(event){event.preventDefault();if($(this).index()==0){$('#'+settings.compare.compareList+' ol').show();$('#'+settings.map.compareLocationMapContainer).hide();$(this).siblings('a').removeClass('background-color-12 text-color-1').addClass('text-color-12');$(this).removeClass('text-color-12').addClass('background-color-12 text-color-1');} if($(this).index()==1){$('#'+settings.compare.compareList+' ol').hide();$('#'+settings.map.compareLocationMapContainer).show();map=new LocationMap({contentManager:cart,mc:'#'+settings.map.compareLocationMapContainer});map.showMarkers(cart.offersCompareInMap,false);map.showSpecific($(this).attr('data-xcode'));$(this).siblings('a').removeClass('background-color-12 text-color-1').addClass('text-color-12');$(this).removeClass('text-color-12').addClass('background-color-12 text-color-1');}});$('body').on('click','.cart-send',function(event){event.preventDefault();emailfield='
';topicfield='
';var captchafield='';if(captchaAvailable==1){captchafield='
';} $(this).qtip({content:{title:settings.form.sendOfferTitle,text:'
'+emailfield+topicfield+captchafield+'
',button:true},show:{ready:true,event:'click',effect:false,delay:0,modal:{on:true}},hide:{event:'click',effect:false,delay:0},style:{classes:'qtip-classic-window qtip-shadow qtip-fullscreen qtip-form background-color-3 text-color-9 send-offer-email ',tip:false},position:{my:'left',at:'left',viewport:$('#containerFluidCart'),adjust:{y:350,x:0}}});formValidation();});function formValidation(){$('form input[type="text"],form textarea').one('focusin',function(event){if(captchaAvailable==1){$('form input[type="text"],form textarea').keyup(function(){setCaptcha($(this).closest('form'));});}});$('.send-offer-email form').validate({errorElement:'span',errorClass:'invalid text-color-21',rules:{sub:{required:true,minlength:3},email:{}},highlight:function(element,errorClass){$(element).addClass(errorClass);$(element.form).find('label[for='+element.id+']').addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);$(element.form).find('label[for='+element.id+']').removeClass(errorClass);},errorPlacement:function(error,element){error.remove();},submitHandler:function(form){var $form=$(form),$sendBtn=$form.find('button[type="submit"]');for(var i=0,len=contents.length;i');$sendBtn.button('stringvalue');},success:function(msg){if(msg.status!=='OK'){Infomessage({title:translations.info,mainText:msg.info},true);} else{Infomessage({title:translations.info,mainText:settings.form.infoSend+' '+ $(form).find('input[name="email"]').val()});idChecked=[];$('.send-offer-email').remove();} if(captchaAvailable==1){resetCaptcha();setCaptcha();} $sendBtn.button('reset');},complete:function(){idChecked=[];},error:function(error){Infomessage({title:translations.info,mainText:translations.messageFailure},true);idChecked=[];$sendBtn.button('reset');}});}});}});} if(document.getElementsByClassName('btn-cart').length>0){var cart=new Cart();} function CartCarousel(section,duration){var $section=$('#'+section),jcarousel=$section.find('.compare-list'),visible=$section.find('.cartVisible'),quantity=$section.find('.cartQuantity'),items=jcarousel.find('ol li.compare-item').length,btnCompare=$section.find('.btn-compare-nav'),options={transitions:true,animation:500,wrap:'circular'},page=1;quantity.html(items);jcarousel.on('jcarousel:reload jcarousel:create',function(){var width=jcarousel.width();if(jcarousel.find('ol li').width()*items>width){btnCompare.show();} else{btnCompare.hide();} if(width>=1069){if(items==1){page=1;width=width/1;} if(items==2){page=2;width=width/2;} if(items>2){page=3;width=width/3;}} else if(width>=690){page=2;width=width/2;} else if(width>=427){width=width/1;page=1;} jcarousel.jcarousel('items').css('width',width+'px');pageChange(0);}).jcarousel(options);if(duration>0&&$(window).width()>991){jcarousel.jcarouselAutoscroll({interval:duration*1000,target:'+=1',autostart:true});} $section.find('.with-accordion, .with-accordion-for-phone').on('click',function(){setTimeout(function(){jcarousel.jcarousel('reload',options);},100);});$section.find('.right.carousel-control, .fa-chevron-circle-right').jcarouselControl({target:'+=1'}).on('click',function(){pageChange(1);});$section.find('.left.carousel-control, .fa-chevron-circle-left').jcarouselControl({target:'-=1'}).on('click',function(){pageChange(-1);});$section.find('.carousel-indicators').on('jcarouselpagination:active','li',function(){var elem=$(this).addClass('background-color-7');for(var i=1;i';}});function pageChange(action){var q=quantity.html()*1;if(page==q){return visible.html(page);} var val=Math.abs(parseInt(visible.html())+action)%q;val=(val!=0)?val:quantity.html();visible.html(val);maxClick=items-page;nextStep=page+Number(visible.text());if(Number(val)==1){$('.left.carousel-control').addClass('hide');$('.right.carousel-control').removeClass('hide');} if(Number(visible.text())>1){$('.left.carousel-control').removeClass('hide');$('.right.carousel-control').removeClass('hide');} if(nextStep>Number(quantity.text())){$('.right.carousel-control').addClass('hide');$('.left.carousel-control').removeClass('hide');}} $section.on('swipe',function(event){if(!event.direction){return;} if(event.direction==='left'){pageChange(1);jcarousel.jcarousel('scroll','+=1');} else if(event.direction==='right'){pageChange(-1);jcarousel.jcarousel('scroll','-=1');}});pageChange(0);} (function(t){"use strict";var i=t.jCarousel={};i.version="0.3.1";var s=/^([+\-]=)?(.+)$/;i.parseTarget=function(t){var i=!1,e="object"!=typeof t?s.exec(t):null;return e?(t=parseInt(e[2],10)||0,e[1]&&(i=!0,"-="===e[1]&&(t*=-1))):"object"!=typeof t&&(t=parseInt(t,10)||0),{target:t,relative:i}},i.detectCarousel=function(t){for(var i;t.length>0;){if(i=t.filter("[data-jcarousel]"),i.length>0)return i;if(i=t.find("[data-jcarousel]"),i.length>0)return i;t=t.parent()}return null},i.base=function(s){return{version:i.version,_options:{},_element:null,_carousel:null,_init:t.noop,_create:t.noop,_destroy:t.noop,_reload:t.noop,create:function(){return this._element.attr("data-"+s.toLowerCase(),!0).data(s,this),!1===this._trigger("create")?this:(this._create(),this._trigger("createend"),this)},destroy:function(){return!1===this._trigger("destroy")?this:(this._destroy(),this._trigger("destroyend"),this._element.removeData(s).removeAttr("data-"+s.toLowerCase()),this)},reload:function(t){return!1===this._trigger("reload")?this:(t&&this.options(t),this._reload(),this._trigger("reloadend"),this)},element:function(){return this._element},options:function(i,s){if(0===arguments.length)return t.extend({},this._options);if("string"==typeof i){if(s===void 0)return this._options[i]===void 0?null:this._options[i];this._options[i]=s}else this._options=t.extend({},this._options,i);return this},carousel:function(){return this._carousel||(this._carousel=i.detectCarousel(this.options("carousel")||this._element),this._carousel||t.error('Could not detect carousel for plugin "'+s+'"')),this._carousel},_trigger:function(i,e,r){var n,o=!1;return r=[this].concat(r||[]),(e||this._element).each(function(){n=t.Event((s+":"+i).toLowerCase()),t(this).trigger(n,r),n.isDefaultPrevented()&&(o=!0)}),!o}}},i.plugin=function(s,e){var r=t[s]=function(i,s){this._element=t(i),this.options(s),this._init(),this.create()};return r.fn=r.prototype=t.extend({},i.base(s),e),t.fn[s]=function(i){var e=Array.prototype.slice.call(arguments,1),n=this;return"string"==typeof i?this.each(function(){var r=t(this).data(s);if(!r)return t.error("Cannot call methods on "+s+" prior to initialization; "+'attempted to call method "'+i+'"');if(!t.isFunction(r[i])||"_"===i.charAt(0))return t.error('No such method "'+i+'" for '+s+" instance");var o=r[i].apply(r,e);return o!==r&&o!==void 0?(n=o,!1):void 0}):this.each(function(){var e=t(this).data(s);e instanceof r?e.reload(i):new r(this,i)}),n},r}})(jQuery),function(t,i){"use strict";var s=function(t){return parseFloat(t)||0};t.jCarousel.plugin("jcarousel",{animating:!1,tail:0,inTail:!1,resizeTimer:null,lt:null,vertical:!1,rtl:!1,circular:!1,underflow:!1,relative:!1,_options:{list:function(){return this.element().children().eq(0)},items:function(){return this.list().children()},animation:400,transitions:!1,wrap:null,vertical:null,rtl:null,center:!1},_list:null,_items:null,_target:null,_first:null,_last:null,_visible:null,_fullyvisible:null,_init:function(){var t=this;return this.onWindowResize=function(){t.resizeTimer&&clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){t.reload()},100)},this},_create:function(){this._reload(),t(i).on("resize.jcarousel",this.onWindowResize)},_destroy:function(){t(i).off("resize.jcarousel",this.onWindowResize)},_reload:function(){this.vertical=this.options("vertical"),null==this.vertical&&(this.vertical=this.list().height()>this.list().width()),this.rtl=this.options("rtl"),null==this.rtl&&(this.rtl=function(i){if("rtl"===(""+i.attr("dir")).toLowerCase())return!0;var s=!1;return i.parents("[dir]").each(function(){return/rtl/i.test(t(this).attr("dir"))?(s=!0,!1):void 0}),s}(this._element)),this.lt=this.vertical?"top":"left",this.relative="relative"===this.list().css("position"),this._list=null,this._items=null;var i=this._target&&this.index(this._target)>=0?this._target:this.closest();this.circular="circular"===this.options("wrap"),this.underflow=!1;var s={left:0,top:0};return i.length>0&&(this._prepare(i),this.list().find("[data-jcarousel-clone]").remove(),this._items=null,this.underflow=this._fullyvisible.length>=this.items().length,this.circular=this.circular&&!this.underflow,s[this.lt]=this._position(i)+"px"),this.move(s),this},list:function(){if(null===this._list){var i=this.options("list");this._list=t.isFunction(i)?i.call(this):this._element.find(i)}return this._list},items:function(){if(null===this._items){var i=this.options("items");this._items=(t.isFunction(i)?i.call(this):this.list().find(i)).not("[data-jcarousel-clone]")}return this._items},index:function(t){return this.items().index(t)},closest:function(){var i,e=this,r=this.list().position()[this.lt],n=t(),o=!1,l=this.vertical?"bottom":this.rtl&&!this.relative?"left":"right";return this.rtl&&this.relative&&!this.vertical&&(r+=this.list().width()-this.clipping()),this.items().each(function(){if(n=t(this),o)return!1;var a=e.dimension(n);if(r+=a,r>=0){if(i=a-s(n.css("margin-"+l)),!(0>=Math.abs(r)-a+i/2))return!1;o=!0}}),n},target:function(){return this._target},first:function(){return this._first},last:function(){return this._last},visible:function(){return this._visible},fullyvisible:function(){return this._fullyvisible},hasNext:function(){if(!1===this._trigger("hasnext"))return!0;var t=this.options("wrap"),i=this.items().length-1;return i>=0&&!this.underflow&&(t&&"first"!==t||i>this.index(this._last)||this.tail&&!this.inTail)?!0:!1},hasPrev:function(){if(!1===this._trigger("hasprev"))return!0;var t=this.options("wrap");return this.items().length>0&&!this.underflow&&(t&&"last"!==t||this.index(this._first)>0||this.tail&&this.inTail)?!0:!1},clipping:function(){return this._element["inner"+(this.vertical?"Height":"Width")]()},dimension:function(t){return t["outer"+(this.vertical?"Height":"Width")](!0)},scroll:function(i,s,e){if(this.animating)return this;if(!1===this._trigger("scroll",null,[i,s]))return this;t.isFunction(s)&&(e=s,s=!0);var r=t.jCarousel.parseTarget(i);if(r.relative){var n,o,l,a,h,u,c,f,d=this.items().length-1,_=Math.abs(r.target),p=this.options("wrap");if(r.target>0){var g=this.index(this._last);if(g>=d&&this.tail)this.inTail?"both"===p||"last"===p?this._scroll(0,s,e):t.isFunction(e)&&e.call(this,!1):this._scrollTail(s,e);else if(n=this.index(this._target),this.underflow&&n===d&&("circular"===p||"both"===p||"last"===p)||!this.underflow&&g===d&&("both"===p||"last"===p))this._scroll(0,s,e);else if(l=n+_,this.circular&&l>d){for(f=d,h=this.items().get(-1);l>f++;)h=this.items().eq(0),u=this._visible.index(h)>=0,u&&h.after(h.clone(!0).attr("data-jcarousel-clone",!0)),this.list().append(h),u||(c={},c[this.lt]=this.dimension(h),this.moveBy(c)),this._items=null;this._scroll(h,s,e)}else this._scroll(Math.min(l,d),s,e)}else if(this.inTail)this._scroll(Math.max(this.index(this._first)-_+1,0),s,e);else if(o=this.index(this._first),n=this.index(this._target),a=this.underflow?n:o,l=a-_,0>=a&&(this.underflow&&"circular"===p||"both"===p||"first"===p))this._scroll(d,s,e);else if(this.circular&&0>l){for(f=l,h=this.items().get(0);0>f++;){h=this.items().eq(-1),u=this._visible.index(h)>=0,u&&h.after(h.clone(!0).attr("data-jcarousel-clone",!0)),this.list().prepend(h),this._items=null;var v=this.dimension(h);c={},c[this.lt]=-v,this.moveBy(c)}this._scroll(h,s,e)}else this._scroll(Math.max(l,0),s,e)}else this._scroll(r.target,s,e);return this._trigger("scrollend"),this},moveBy:function(t,i){var e=this.list().position(),r=1,n=0;return this.rtl&&!this.vertical&&(r=-1,this.relative&&(n=this.list().width()-this.clipping())),t.left&&(t.left=e.left+n+s(t.left)*r+"px"),t.top&&(t.top=e.top+n+s(t.top)*r+"px"),this.move(t,i)},move:function(i,s){s=s||{};var e=this.options("transitions"),r=!!e,n=!!e.transforms,o=!!e.transforms3d,l=s.duration||0,a=this.list();if(!r&&l>0)return a.animate(i,s),void 0;var h=s.complete||t.noop,u={};if(r){var c=a.css(["transitionDuration","transitionTimingFunction","transitionProperty"]),f=h;h=function(){t(this).css(c),f.call(this)},u={transitionDuration:(l>0?l/1e3:0)+"s",transitionTimingFunction:e.easing||s.easing,transitionProperty:l>0?function(){return n||o?"all":i.left?"left":"top"}():"none",transform:"none"}}o?u.transform="translate3d("+(i.left||0)+","+(i.top||0)+",0)":n?u.transform="translate("+(i.left||0)+","+(i.top||0)+")":t.extend(u,i),r&&l>0&&a.one("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",h),a.css(u),0>=l&&a.each(function(){h.call(this)})},_scroll:function(i,s,e){if(this.animating)return t.isFunction(e)&&e.call(this,!1),this;if("object"!=typeof i?i=this.items().eq(i):i.jquery===void 0&&(i=t(i)),0===i.length)return t.isFunction(e)&&e.call(this,!1),this;this.inTail=!1,this._prepare(i);var r=this._position(i),n=this.list().position()[this.lt];if(r===n)return t.isFunction(e)&&e.call(this,!1),this;var o={};return o[this.lt]=r+"px",this._animate(o,s,e),this},_scrollTail:function(i,s){if(this.animating||!this.tail)return t.isFunction(s)&&s.call(this,!1),this;var e=this.list().position()[this.lt];this.rtl&&this.relative&&!this.vertical&&(e+=this.list().width()-this.clipping()),this.rtl&&!this.vertical?e+=this.tail:e-=this.tail,this.inTail=!0;var r={};return r[this.lt]=e+"px",this._update({target:this._target.next(),fullyvisible:this._fullyvisible.slice(1).add(this._visible.last())}),this._animate(r,i,s),this},_animate:function(i,s,e){if(e=e||t.noop,!1===this._trigger("animate"))return e.call(this,!1),this;this.animating=!0;var r=this.options("animation"),n=t.proxy(function(){this.animating=!1;var t=this.list().find("[data-jcarousel-clone]");t.length>0&&(t.remove(),this._reload()),this._trigger("animateend"),e.call(this,!0)},this),o="object"==typeof r?t.extend({},r):{duration:r},l=o.complete||t.noop;return s===!1?o.duration=0:t.fx.speeds[o.duration]!==void 0&&(o.duration=t.fx.speeds[o.duration]),o.complete=function(){n(),l.call(this)},this.move(i,o),this},_prepare:function(i){var e,r,n,o,l=this.index(i),a=l,h=this.dimension(i),u=this.clipping(),c=this.vertical?"bottom":this.rtl?"left":"right",f=this.options("center"),d={target:i,first:i,last:i,visible:i,fullyvisible:u>=h?i:t()};if(f&&(h/=2,u/=2),u>h)for(;;){if(e=this.items().eq(++a),0===e.length){if(!this.circular)break;if(e=this.items().eq(0),i.get(0)===e.get(0))break;if(r=this._visible.index(e)>=0,r&&e.after(e.clone(!0).attr("data-jcarousel-clone",!0)),this.list().append(e),!r){var _={};_[this.lt]=this.dimension(e),this.moveBy(_)}this._items=null}if(o=this.dimension(e),0===o)break;if(h+=o,d.last=e,d.visible=d.visible.add(e),n=s(e.css("margin-"+c)),u>=h-n&&(d.fullyvisible=d.fullyvisible.add(e)),h>=u)break}if(!this.circular&&!f&&u>h)for(a=l;;){if(0>--a)break;if(e=this.items().eq(a),0===e.length)break;if(o=this.dimension(e),0===o)break;if(h+=o,d.first=e,d.visible=d.visible.add(e),n=s(e.css("margin-"+c)),u>=h-n&&(d.fullyvisible=d.fullyvisible.add(e)),h>=u)break}return this._update(d),this.tail=0,f||"circular"===this.options("wrap")||"custom"===this.options("wrap")||this.index(d.last)!==this.items().length-1||(h-=s(d.last.css("margin-"+c)),h>u&&(this.tail=h-u)),this},_position:function(t){var i=this._first,s=i.position()[this.lt],e=this.options("center"),r=e?this.clipping()/2-this.dimension(i)/2:0;return this.rtl&&!this.vertical?(s-=this.relative?this.list().width()-this.dimension(i):this.clipping()-this.dimension(i),s+=r):s-=r,!e&&(this.index(t)>this.index(i)||this.inTail)&&this.tail?(s=this.rtl&&!this.vertical?s-this.tail:s+this.tail,this.inTail=!0):this.inTail=!1,-s},_update:function(i){var s,e=this,r={target:this._target||t(),first:this._first||t(),last:this._last||t(),visible:this._visible||t(),fullyvisible:this._fullyvisible||t()},n=this.index(i.first||r.first)r[s].index(this)&&o.push(this)}),r[s].each(function(){0>i[s].index(this)&&l.push(this)}),n?o=o.reverse():l=l.reverse(),e._trigger(s+"in",t(o)),e._trigger(s+"out",t(l)),e["_"+s]=i[s]};for(s in i)o(s);return this}})}(jQuery,window),function(t){"use strict";t.jcarousel.fn.scrollIntoView=function(i,s,e){var r,n=t.jCarousel.parseTarget(i),o=this.index(this._fullyvisible.first()),l=this.index(this._fullyvisible.last());if(r=n.relative?0>n.target?Math.max(0,o+n.target):l+n.target:"object"!=typeof n.target?n.target:this.index(n.target),o>r)return this.scroll(r,s,e);if(r>=o&&l>=r)return t.isFunction(e)&&e.call(this,!1),this;for(var a,h=this.items(),u=this.clipping(),c=this.vertical?"bottom":this.rtl?"left":"right",f=0;;){if(a=h.eq(r),0===a.length)break;if(f+=this.dimension(a),f>=u){var d=parseFloat(a.css("margin-"+c))||0;f-d!==u&&r++;break}if(0>=r)break;r--}return this.scroll(r,s,e)}}(jQuery),function(t){"use strict";t.jCarousel.plugin("jcarouselControl",{_options:{target:"+=1",event:"click",method:"scroll"},_active:null,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onReload=t.proxy(this._reload,this),this.onEvent=t.proxy(function(i){i.preventDefault();var s=this.options("method");t.isFunction(s)?s.call(this):this.carousel().jcarousel(this.options("method"),this.options("target"))},this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy).on("jcarousel:reloadend jcarousel:scrollend",this.onReload),this._element.on(this.options("event")+".jcarouselcontrol",this.onEvent),this._reload()},_destroy:function(){this._element.off(".jcarouselcontrol",this.onEvent),this.carousel().off("jcarousel:destroy",this.onDestroy).off("jcarousel:reloadend jcarousel:scrollend",this.onReload)},_reload:function(){var i,s=t.jCarousel.parseTarget(this.options("target")),e=this.carousel();if(s.relative)i=e.jcarousel(s.target>0?"hasNext":"hasPrev");else{var r="object"!=typeof s.target?e.jcarousel("items").eq(s.target):s.target;i=e.jcarousel("target").index(r)>=0}return this._active!==i&&(this._trigger(i?"active":"inactive"),this._active=i),this}})}(jQuery),function(t){"use strict";t.jCarousel.plugin("jcarouselPagination",{_options:{perPage:null,item:function(t){return''+t+""},event:"click",method:"scroll"},_carouselItems:null,_pages:{},_items:{},_currentPage:null,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onReload=t.proxy(this._reload,this),this.onScroll=t.proxy(this._update,this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy).on("jcarousel:reloadend",this.onReload).on("jcarousel:scrollend",this.onScroll),this._reload()},_destroy:function(){this._clear(),this.carousel().off("jcarousel:destroy",this.onDestroy).off("jcarousel:reloadend",this.onReload).off("jcarousel:scrollend",this.onScroll),this._carouselItems=null},_reload:function(){var i=this.options("perPage");if(this._pages={},this._items={},t.isFunction(i)&&(i=i.call(this)),null==i)this._pages=this._calculatePages();else for(var s,e=parseInt(i,10)||0,r=this._getCarouselItems(),n=1,o=0;;){if(s=r.eq(o++),0===s.length)break;this._pages[n]=this._pages[n]?this._pages[n].add(s):s,0===o%e&&n++}this._clear();var l=this,a=this.carousel().data("jcarousel"),h=this._element,u=this.options("item"),c=this._getCarouselItems().length;t.each(this._pages,function(i,s){var e=l._items[i]=t(u.call(l,i,s));e.on(l.options("event")+".jcarouselpagination",t.proxy(function(){var t=s.eq(0);if(a.circular){var e=a.index(a.target()),r=a.index(t);parseFloat(i)>parseFloat(l._currentPage)?e>r&&(t="+="+(c-e+r)):r>e&&(t="-="+(e+(c-r)))}a[this.options("method")](t)},l)),h.append(e)}),this._update()},_update:function(){var i,s=this.carousel().jcarousel("target");t.each(this._pages,function(t,e){return e.each(function(){return s.is(this)?(i=t,!1):void 0}),i?!1:void 0}),this._currentPage!==i&&(this._trigger("inactive",this._items[this._currentPage]),this._trigger("active",this._items[i])),this._currentPage=i},items:function(){return this._items},reloadCarouselItems:function(){return this._carouselItems=null,this},_clear:function(){this._element.empty(),this._currentPage=null},_calculatePages:function(){for(var t,i=this.carousel().data("jcarousel"),s=this._getCarouselItems(),e=i.clipping(),r=0,n=0,o=1,l={};;){if(t=s.eq(n++),0===t.length)break;l[o]=l[o]?l[o].add(t):t,r+=i.dimension(t),r>=e&&(o++,r=0)}return l},_getCarouselItems:function(){return this._carouselItems||(this._carouselItems=this.carousel().jcarousel("items")),this._carouselItems}})}(jQuery),function(t){"use strict";t.jCarousel.plugin("jcarouselAutoscroll",{_options:{target:"+=1",interval:3e3,autostart:!0},_timer:null,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onAnimateEnd=t.proxy(this.start,this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy),this.options("autostart")&&this.start()},_destroy:function(){this.stop(),this.carousel().off("jcarousel:destroy",this.onDestroy)},start:function(){return this.stop(),this.carousel().one("jcarousel:animateend",this.onAnimateEnd),this._timer=setTimeout(t.proxy(function(){this.carousel().jcarousel("scroll",this.options("target"))},this),this.options("interval")),this},stop:function(){return this._timer&&(this._timer=clearTimeout(this._timer)),this.carousel().off("jcarousel:animateend",this.onAnimateEnd),this}})}(jQuery);(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel'in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;}} var special=$.event.special.mousewheel={version:'3.1.9',setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,false);}}else{this.onmousewheel=null;}},getLineHeight:function(elem){return parseInt($(elem)['offsetParent'in $.fn?'offsetParent':'parent']().css('fontSize'),10);},getPageHeight:function(elem){return $(elem).height();},settings:{adjustOldDeltas:true}};$.fn.extend({mousewheel:function(fn){return fn?this.bind('mousewheel',fn):this.trigger('mousewheel');},unmousewheel:function(fn){return this.unbind('mousewheel',fn);}});function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0;event=$.event.fix(orgEvent);event.type='mousewheel';if('detail'in orgEvent){deltaY=orgEvent.detail* -1;} if('wheelDelta'in orgEvent){deltaY=orgEvent.wheelDelta;} if('wheelDeltaY'in orgEvent){deltaY=orgEvent.wheelDeltaY;} if('wheelDeltaX'in orgEvent){deltaX=orgEvent.wheelDeltaX* -1;} if('axis'in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY* -1;deltaY=0;} delta=deltaY===0?deltaX:deltaY;if('deltaY'in orgEvent){deltaY=orgEvent.deltaY* -1;delta=deltaY;} if('deltaX'in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX* -1;}} if(deltaY===0&&deltaX===0){return;} if(orgEvent.deltaMode===1){var lineHeight=$.data(this,'mousewheel-line-height');if(lineHeight===void 0){$.data(this,'mousewheel-line-height',special.getLineHeight(this));} delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight;}else if(orgEvent.deltaMode===2){var pageHeight=$.data(this,'mousewheel-page-height');if(pageHeight===void 0){$.data(this,'mousewheel-page-height',special.getPageHeight(this));} delta*=pageHeight;deltaY*=pageHeight;deltaX*=pageHeight;} absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDelta||absDelta=1?'floor':'ceil'](delta/lowestDelta);deltaX=Math[deltaX>=1?'floor':'ceil'](deltaX/lowestDelta);deltaY=Math[deltaY>=1?'floor':'ceil'](deltaY/lowestDelta);event.deltaX=deltaX;event.deltaY=deltaY;event.deltaFactor=lowestDelta;event.deltaMode=0;args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(nullLowestDeltaTimeout);} nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return($.event.dispatch||$.event.handle).apply(this,args);} function nullLowestDelta(){lowestDelta=null;} function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta%120===0;}})(jQuery);(function($){$.fn.jScrollPane=function(settings){function JScrollPane(elem,s){var settings,jsp=this,pane,paneWidth,paneHeight,container,contentWidth,contentHeight,percentInViewH,percentInViewV,isScrollableV,isScrollableH,verticalDrag,dragMaxY,verticalDragPosition,horizontalDrag,dragMaxX,horizontalDragPosition,verticalBar,verticalTrack,scrollbarWidth,verticalTrackHeight,verticalDragHeight,arrowUp,arrowDown,horizontalBar,horizontalTrack,horizontalTrackWidth,horizontalDragWidth,arrowLeft,arrowRight,reinitialiseInterval,originalPadding,originalPaddingTotalWidth,previousContentWidth,wasAtTop=true,wasAtLeft=true,wasAtBottom=false,wasAtRight=false,originalElement=elem.clone(false,false).empty(),mwEvent=$.fn.mwheelIntent?'mwheelIntent.jsp':'mousewheel.jsp';if(elem.css('box-sizing')==='border-box'){originalPadding=0;originalPaddingTotalWidth=0;}else{originalPadding=elem.css('paddingTop')+' '+ elem.css('paddingRight')+' '+ elem.css('paddingBottom')+' '+ elem.css('paddingLeft');originalPaddingTotalWidth=(parseInt(elem.css('paddingLeft'),10)||0)+ (parseInt(elem.css('paddingRight'),10)||0);} function initialise(s){var isMaintainingPositon,lastContentX,lastContentY,hasContainingSpaceChanged,originalScrollTop,originalScrollLeft,maintainAtBottom=false,maintainAtRight=false;settings=s;if(pane===undefined){originalScrollTop=elem.scrollTop();originalScrollLeft=elem.scrollLeft();elem.css({overflow:'hidden',padding:0});paneWidth=elem.innerWidth()+originalPaddingTotalWidth;paneHeight=elem.innerHeight();elem.width(paneWidth);pane=$('
').css('padding',originalPadding).append(elem.children());container=$('
').css({'width':paneWidth+'px','height':paneHeight+'px'}).append(pane).appendTo(elem);}else{elem.css('width','');maintainAtBottom=settings.stickToBottom&&isCloseToBottom();maintainAtRight=settings.stickToRight&&isCloseToRight();hasContainingSpaceChanged=elem.innerWidth()+originalPaddingTotalWidth!=paneWidth||elem.outerHeight()!=paneHeight;if(hasContainingSpaceChanged){paneWidth=elem.innerWidth()+originalPaddingTotalWidth;paneHeight=elem.innerHeight();container.css({width:paneWidth+'px',height:paneHeight+'px'});} if(!hasContainingSpaceChanged&&previousContentWidth==contentWidth&&pane.outerHeight()==contentHeight){elem.width(paneWidth);return;} previousContentWidth=contentWidth;pane.css('width','');elem.width(paneWidth);container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end();} pane.css('overflow','auto');if(s.contentWidth){contentWidth=s.contentWidth;}else{contentWidth=pane[0].scrollWidth;} contentHeight=pane[0].scrollHeight;pane.css('overflow','');percentInViewH=contentWidth/paneWidth;percentInViewV=contentHeight/paneHeight;isScrollableV=percentInViewV>1;isScrollableH=percentInViewH>1;if(!(isScrollableH||isScrollableV)){elem.removeClass('jspScrollable');pane.css({top:0,left:0,width:container.width()-originalPaddingTotalWidth});removeMousewheel();removeFocusHandler();removeKeyboardNav();removeClickOnTrack();}else{elem.addClass('jspScrollable');isMaintainingPositon=settings.maintainPosition&&(verticalDragPosition||horizontalDragPosition);if(isMaintainingPositon){lastContentX=contentPositionX();lastContentY=contentPositionY();} initialiseVerticalScroll();initialiseHorizontalScroll();resizeScrollbars();if(isMaintainingPositon){scrollToX(maintainAtRight?(contentWidth-paneWidth):lastContentX,false);scrollToY(maintainAtBottom?(contentHeight-paneHeight):lastContentY,false);} initFocusHandler();initMousewheel();initTouch();if(settings.enableKeyboardNavigation){initKeyboardNav();} if(settings.clickOnTrack){initClickOnTrack();} observeHash();if(settings.hijackInternalLinks){hijackInternalLinks();}} if(settings.autoReinitialise&&!reinitialiseInterval){reinitialiseInterval=setInterval(function(){initialise(settings);},settings.autoReinitialiseDelay);}else if(!settings.autoReinitialise&&reinitialiseInterval){clearInterval(reinitialiseInterval);} originalScrollTop&&elem.scrollTop(0)&&scrollToY(originalScrollTop,false);originalScrollLeft&&elem.scrollLeft(0)&&scrollToX(originalScrollLeft,false);elem.trigger('jsp-initialised',[isScrollableH||isScrollableV]);} function initialiseVerticalScroll(){if(isScrollableV){container.append($('
').append($('
'),$('
').append($('
').append($('
'),$('
'))),$('
')));verticalBar=container.find('>.jspVerticalBar');verticalTrack=verticalBar.find('>.jspTrack');verticalDrag=verticalTrack.find('>.jspDrag');if(settings.showArrows){arrowUp=$('').bind('mousedown.jsp',getArrowScroll(0,-1)).bind('click.jsp',nil);arrowDown=$('').bind('mousedown.jsp',getArrowScroll(0,1)).bind('click.jsp',nil);if(settings.arrowScrollOnHover){arrowUp.bind('mouseover.jsp',getArrowScroll(0,-1,arrowUp));arrowDown.bind('mouseover.jsp',getArrowScroll(0,1,arrowDown));} appendArrows(verticalTrack,settings.verticalArrowPositions,arrowUp,arrowDown);} verticalTrackHeight=paneHeight;container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each(function(){verticalTrackHeight-=$(this).outerHeight();});verticalDrag.hover(function(){verticalDrag.addClass('jspHover');},function(){verticalDrag.removeClass('jspHover');}).bind('mousedown.jsp',function(e){$('html').bind('dragstart.jsp selectstart.jsp',nil);verticalDrag.addClass('jspActive');var startY=e.pageY-verticalDrag.position().top;$('html').bind('mousemove.jsp',function(e){positionDragY(e.pageY-startY,false);}).bind('mouseup.jsp mouseleave.jsp',cancelDrag);return false;});sizeVerticalScrollbar();}} function sizeVerticalScrollbar(){verticalTrack.height(verticalTrackHeight+'px');verticalDragPosition=0;scrollbarWidth=settings.verticalGutter+verticalTrack.outerWidth();pane.width(paneWidth-scrollbarWidth-originalPaddingTotalWidth);try{if(verticalBar.position().left===0){pane.css('margin-left',scrollbarWidth+'px');}}catch(err){}} function initialiseHorizontalScroll(){if(isScrollableH){container.append($('
').append($('
'),$('
').append($('
').append($('
'),$('
'))),$('
')));horizontalBar=container.find('>.jspHorizontalBar');horizontalTrack=horizontalBar.find('>.jspTrack');horizontalDrag=horizontalTrack.find('>.jspDrag');if(settings.showArrows){arrowLeft=$('').bind('mousedown.jsp',getArrowScroll(-1,0)).bind('click.jsp',nil);arrowRight=$('').bind('mousedown.jsp',getArrowScroll(1,0)).bind('click.jsp',nil);if(settings.arrowScrollOnHover){arrowLeft.bind('mouseover.jsp',getArrowScroll(-1,0,arrowLeft));arrowRight.bind('mouseover.jsp',getArrowScroll(1,0,arrowRight));} appendArrows(horizontalTrack,settings.horizontalArrowPositions,arrowLeft,arrowRight);} horizontalDrag.hover(function(){horizontalDrag.addClass('jspHover');},function(){horizontalDrag.removeClass('jspHover');}).bind('mousedown.jsp',function(e){$('html').bind('dragstart.jsp selectstart.jsp',nil);horizontalDrag.addClass('jspActive');var startX=e.pageX-horizontalDrag.position().left;$('html').bind('mousemove.jsp',function(e){positionDragX(e.pageX-startX,false);}).bind('mouseup.jsp mouseleave.jsp',cancelDrag);return false;});horizontalTrackWidth=container.innerWidth();sizeHorizontalScrollbar();}} function sizeHorizontalScrollbar(){container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each(function(){horizontalTrackWidth-=$(this).outerWidth();});horizontalTrack.width(horizontalTrackWidth+'px');horizontalDragPosition=0;} function resizeScrollbars(){if(isScrollableH&&isScrollableV){var horizontalTrackHeight=horizontalTrack.outerHeight(),verticalTrackWidth=verticalTrack.outerWidth();verticalTrackHeight-=horizontalTrackHeight;$(horizontalBar).find('>.jspCap:visible,>.jspArrow').each(function(){horizontalTrackWidth+=$(this).outerWidth();});horizontalTrackWidth-=verticalTrackWidth;paneHeight-=verticalTrackWidth;paneWidth-=horizontalTrackHeight;horizontalTrack.parent().append($('
').css('width',horizontalTrackHeight+'px'));sizeVerticalScrollbar();sizeHorizontalScrollbar();} if(isScrollableH){pane.width((container.outerWidth()-originalPaddingTotalWidth)+'px');} contentHeight=pane.outerHeight();percentInViewV=contentHeight/paneHeight;if(isScrollableH){horizontalDragWidth=Math.ceil(1/percentInViewH*horizontalTrackWidth);if(horizontalDragWidth>settings.horizontalDragMaxWidth){horizontalDragWidth=settings.horizontalDragMaxWidth;}else if(horizontalDragWidthsettings.verticalDragMaxHeight){verticalDragHeight=settings.verticalDragMaxHeight;}else if(verticalDragHeightpos){jsp.scrollByY(-contentDragY);}else{positionDragY(pos);}}else if(direction>0){if(verticalDragPosition+dragYpos){jsp.scrollByX(-contentDragX);}else{positionDragX(pos);}}else if(direction>0){if(horizontalDragPosition+dragXdragMaxY){destY=dragMaxY;} if(animate===undefined){animate=settings.animateScroll;} if(animate){jsp.animate(verticalDrag,'top',destY,_positionDragY);}else{verticalDrag.css('top',destY);_positionDragY(destY);}} function _positionDragY(destY){if(destY===undefined){destY=verticalDrag.position().top;} container.scrollTop(0);verticalDragPosition=destY||0;var isAtTop=verticalDragPosition===0,isAtBottom=verticalDragPosition==dragMaxY,percentScrolled=destY/dragMaxY,destTop=-percentScrolled*(contentHeight-paneHeight);if(wasAtTop!=isAtTop||wasAtBottom!=isAtBottom){wasAtTop=isAtTop;wasAtBottom=isAtBottom;elem.trigger('jsp-arrow-change',[wasAtTop,wasAtBottom,wasAtLeft,wasAtRight]);} updateVerticalArrows(isAtTop,isAtBottom);pane.css('top',destTop);elem.trigger('jsp-scroll-y',[-destTop,isAtTop,isAtBottom]).trigger('scroll');} function positionDragX(destX,animate){if(!isScrollableH){return;} if(destX<0){destX=0;}else if(destX>dragMaxX){destX=dragMaxX;} if(animate===undefined){animate=settings.animateScroll;} if(animate){jsp.animate(horizontalDrag,'left',destX,_positionDragX);}else{horizontalDrag.css('left',destX);_positionDragX(destX);}} function _positionDragX(destX){if(destX===undefined){destX=horizontalDrag.position().left;} container.scrollTop(0);horizontalDragPosition=destX||0;var isAtLeft=horizontalDragPosition===0,isAtRight=horizontalDragPosition==dragMaxX,percentScrolled=destX/dragMaxX,destLeft=-percentScrolled*(contentWidth-paneWidth);if(wasAtLeft!=isAtLeft||wasAtRight!=isAtRight){wasAtLeft=isAtLeft;wasAtRight=isAtRight;elem.trigger('jsp-arrow-change',[wasAtTop,wasAtBottom,wasAtLeft,wasAtRight]);} updateHorizontalArrows(isAtLeft,isAtRight);pane.css('left',destLeft);elem.trigger('jsp-scroll-x',[-destLeft,isAtLeft,isAtRight]).trigger('scroll');} function updateVerticalArrows(isAtTop,isAtBottom){if(settings.showArrows){arrowUp[isAtTop?'addClass':'removeClass']('jspDisabled');arrowDown[isAtBottom?'addClass':'removeClass']('jspDisabled');}} function updateHorizontalArrows(isAtLeft,isAtRight){if(settings.showArrows){arrowLeft[isAtLeft?'addClass':'removeClass']('jspDisabled');arrowRight[isAtRight?'addClass':'removeClass']('jspDisabled');}} function scrollToY(destY,animate){var percentScrolled=destY/(contentHeight-paneHeight);positionDragY(percentScrolled*dragMaxY,animate);} function scrollToX(destX,animate){var percentScrolled=destX/(contentWidth-paneWidth);positionDragX(percentScrolled*dragMaxX,animate);} function scrollToElement(ele,stickToTop,animate){var e,eleHeight,eleWidth,eleTop=0,eleLeft=0,viewportTop,viewportLeft,maxVisibleEleTop,maxVisibleEleLeft,destY,destX;try{e=$(ele);}catch(err){return;} eleHeight=e.outerHeight();eleWidth=e.outerWidth();container.scrollTop(0);container.scrollLeft(0);while(!e.is('.jspPane')){eleTop+=e.position().top;eleLeft+=e.position().left;e=e.offsetParent();if(/^body|html$/i.test(e[0].nodeName)){return;}} viewportTop=contentPositionY();maxVisibleEleTop=viewportTop+paneHeight;if(eleTopmaxVisibleEleTop){destY=eleTop-paneHeight+eleHeight+settings.horizontalGutter;} if(!isNaN(destY)){scrollToY(destY,animate);} viewportLeft=contentPositionX();maxVisibleEleLeft=viewportLeft+paneWidth;if(eleLeftmaxVisibleEleLeft){destX=eleLeft-paneWidth+eleWidth+settings.horizontalGutter;} if(!isNaN(destX)){scrollToX(destX,animate);}} function contentPositionX(){return-pane.position().left;} function contentPositionY(){return-pane.position().top;} function isCloseToBottom(){var scrollableHeight=contentHeight-paneHeight;return(scrollableHeight>20)&&(scrollableHeight-contentPositionY()<10);} function isCloseToRight(){var scrollableWidth=contentWidth-paneWidth;return(scrollableWidth>20)&&(scrollableWidth-contentPositionX()<10);} function initMousewheel(){container.unbind(mwEvent).bind(mwEvent,function(event,delta,deltaX,deltaY){if(!horizontalDragPosition){horizontalDragPosition=0;} if(!verticalDragPosition){verticalDragPosition=0;} var dX=horizontalDragPosition,dY=verticalDragPosition,factor=event.deltaFactor||settings.mouseWheelSpeed;jsp.scrollBy(deltaX*factor,-deltaY*factor,false);return dX==horizontalDragPosition&&dY==verticalDragPosition;});} function removeMousewheel(){container.unbind(mwEvent);} function nil(){return false;} function initFocusHandler(){pane.find(':input,a').unbind('focus.jsp').bind('focus.jsp',function(e){scrollToElement(e.target,false);});} function removeFocusHandler(){pane.find(':input,a').unbind('focus.jsp');} function initKeyboardNav(){var keyDown,elementHasScrolled,validParents=[];isScrollableH&&validParents.push(horizontalBar[0]);isScrollableV&&validParents.push(verticalBar[0]);pane.bind('focus.jsp',function(){elem.focus();});elem.attr('tabindex',0).unbind('keydown.jsp keypress.jsp').bind('keydown.jsp',function(e){if(e.target!==this&&!(validParents.length&&$(e.target).closest(validParents).length)){return;} var dX=horizontalDragPosition,dY=verticalDragPosition;switch(e.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:keyDown=e.keyCode;keyDownHandler();break;case 35:scrollToY(contentHeight-paneHeight);keyDown=null;break;case 36:scrollToY(0);keyDown=null;break;} elementHasScrolled=e.keyCode==keyDown&&dX!=horizontalDragPosition||dY!=verticalDragPosition;return!elementHasScrolled;}).bind('keypress.jsp',function(e){if(e.keyCode==keyDown){keyDownHandler();} if(e.target!==this&&!(validParents.length&&$(e.target).closest(validParents).length)){return;} return!elementHasScrolled;});if(settings.hideFocus){elem.css('outline','none');if('hideFocus'in container[0]){elem.attr('hideFocus',true);}}else{elem.css('outline','');if('hideFocus'in container[0]){elem.attr('hideFocus',false);}} function keyDownHandler(){var dX=horizontalDragPosition,dY=verticalDragPosition;switch(keyDown){case 40:jsp.scrollByY(settings.keyboardSpeed,false);break;case 38:jsp.scrollByY(-settings.keyboardSpeed,false);break;case 34:case 32:jsp.scrollByY(paneHeight*settings.scrollPagePercent,false);break;case 33:jsp.scrollByY(-paneHeight*settings.scrollPagePercent,false);break;case 39:jsp.scrollByX(settings.keyboardSpeed,false);break;case 37:jsp.scrollByX(-settings.keyboardSpeed,false);break;} elementHasScrolled=dX!=horizontalDragPosition||dY!=verticalDragPosition;return elementHasScrolled;}} function removeKeyboardNav(){elem.attr('tabindex','-1').removeAttr('tabindex').unbind('keydown.jsp keypress.jsp');pane.unbind('.jsp');} function observeHash(){if(location.hash&&location.hash.length>1){var e,retryInt,hash=escape(location.hash.substr(1));try{e=$('#'+hash+', a[name="'+hash+'"]');}catch(err){return;} if(e.length&&pane.find(hash)){if(container.scrollTop()===0){retryInt=setInterval(function(){if(container.scrollTop()>0){scrollToElement(e,true);$(document).scrollTop(container.position().top);clearInterval(retryInt);}},50);}else{scrollToElement(e,true);$(document).scrollTop(container.position().top);}}}} function hijackInternalLinks(){if($(document.body).data('jspHijack')){return;} $(document.body).data('jspHijack',true);$(document.body).delegate('a[href*=#]','click',function(event){var href=this.href.substr(0,this.href.indexOf('#')),locationHref=location.href,hash,element,container,jsp,scrollTop,elementTop;if(location.href.indexOf('#')!==-1){locationHref=location.href.substr(0,location.href.indexOf('#'));} if(href!==locationHref){return;} hash=escape(this.href.substr(this.href.indexOf('#')+1));element;try{element=$('#'+hash+', a[name="'+hash+'"]');}catch(e){return;} if(!element.length){return;} container=element.closest('.jspScrollable');jsp=container.data('jsp');jsp.scrollToElement(element,true);if(container[0].scrollIntoView){scrollTop=$(window).scrollTop();elementTop=element.offset().top;if(elementTopscrollTop+$(window).height()){container[0].scrollIntoView();}} event.preventDefault();});} function initTouch(){var startX,startY,touchStartX,touchStartY,moved,moving=false;container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind('touchstart.jsp',function(e){var touch=e.originalEvent.touches[0];startX=contentPositionX();startY=contentPositionY();touchStartX=touch.pageX;touchStartY=touch.pageY;moved=false;moving=true;}).bind('touchmove.jsp',function(ev){if(!moving){return;} var touchPos=ev.originalEvent.touches[0],dX=horizontalDragPosition,dY=verticalDragPosition;jsp.scrollTo(startX+touchStartX-touchPos.pageX,startY+touchStartY-touchPos.pageY);moved=moved||Math.abs(touchStartX-touchPos.pageX)>5||Math.abs(touchStartY-touchPos.pageY)>5;return dX==horizontalDragPosition&&dY==verticalDragPosition;}).bind('touchend.jsp',function(e){moving=false;}).bind('click.jsp-touchclick',function(e){if(moved){moved=false;return false;}});} function destroy(){var currentY=contentPositionY(),currentX=contentPositionX();elem.removeClass('jspScrollable').unbind('.jsp');pane.unbind('.jsp');elem.replaceWith(originalElement.append(pane.children()));originalElement.scrollTop(currentY);originalElement.scrollLeft(currentX);if(reinitialiseInterval){clearInterval(reinitialiseInterval);}} $.extend(jsp,{reinitialise:function(s){s=$.extend({},settings,s);initialise(s);},scrollToElement:function(ele,stickToTop,animate){scrollToElement(ele,stickToTop,animate);},scrollTo:function(destX,destY,animate){scrollToX(destX,animate);scrollToY(destY,animate);},scrollToX:function(destX,animate){scrollToX(destX,animate);},scrollToY:function(destY,animate){scrollToY(destY,animate);},scrollToPercentX:function(destPercentX,animate){scrollToX(destPercentX*(contentWidth-paneWidth),animate);},scrollToPercentY:function(destPercentY,animate){scrollToY(destPercentY*(contentHeight-paneHeight),animate);},scrollBy:function(deltaX,deltaY,animate){jsp.scrollByX(deltaX,animate);jsp.scrollByY(deltaY,animate);},scrollByX:function(deltaX,animate){var destX=contentPositionX()+Math[deltaX<0?'floor':'ceil'](deltaX),percentScrolled=destX/(contentWidth-paneWidth);positionDragX(percentScrolled*dragMaxX,animate);},scrollByY:function(deltaY,animate){var destY=contentPositionY()+Math[deltaY<0?'floor':'ceil'](deltaY),percentScrolled=destY/(contentHeight-paneHeight);positionDragY(percentScrolled*dragMaxY,animate);},positionDragX:function(x,animate){positionDragX(x,animate);},positionDragY:function(y,animate){positionDragY(y,animate);},animate:function(ele,prop,value,stepCallback){var params={};params[prop]=value;ele.animate(params,{'duration':settings.animateDuration,'easing':settings.animateEase,'queue':false,'step':stepCallback});},getContentPositionX:function(){return contentPositionX();},getContentPositionY:function(){return contentPositionY();},getContentWidth:function(){return contentWidth;},getContentHeight:function(){return contentHeight;},getPercentScrolledX:function(){return contentPositionX()/(contentWidth-paneWidth);},getPercentScrolledY:function(){return contentPositionY()/(contentHeight-paneHeight);},getIsScrollableH:function(){return isScrollableH;},getIsScrollableV:function(){return isScrollableV;},getContentPane:function(){return pane;},scrollToBottom:function(animate){positionDragY(dragMaxY,animate);},hijackInternalLinks:$.noop,destroy:function(){destroy();}});initialise(s);} settings=$.extend({},$.fn.jScrollPane.defaults,settings);$.each(['arrowButtonSpeed','trackClickSpeed','keyboardSpeed'],function(){settings[this]=settings[this]||settings.speed;});return this.each(function(){var elem=$(this),jspApi=elem.data('jsp');if(jspApi){jspApi.reinitialise(settings);}else{$("script",elem).filter('[type="text/javascript"],:not([type])').remove();jspApi=new JScrollPane(elem,settings);elem.data('jsp',jspApi);}});};$.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:undefined,animateScroll:false,animateDuration:300,animateEase:'linear',hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:3,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:'split',horizontalArrowPositions:'split',enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8};})(jQuery);function LocationMap(options){this.settings=$.extend(true,{contentManager:null,data:[],mc:'#location-map-container'},options);var mc=$(this.settings.mc),that=this,contentManager=this.settings.contentManager,map,markers=[],infobox,locations,isLoading,bounds,markerCluster,isLoaded=false,hoverTimeout=null,initCallback=null,selectedXcode,specificMarker,scriptsToLoad=0,activeHotelRequest=null,clustererScript=null,infoBoxScript=null;function _onScriptReady(){scriptsToLoad--;if(scriptsToLoad==0){eval.apply(window,[infoBoxScript]);eval.apply(window,[clustererScript]);map=new google.maps.Map(mc.find('#location-map')[0],{center:new google.maps.LatLng(25,0),zoom:3,minZoom:3,mapTypeControl:false});mc.find('.map-type a').on('click',function(event){event.preventDefault();var btn=$(this);btn.siblings('.background-color-3').removeClass('background-color-3').addClass('background-color-4');btn.addClass('background-color-3').removeClass('background-color-4');if(btn.attr('data-map-type')=='road-map') map.setMapTypeId(google.maps.MapTypeId.ROADMAP);else{map.setMapTypeId(google.maps.MapTypeId.SATELLITE);}});isLoading=false;isLoaded=true;initCallback();initCallback=null;if(selectedXcode!=0){_showSpecific(selectedXcode);selectedXcode=0;}}} function _init(callback){if(isLoading) return;initCallback=callback;if(typeof MarkerClusterer=='undefined') scriptsToLoad++;if(typeof InfoBox=='undefined') scriptsToLoad++;scriptsToLoad++;if(!window.google||!window.google.maps){if(!window['GMResourcesLoading']){window['GMResourcesLoading']=true;$(window).one('google_maps_loaded',function(){_onScriptReady();}) if(!window['googleMapsLoadedCallback']){window['googleMapsLoadedCallback']=function(){window['GMResourcesLoading']=false;$(window).trigger('google_maps_loaded');}} $.getScript(gmaplinkJs+'v=3.exp&sensor=false&callback=googleMapsLoadedCallback');} else $(window).one('google_maps_loaded',function(){_onScriptReady();});} else _onScriptReady();if(typeof MarkerClusterer=='undefined'){$.ajax({url:baseRWDUri+'/assets/js/plugins/google.maps.markerclusterer.js',dataType:'text',success:function(data){clustererScript=data;_onScriptReady();}});} if(typeof Infobox=='undefined'){$.ajax({url:baseRWDUri+'/assets/js/plugins/google.maps.infobox.js',dataType:'text',success:function(data){infoBoxScript=data;_onScriptReady();}});} if(scriptsToLoad==0){scriptsToLoad++;_onScriptReady();}} function _infoboxContent(data){var infoboxContent='';return infoboxContent;} function _showMarkers(locations,clear){var clear=clear||false if(specificMarker) specificMarker=null;if(infobox) infobox.close() else{_createInfobox();} if(clear){_clearMap();} _renderMarkers();markerCluster=new MarkerClusterer(map,markers,{averageCenter:true,});google.maps.event.addListener(markerCluster,"mouseover",function(c){if(infobox) infobox.close();});} function _renderMarkers(){bounds=new google.maps.LatLngBounds();locations.forEach(function(elem){var marker=_createMarker(elem);if(!selectedXcode){bounds.extend(marker.getPosition());map.fitBounds(bounds);} markers.push(marker);});} function _createInfobox(){infobox=new InfoBox({content:'',boxClass:'hotel-infobox',disableAutoPan:false,pixelOffset:new google.maps.Size(($(window).width()<=767?-110:-150),-45),zIndex:null,alignBottom:true,boxStyle:{opacity:1,width:($(window).width()<=767?'220px':'300px')},closeBoxMargin:"15px 15px 10px 10px",closeBoxURL:"",infoBoxClearance:new google.maps.Size(20,150)});google.maps.event.addListener(infobox,'domready',function(){$('#close-infobox').unbind('click').on('click',function(){infobox.close();});});google.maps.event.addListener(infobox,'content_changed',function(){$('#close-infobox').unbind('click').on('click',function(){infobox.close();});});} function _createMarker(elem){var marker;var latLng=new google.maps.LatLng(elem[1],elem[2]);var marker=new google.maps.Marker({position:latLng,map:map,id:elem[0],contentLoaded:false});google.maps.event.addListener(marker,"mouseover",function(){if(infobox) infobox.close();hoverTimeout=setTimeout(function(){if(activeHotelRequest) activeHotelRequest.abort();infobox.open(map,marker);infobox.setContent(_infoboxContent('loading'));activeHotelRequest=that.getHotelData(marker.id,function(hotelData){infobox.setContent(_infoboxContent(hotelData));infobox.open(map,marker);});},250);});google.maps.event.addListener(marker,"mouseout",function(){if(hoverTimeout) clearTimeout(hoverTimeout);});google.maps.event.addListener(marker,'mousedown',function(){google.maps.event.trigger(map,'mouseup');});return marker;} function _clearMap(){if(markers.length){for(var i=0,ml=markers.length;i$('#offer-list-section').offset().top){$("body").animate({scrollTop:$('#offer-list-section').offset().top},300);}} this.showMarkers=function(offers,clear){var readyfunc=function(){locations=offers;_showMarkers(locations,clear);};if(!isLoaded){_init(readyfunc);return;} readyfunc();} this.showSpecific=function(xcode){_showSpecific(xcode);} this.addMarkers=function(){} this.clearMap=function(){_clearMap();} this.reset=function(){if(infobox) infobox.close();} this.getHotelData=function(id,callback){var data=contentManager?contentManager.settings.offers:this.settings.data;for(var i=0;i