(function(n){function i(){function e(r){function p(){var t=w.innerWidth();(u||!0)&&nt.width(t*e),n(window).width()<valtech.settings.breakpointTablet?(f.height("auto"),f.find(".content").height("auto"),f.find(".imagebanner").height("auto"),f.find(".readmode-spot").height("auto"),f.find(".banner-quote").height("auto")):c(v),f.find(".imagebanner,.readmode-spot, .crosslink-spot, .banner-quote").width(t),f.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")}),f.yass("refresh")}function c(t,r,u){i||(u>=h&&(h=u),t>=v&&(v=t,!f.is("#mwr-header")&&h+17>=t?f.height(t+17):f.height(t),f.find(".content").height(t),f.find(".imagebanner").height(t),n("html").is(".ie9, .ie8, .ie7")?(f.find(".banner-quote").height(t),f.find(".readmode-spot").height(t),f.find(".crosslink-spot").height(t)):(f.find(".banner-quote").height(t-r),f.find(".readmode-spot").height(t-r),f.find(".crosslink-spot").height(t-r))))}function tt(n){i||n>=l&&(l=n,f.find(".yass-paging-links").css("top",l))}function g(){f.parent().find(".readmode-content-viewport .readmode-readless:first").trigger("click")}var f=n(r),nt=f.find(".content"),it=f.find(".mwr-buttons"),w=f.find(".yass-viewport"),b=w.find(".link-selector"),o=f.find(".yass-nav-next"),s=f.find(".yass-nav-prev"),k=f.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=f.closest("div"),e=f.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,f.data().options),e===0&&!i){c(0);return}b.length>0&&f.append(b),e===1&&f.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),f.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&&f.find(".imagebanner img, .slider-content, .readmode-spot, .crosslink-spot").fadeTo(500,0).promise().done(function(){typeof i=="function"&&i(),f.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=f),e>1&&(y.autohideButtons?a.hover(function(){f.yass("pause"),o.fadeIn(300),s.fadeIn(300)},function(){f.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 r=n(".mwr-carousel"),o=Handlebars.compile('<li><a data-bannerIndex="{{index}}" href="{{url}}" title="{{title}}">{{title}}<\/a><\/li>'),i=n("body").hasClass("composer-edit"),u=n("html").hasClass("oldie"),f=r.find(".imagebanner, .readmode-spot, .crosslink-spot, .banner-quote");if(f.length===0&&!i){r.hide().height(0);return}r.each(function(n,t){e(t)})}var t=4e3,r=n(".my-test");i()})(jQuery)