function imgpreload(g,f,d){var b=0;var a=[];g=object.prototype.tostring.apply(g)==="[object array]"?g:[g];var e=function(){b+=1;if(b===g.length&&f){f(a,d);}};for(var c=0;c=0;t={horizontal:{},vertical:{}};h=1;k={};q="waypoints-context-id";z="resize.waypoints";e="scroll.waypoints";k=1;j="waypoints-waypoint-ids";g="waypoint";c="waypoints";a=function(){function c(d){var f=this;this.$element=d;this.element=d[0];this.didresize=false;this.didscroll=false;this.id="context"+h++;this.oldscroll={x:d.scrollleft(),y:d.scrolltop()};this.waypoints={horizontal:{},vertical:{}};d.data(q,this.id);k[this.id]=this;d.bind(e,function(){var g;if(!(f.didscroll||j)){f.didscroll=true;g=function(){f.doscroll();return f.didscroll=false;};return x.settimeout(g,b[c].settings.scrollthrottle);}});d.bind(z,function(){var g;if(!f.didresize){f.didresize=true;g=function(){b[c]("refresh");return f.didresize=false;};return x.settimeout(g,b[c].settings.resizethrottle);}});}c.prototype.doscroll=function(){var d,f=this;d={horizontal:{newscroll:this.$element.scrollleft(),oldscroll:this.oldscroll.x,forward:"right",backward:"left"},vertical:{newscroll:this.$element.scrolltop(),oldscroll:this.oldscroll.y,forward:"down",backward:"up"}};if(j&&(!d.vertical.oldscroll||!d.vertical.newscroll)){b[c]("refresh");}b.each(d,function(m,n){var h,p,g;g=[];p=n.newscroll>n.oldscroll;h=p?n.forward:n.backward;b.each(f.waypoints[m],function(o,r){var s,l;if(n.oldscroll<(s=r.offset)&&s<=n.newscroll){return g.push(r);}else{if(n.newscroll<(l=r.offset)&&l<=n.oldscroll){return g.push(r);}}});g.sort(function(i,l){return i.offset-l.offset;});if(!p){g.reverse();}return b.each(g,function(i,l){if(l.options.continuous||i===g.length-1){return l.trigger([h]);}});});return this.oldscroll={x:d.horizontal.newscroll,y:d.vertical.newscroll};};c.prototype.refresh=function(){var f,h,g,d=this;g=b.iswindow(this.element);h=this.$element.offset();this.doscroll();f={horizontal:{contextoffset:g?0:h.left,contextscroll:g?0:this.oldscroll.x,contextdimension:this.$element.width(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:g?0:h.top,contextscroll:g?0:this.oldscroll.y,contextdimension:g?b[c]("viewportheight"):this.$element.height(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};return b.each(f,function(i,l){return b.each(d.waypoints[i],function(p,v){var n,y,m,u,w;n=v.options.offset;m=v.offset;y=b.iswindow(v.element)?0:v.$element.offset()[l.offsetprop];if(b.isfunction(n)){n=n.apply(v.element);}else{if(typeof n==="string"){n=parsefloat(n);if(v.options.offset.indexof("%")>-1){n=math.ceil(l.contextdimension*n/100);}}}v.offset=y-l.contextoffset+l.contextscroll-n;if(v.options.onlyonscroll&&m!=null||!v.enabled){return;}if(m!==null&&m<(u=l.oldscroll)&&u<=v.offset){return v.trigger([l.backward]);}else{if(m!==null&&m>(w=l.oldscroll)&&w>=v.offset){return v.trigger([l.forward]);}else{if(m===null&&l.oldscroll>=v.offset){return v.trigger([l.forward]);}}}});});};c.prototype.checkempty=function(){if(b.isemptyobject(this.waypoints.horizontal)&&b.isemptyobject(this.waypoints.vertical)){this.$element.unbind([z,e].join(" "));return delete k[this.id];}};return c;}();d=function(){function c(f,h,g){var d,l;g=b.extend({},b.fn[g].defaults,g);if(g.offset==="bottom-in-view"){g.offset=function(){var i;i=b[c]("viewportheight");if(!b.iswindow(h.element)){i=h.$element.height();}return i-b(this).outerheight();};}this.$element=f;this.element=f[0];this.axis=g.horizontal?"horizontal":"vertical";this.callback=g.handler;this.context=h;this.enabled=g.enabled;this.id="waypoints"+k++;this.offset=null;this.options=g;h.waypoints[this.axis][this.id]=this;t[this.axis][this.id]=this;d=(l=f.data(j))!=null?l:[];d.push(this.id);f.data(j,d);}c.prototype.trigger=function(d){if(!this.enabled){return;}if(this.callback!=null){this.callback.apply(this.element,d);}if(this.options.triggeronce){return this.destroy();}};c.prototype.disable=function(){return this.enabled=false;};c.prototype.enable=function(){this.context.refresh();return this.enabled=true;};c.prototype.destroy=function(){delete t[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkempty();};c.getwaypointsbyelement=function(d){var g,f;f=b(d).data(j);if(!f){return[];}g=b.extend({},t.horizontal,t.vertical);return b.map(f,function(h){return g[h];});};return c;}();i={init:function(c,f){var d;if(f==null){f={};}if((d=f.handler)==null){f.handler=c;}this.each(function(){var h,m,g,l;h=b(this);g=(l=f.context)!=null?l:b.fn[g].defaults.context;if(!b.iswindow(g)){g=h.closest(g);}g=b(g);m=k[g.data(q)];if(!m){m=new a(g);}return new d(h,m,f);});b[c]("refresh");return this;},disable:function(){return i._invoke(this,"disable");},enable:function(){return i._invoke(this,"enable");},destroy:function(){return i._invoke(this,"destroy");},prev:function(c,d){return i._traverse.call(this,c,d,function(f,g,h){if(g>0){return f.push(h[g-1]);}});},next:function(c,d){return i._traverse.call(this,c,d,function(f,g,h){if(gd.oldscroll.y;});},left:function(c){if(c==null){c=x;}return f._filter(c,"horizontal",function(d,f){return f.offset<=d.oldscroll.x;});},right:function(c){if(c==null){c=x;}return f._filter(c,"horizontal",function(d,f){return f.offset>d.oldscroll.x;});},enable:function(){return f._invoke("enable");},disable:function(){return f._invoke("disable");},destroy:function(){return f._invoke("destroy");},extendfn:function(c,d){return i[c]=d;},_invoke:function(c){var d;d=b.extend({},t.vertical,t.horizontal);return b.each(d,function(f,g){g[c]();return true;});},_filter:function(d,g,f){var c,h;c=k[b(d).data(q)];if(!c){return[];}h=[];b.each(c.waypoints[g],function(i,l){if(f(c,l)){return h.push(l);}});h.sort(function(i,l){return i.offset-l.offset;});return b.map(h,function(i){return i.element;});}};b[c]=function(){var c,d;d=arguments[0],c=2<=arguments.length?b.call(arguments,1):[];if(f[d]){return f[d].apply(null,c);}else{return f.aggregate.call(null,d);}};b[c].settings={resizethrottle:100,scrollthrottle:30};return e.load(function(){return b[c]("refresh");});});}).call(this); /*! hp08 */ jquery(document).ready(function(a) { a("div.hp08v0").each(function() { var d = ""; var f = (a(this).is("[data-showlist]")) ? a(this).attr("data-showlist") : "show list view"; var b = (a(this).is("[data-showimgs]")) ? a(this).attr("data-showimgs") : "show panel view"; a(this).addclass("hp08notloaded").addclass("hp08imgitems").attr("data-lbl", "panelview"); a(this).find(".hp08v1").each(function(k) { var j = a(this)[0].id; var i = a(this).find(".hp08label").text(); var h = (a(this).is("[data-lbl]")) ? a(this).attr("data-lbl") : j; d += '
  • ' + i + "
  • "; a(this).find(".hp08promo").each(function(l) { a(this).attr("data-lbl", "location" + (l + 1)); }); }); d = '
      ' + d + '
    '; a(this).prepend(d); var e = 1; if (a(this).hasclass("randomtab")) { var g = (a(this).find(".hp08tablist li").length * 2) + 2; g = math.floor(math.random() * (g - 1 + 1)) + 1; if (g > 4) { e = math.round((g - 2) / 2); } } a(this).find(".hp08tablist li:nth-child(" + e + ")").addclass("hp08default"); a(this).prepend('
    '); a(this).find(".hp08teaser").wrapinner("").append('').hide(); a(this).find(".hp08cta").wrapinner("").hide(); var c = '
    '; a(this).find(".hp08w2").append(c); hp08resize(); }); a(".hp08v0").waypoint(function(b) { if (!a(this).find(".hp08img")[0]) { hp08showpromo(a(".hp08v0 .hp08default a").attr("href").split("#")[1]); } }, { offset: "100%" }); }); jquery(window).resize(function(a) { hp08resize(); }); function hp08resize() { jquery("div.hp08promo").each(function() { if ($(this).hasclass("hp08promo-3")) { $(this).css("height", $(this).closest(".hp08v1").outerheight()); } var a = jquery(this).find(".hp08teaser").height(); var b = jquery(this).height(); var c = jquery(this).find(".cmps-bttns span").width(); jquery(this).find(".hp08cta").css("height", (b) + "px").css("margin-top", ( - 1 * a) + "px").css("padding-top", (1 * a) + "px"); jquery(this).find(".hp08w3").css("top", (b - a) + "px").css("padding-right", (c + 40) + "px"); jquery(this).find(".hp08w4").css("padding-right", (c + 40) + "px"); }); } $(document).on("click", ".hp08tablist ul a", function() { if ($(this)[0].href.split("#")[1] != $(".hp08v0").attr("data-cfilter")) { hp08showpromo($(this)[0].href.split("#")[1]); } $(".hp08viewmenu").removeclass("hp08viewmenu"); return false; }); $(document).on("click", ".hp08tglview a", function() { $(this).closest(".hp08").toggleclass("hp08lvw").toggleclass("hp08imgitems"); if ($(this).closest(".hp08").attr("data-lbl") == "panelview") { $(this).closest(".hp08").attr("data-lbl", "listview"); } else { $(this).closest(".hp08").attr("data-lbl", "panelview"); } hp08resize(); $(this).parent().find(".hp08tgl-icn").css("opacity", 0.2).animate({ opacity: 1 }, 800, "easeinoutsine"); return false; }); $(document).on("click", "#hp08selector a", function() { $(this).closest(".hp08").toggleclass("hp08viewmenu"); return false; }); $(document).on("click", ".hp08promo a[target]", function() { $(this).blur(); }); $(document).on("mouseenter", ".hp08notloaded", function() { $(this).find(".hp08promo a[data-bgimg]").each(function(c) { var b = hp08imgpos($(this).attr("data-bgimg")); var a = ($(this).is("[data-bgimg2x]") && $("html").hasclass("retina")) ? $(this).attr("data-bgimg2x") : $(this).attr("data-bgimg"); $(this).prepend('
    "); $(this).removeattr("data-bgimg").removeattr("data-bgimg2x"); }); $(this).removeclass("hp08notloaded"); }); function hp08showpromo(a) { var c = $("#" + a); c.parent().find(".hp08cta").hide(); var b = $("#" + $(".hp08v0").attr("data-cfilter")); if (b[0]) { $(".hp08prevf").removeclass("hp08prevf"); b.removeclass("hp08currentfilter").addclass("hp08prevf"); b.find(".hp08cta").hide(); } c.addclass("hp08currentfilter"); c.find(".hp08promo a").css("top", "-150%"); $(".hp08selected").removeclass("hp08selected").removeclass("hp08default"); $('.hp08tablist a[href="#' + a + '"]').parent().addclass("hp08selected"); $("#hp08selector a").html($('.hp08tablist a[href="#' + a + '"]').parent().text()); $(".hp08v0").attr("data-cfilter", a); c.find(".hp08promo a").each(function(g) { if (!$(this).find(".hp08img")[0] && $(this).is("[data-bgimg]")) { var d = ($(this).is("[data-bgimg2x]") && $("html").hasclass("retina")) ? $(this).attr("data-bgimg2x") : $(this).attr("data-bgimg"); $(this).removeattr("data-bgimg").removeattr("data-bgimg2x"); imgpreload([d], function(h, i) { i.css("top", "-150%"); var j = hp08imgpos(d); i.prepend('
    "); hp08loadp(i); }, $(this)); } else { var f = $(this); if (f.closest(".hp08imgitems")[0]) { var e = settimeout(function() { hp08loadp(f); }, (g * (100 - (g * 4)))); } else { hp08loadp(f); } } }); } function hp08loadp(b) { b.find(".hp08teaser").show(); hp08resize(); var a = "hp08promo-" + b.parent()[0].classname.split("8promo-")[1].split(" ")[0]; if (b.closest(".hp08imgitems")[0]) { b.animate({ top: "0%" }, 700, "easeinoutsine", function() { $(this).find(".hp08cta").show(); $("div.hp08prevf ." + a + " a").css("top", "-150%"); }); } else { b.css("top", 0).show(); b.find(".hp08cta").show(); } } function hp08imgpos(a) { if (/hp08c[13]p1/.test(a)) { return " hp08bg-tl"; } else { if (/hp08c[13]p2/.test(a)) { return " hp08bg-tc"; } else { if (/hp08c[13]p3/.test(a)) { return " hp08bg-tr"; } else { if (/hp08c2p1/.test(a)) { return " hp08bg-tc"; } else { if (/hp08c2p2/.test(a)) { return " hp08bg-mc"; } else { if (/hp08c2p3/.test(a)) { return " hp08bg-bc"; } else { return ""; } } } } } } } jquery(document).ready(function(a) { a(".hp09roles > li:nth-child(3)").addclass("hp08clft"); if (!document.addeventlistener) { a("div.hp09icn").append(' '); } a(".hp09v0").waypoint(function(b) { a(this).addclass("hp09loadicons"); }, { offset: "100%" }); });