'use strict';var aniCommon=aniCommon||{};"use strict"; (function(){(function(a){var c=void 0===a.firstLoad;a.firstLoad=!1;return c})(aniCommon)&&(aniCommon.utility=function(){return{delayCall:function(a,c){var b;return function(){clearTimeout(b);b=setTimeout(a,c)}},reducedAnimation:function(){aniCommon.isReducedAnimation=window.matchMedia("(prefers-reduced-motion)").matches;!0===aniCommon.isReducedAnimation?$("body").addClass("animation-off"):$("body").addClass("animation-on");return aniCommon.isReducedAnimation}}}(),aniCommon.isReducedAnimation=aniCommon.utility.reducedAnimation(), window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change",()=>{aniCommon.isReducedAnimation=aniCommon.utility.reducedAnimation()}))})();var desktopSrc,desktopPoster,mobileSrc,mobilePoster,mobileWidth,mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),islifeIE11=!!navigator.userAgent.match(/Trident\/7.0/),prevclass="dummyclass";islifeIE11?mediaQuery.addListener("change",function(){lifestylevideo()}):mediaQuery.addEventListener("change",function(){lifestylevideo()}); $(document).ready(function(){$(".wdg-lifestyle-video .lifestyle-video-content");$(".wdg-lifestyle-video .lifestyle-video").each(function(a,c){var b=$(c);setTimeout(function(){videoreplacment(b,ContentPositioning)},1E3)});$(".wdg-lifestyle-video .videobutton").click(function(){var a=$(this).parents(".lifestyle-video").find("video").get(0),c=$(this),b=c.attr("data-pause-title"),d=c.attr("data-play-title");a.paused?(a.play(),c.addClass("glyph-pause").removeClass("glyph-play").attr({title:b,"aria-label":b}), a.addEventListener("ended",function(){c.removeClass("glyph-pause").addClass("glyph-play").attr({title:d,"aria-label":d})})):(a.pause(),c.removeClass("glyph-pause").addClass("glyph-play").attr({title:d,"aria-label":d}))});$(".link-group .c-call-to-action").click(function(){var a=$(this).parents(".wdg-lifestyle-video"),c=a.find(".lifestylevideoautoplay").get(0);c.pause();c.currentTime=0;a=a.find(".videobutton");c=a.attr("data-play-title");a.removeClass("glyph-pause").addClass("glyph-play").attr({title:c, "aria-label":c})});$(".c-call-to-action").wrapInner("\x3cspan\x3e\x3c/span\x3e")});$(window).on("scroll",function(){$("body").hasClass(prevclass)||lifestylecheck()});function lifestylecheck(){prevclass=$("body").hasClass("animation-off")?"animation-off":"animation-on";lifestylevideo()}function lifestylevideo(){$(".wdg-lifestyle-video .lifestyle-video").each(function(a,c){a=$(c);videoreplacment(a,ContentPositioning)})} function videoreplacment(a,c){var b=a.find("video.lifestylevideoautoplay");a=a.parents(".wdg-lifestyle-video");var d=a.find(".lifestyle-video-content");desktopSrc=b.attr("desktop-src");desktopPoster=b.attr("desktop-poster");mobileSrc=b.attr("mobile-src");mobilePoster=b.attr("mobile-poster");mobileWidth=$(a).hasClass("card-style")?1083:1200;""!=mobileSrc&&""!=mobilePoster&&0mobileWidth&&$(this).attr("src")!=desktopSrc&&ChangeAmbientVideoSrc(desktopSrc,desktopPoster,b)});c(d)}window.addEventListener("resize",aniCommon.utility.delayCall(function(){$(".wdg-lifestyle-video .lifestyle-video").each(function(a,c){var b=$(c);setTimeout(function(){videoreplacment(b,ContentPositioning)},1E3)})},500)); function ContentPositioning(a){var c=a.parents(".wdg-lifestyle-video");if($("body").hasClass("animation-off"))a.removeAttr("style");else{var b=$(window).height();var d=600>$(window).width()?-(.25*b):-(1/3*b);c.hasClass("card-style")?a.css({transform:"translate3d(0,0,0)","padding-bottom":b}):a.css({transform:"translate3d(0,"+d+"px,0)","padding-bottom":-d})}}function ChangeAmbientVideoSrc(a,c,b){void 0!=b&&(b.attr("src",""),b.attr("poster",""),b.attr("src",a),b.attr("poster",c))};