(function(b,e,j){e._pxam=e._pxam||[];b.fn.backstretch=function(c,a){(c===j||0===c.length)&&b.error("No images were supplied for Backstretch");0===b(e).scrollTop()&&e.scrollTo(0,0);return this.each(function(){var h=b(this),d=h.data("backstretch");d&&(a=b.extend(d.options,a),d.destroy(!0));d=new k(this,c,a);h.data("backstretch",d)})};b.backstretch=function(c,a){return b("body").backstretch(c,a).data("backstretch")};b.expr[":"].backstretch=function(c){return b(c).data("backstretch")!==j};b.fn.backstretch.defaults= {centeredX:!0,centeredY:!0,duration:5E3,fade:0,fixedHeight:!1,linkSlides:!1,slideshowLinks:!1,slideshowTargets:!1,slideIDs:!1};var m={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},n={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxWidth:"none",zIndex:-999999},k=function(c,a,h){this.options=b.extend({},b.fn.backstretch.defaults,h||{});this.images=b.isArray(a)?a:[a];this.shownImages=[];b.each(this.images, function(){b("")[0].src=this});this.isBody=c===document.body;this.$container=b(c);this.$wrap=b('
').css(m).appendTo(this.$container);this.$root=this.isBody?l?b(e):b(document):this.$container;this.isBody||(c=this.$container.css("position"),a=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===a?0:a,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"}); this.index=0;this.show(this.index);b(e).on("resize.backstretch",b.proxy(this.resize,this)).on("orientationchange.backstretch",b.proxy(function(){this.isBody&&0===e.pageYOffset&&(e.scrollTo(0,1),this.resize())},this))};k.prototype={resize:function(){try{var c={left:0,top:0},a=this.isBody?this.$root.width():this.$root.innerWidth(),b=a,d=this.isBody?e.innerHeight?e.innerHeight:this.$root.height():this.$root.innerHeight(),f=b/this.$img.data("ratio"),g;if(this.options.fixedHeight){if(f=d,b=f*this.$img.data("ratio"), g=(b-a)/2,this.options.centeredX)c.left="-"+g+"px",c.left=c.left.replace(/--/,"")}else if(f>=d){if(g=(f-d)/2,this.options.centeredY)c.top="-"+g+"px"}else if(f=d,b=f*this.$img.data("ratio"),g=(b-a)/2,this.options.centeredX)c.left="-"+g+"px";this.$wrap.css({width:a,height:d}).find("img:not(.deleteable)").css({width:b,height:f}).css(c)}catch(i){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){this.index=c;var a=this,h=a.$wrap.find("img").addClass("deleteable"),d=b.Event("backstretch.show", {index:c,relatedTarget:a.$container[0]});clearInterval(a.interval);a.$img=b("").css(n).bind("load",function(c){var e=this.width||b(c.target).width(),c=this.height||b(c.target).height();b(this).data("ratio",e/c);a.resize();a.$container.trigger(d);b(this).fadeIn(a.options.speed||a.options.fade,function(){h.remove();a.paused||a.cycle()})}).appendTo(a.$wrap);a.link=a.options.slideshowLinks[a.index];!0===a.options.linkSlides&&a.options.slideshowLinks.length===this.images.length&&a.options.slideshowTargets.length=== this.images.length&&""!==a.link&&(a.$img.addClass("pointer").attr("data-slide-id",a.options.slideIDs[a.index]).off("click").on("click",function(c){var b=function(){e.open(a.link,"_blank"==a.options.slideshowTargets[a.index]?"_blank":"_self")};a.options.slideIDs[a.index]!==j&&""!=a.options.slideIDs[a.index]?(DDC.pushToPixall({type:"event",eventType:"slideClick",eventArgs:[a.options.slideIDs[a.index]]},{source:'cms-web'}),e.setTimeout(b,100)):b();c.preventDefault()}),a.options.slideIDs[a.index]!==j&&""!=a.options.slideIDs[a.index]&& -1===a.shownImages.indexOf(a.index)&&!DDC.isComposer&&(DDC.pushToPixall({type:"event",eventType:"slideView",eventArgs:[a.options.slideIDs[a.index]]},{source:'cms-web'}),a.shownImages.push(a.index)));a.$img.attr("src",a.images[c]);return a}},gotoSlide:function(c){return this.show(c)},next:function(){return this.show(this.index