(function(n){function i(){function o(i){function p(){var t=w.innerWidth();(f||!0)&&nt.width(t*e),n(window).width()<valtech.settings.breakpointTablet?(u.height("auto"),u.find(".content").height("auto"),u.find(".imagebanner").height("auto"),u.find(".readmode-spot").height("auto"),u.find(".banner-quote").height("auto")):c(v),u.find(".imagebanner,.readmode-spot, .crosslink-spot, .banner-quote").width(t),u.find(".imagebanner img").each(function(i,r){var u=n(r),f=u.width();f>t?u.css("right",(f-t)/2+"px"):u.css("right","0px")}),u.yass("refresh")}function c(t,i,f){r||(f>=h&&(h=f),t>=v&&(v=t,!u.is("#mwr-header")&&h+17>=t?u.height(t+17):u.height(t),u.find(".content").height(t),u.find(".imagebanner").height(t),n("html").is(".ie9, .ie8, .ie7")?(u.find(".banner-quote").height(t),u.find(".readmode-spot").height(t),u.find(".crosslink-spot").height(t)):(u.find(".banner-quote").height(t-i),u.find(".readmode-spot").height(t-i),u.find(".crosslink-spot").height(t-i))))}function tt(n){r||n>=l&&(l=n,u.find(".yass-paging-links").css("top",l))}function g(){u.parent().find(".readmode-content-viewport .readmode-readless:first").trigger("click")}var u=n(i),nt=u.find(".content"),it=u.find(".mwr-buttons"),w=u.find(".yass-viewport"),b=w.find(".link-selector"),o=u.find(".yass-nav-next"),s=u.find(".yass-nav-prev"),k=u.find(".imagebanner img, .readmode-spot .spot-image img, .readmode-spot .wrapper-link img, .crosslink-spot .wrapper-link img, .banner-quote .wrapper-link img.img-banner"),a=u.closest("div"),e=u.find(".imagebanner, .readmode-spot, .crosslink-spot, .banner-quote").length,v=-1,y={autoplay:!0,autohideButtons:!0},d=n(window).width(),h,l;if(n.extend(y,u.data().options),e===0&&!r){c(0);return}b.length>0&&u.append(b),e===1&&u.addClass("single-element-carousel"),h=0,l=0,setTimeout(function(){k.each(function(t,i){var u=n(i),r=u.hasClass("spot-image")?u:u.closest(".spot-image"),f,e,s,o;r.length===0&&(r=u),f=r.closest(".readmode-spot, .crosslink-spot, .banner-quote"),e=f.outerHeight()-f.height(),n("<img/>").load(function(){var t=r.outerWidth(),n=Math.round(t/this.width*this.height);o=f.is(".banner-quote")?r.closest(".wrapper-link").outerHeight():r.next(".wrapper-link").outerHeight()+e,s=Math.max(o,n),tt(n),c(s,e,n)}).attr("src",i.src)}),k.length===0&&c(20)},0),u.yass({selectors:{content:".content",snapTo:".imagebanner, .readmode-spot, .crosslink-spot, .banner-quote"},onScrollTo:function(t,i){if(n(window).width()<=valtech.settings.breakpointTablet){i();return}e>1&&u.find(".imagebanner img, .slider-content, .readmode-spot, .crosslink-spot").fadeTo(500,0).promise().done(function(){typeof i=="function"&&i(),u.find(".imagebanner img, .slider-content, .readmode-spot, .crosslink-spot").fadeTo(500,1)})},wrapAround:function(){return n(window).width()>valtech.settings.breakpointTablet},autoplay:y.autoplay&&e>1,autoplayInterval:t,touch:!0}),a.length===0&&(a=u),e>1&&(y.autohideButtons?a.hover(function(){u.yass("pause"),o.fadeIn(300),s.fadeIn(300)},function(){u.yass("resume"),o.fadeOut(300),s.fadeOut(300)}):(o.show(),s.show())),p(),valtech.composerEditMode||n(window).resize(n.throttle(250,function(){var t=n(window).width();t!==d&&(d=t,p())})),n(window).load(p);o.on("click",g);s.on("click",g)}var i=n(".mwr-carousel"),s=Handlebars.compile('<li><a data-bannerIndex="{{index}}" href="{{url}}" title="{{title}}">{{title}}<\/a><\/li>'),r=n("body").hasClass("composer-edit"),f=n("html").hasClass("oldie"),e=i.find(".imagebanner, .readmode-spot, .crosslink-spot, .banner-quote"),u=i.find(".hero");if(e.length===0&&u.length===0&&!r){i.hide().height(0);return}if(u.length!=0)return i.addClass("hero-carousel"),u.css("height",u.outerHeight()),!1;i.each(function(n,t){o(t)})}var t=4e3,r=n(".my-test");i()})(jQuery)