(function(e,c,a,g){var d="videoSlideAnimation",f={videoLength:g,videoFw:"",videoBw:"",slider:g};function b(i,h){this.element=e(i);this.settings=e.extend({},f,h,e(i).data());this._defaults=f;this._name=d;this._overlayContainer=e(".video-overlay",this.element).first();this._videoContainerFw=e("#"+this.settings.videoFw,this.element);this._videoContainerBw=e("#"+this.settings.videoBw,this.element);this._videoContainerFw._canPlay=this._videoContainerBw._canPlay=false;this._slider=e("#"+this.settings.slider,this.element);this._slides=this._slider.children();this._direction="Fw";this._running=g;this._runningContainer=g;this._other=g;this._otherContainer=g;this._nextStop=g;this._nextPause=g;this._introPlayed=false;this._callbackPostStop=g;this.init();this.element.on("prepare",e.proxy(this.prepare,this));this.element.on("start",e.proxy(this.start,this))}e.extend(b.prototype,{init:function(){e(".fallback",this.element).hide();this._initSlider();this._initVideo()},prepare:function(){this._startSlider();this._sliderEvents()},start:function(){this._showSlider();this._firstSlide()},_initSlider:function(){this._slider.fadeTo(0,0)},_startSlider:function(){this._slider.slick({infinite:false,dots:true,slidesToShow:1,slidesToScroll:1,slide:"div",speed:800,arrows:true,easing:"easeInQuart",mobileFirst:true,responsive:[{breakpoint:0,settings:{slidesToShow:1,slidesToScroll:1,speed:800,adaptiveHeight:true,easing:"easeInQuart"}}]});var h=e(".slick-list",this._slider);this._overlayContainer.on("touchstart mousedown touchmove mousemove touchend mouseup touchcancel mouseleave",function(k,j,i,m,l){h.trigger(k,[j,i,m,l])})},_sliderEvents:function(){this._slider.on("init",function(i,h){var j=h.$slider});this._slider.on("beforeChange",e.proxy(function(i,h,k,j){if(typeof utag!="undefined"&&typeof utag.link=="function"){utag.link({event_subtype:"onsite",event_action:"slider",event_type:"click",event_label:"position_"+(j+1).toString()})}if(typeof this._running!="undefined"){e(this._running).off();this._running.pause();this._syncVideoCurrentTime();this._prepareDirectionAndNextAutoStop(k,j);return this._jumpToNextSceneInit(false)}if(Math.abs(j-k)>1){this._prepareDirectionAndNextAutoStop(k,j);return this._jumpToNextSceneInit(true)}this._prepareDirectionAndNextAutoStop(k,j);return this._showNextScene(k,j)},this));e(c).on("orientationchange",e.proxy(function(h){this._slider.slick("resize")},this))},_showSlider:function(){this._slider.fadeTo(2000,1)},_firstSlide:function(){this._nextStop=parseFloat(e(this._slides[0]).data("videoPause"));this._direction="Fw";this._running=this._videoFw;this._runningContainer=this._videoContainerFw;this._other=this._videoBw;this._otherContainer=this._videoContainerBw;e(this._running).on("timeupdate",e.proxy(this._videoTimeUpdate,this));this._running.play();this._videoContainerFw.fadeTo(800,1)},_initVideo:function(){this._videoContainerFw.fadeTo(0,0);this._videoContainerBw.fadeTo(0,0);this._videoFw=new MediaElement(this.settings.videoFw,{stretching:"responsive",videoWidth:"1140",videoHeight:"640"});this._videoBw=new MediaElement(this.settings.videoBw,{stretching:"responsive",videoWidth:"1140",videoHeight:"640"});this._videoFw.pause();this._videoBw.pause();e(this._videoFw).on("canplaythrough",e.proxy(this._videoCanPlayThrough,this));e(this._videoBw).on("canplaythrough",e.proxy(this._videoCanPlayThrough,this));e(this._videoFw).on("play",e.proxy(this._videoPlay,this));e(this._videoBw).on("play",e.proxy(this._videoPlay,this));e(this._videoFw).on("progress",e.proxy(this._progress,this));e(this._videoBw).on("progress",e.proxy(this._progress,this))},_syncVideoCurrentTime:function(){if(this._direction=="Fw"){this._videoBw.currentTime=parseFloat(this.settings.videoLength)-this._videoFw.currentTime}else{this._videoFw.currentTime=parseFloat(this.settings.videoLength)-this._videoBw.currentTime}},_prepareDirectionAndNextAutoStop:function(i,h){if(h>i){this._nextStop=parseFloat(e(this._slides[h]).data("videoPause"));this._direction="Fw";this._running=this._videoFw;this._runningContainer=this._videoContainerFw;this._other=this._videoBw;this._otherContainer=this._videoContainerBw}else{this._nextStop=parseFloat(this.settings.videoLength)-parseFloat(e(this._slides[h]).data("videoPause"));this._direction="Bw";this._running=this._videoBw;this._runningContainer=this._videoContainerBw;this._other=this._videoFw;this._otherContainer=this._videoContainerFw}},_showNextScene:function(){this._running.currentTime+=0.5;this._running.play();e(this._running).on("timeupdate",e.proxy(this._videoTimeUpdate,this));this._runningContainer.fadeTo(0,1);this._otherContainer.fadeTo(0,0);return true},_jumpToNextSceneInit:function(h){this._runningContainer.fadeTo(0,1);this._otherContainer.fadeTo(0,0);if(h){this._running.currentTime+=0.5}this._callbackPostStop=this._jumpToNextSceneFinish;this._nextPause=this._running.currentTime+1.5;this._running.play();e(this._running).on("timeupdate",e.proxy(this._videoTimeUpdate,this));this._runningContainer.fadeTo(1500,0);return true},_jumpToNextSceneFinish:function(){this._callbackPostStop=g;this._running.currentTime=this._nextStop-1.5;this._running.play();e(this._running).on("timeupdate",e.proxy(this._videoTimeUpdate,this));this._runningContainer.fadeTo(1500,1);return true},_videoCanPlayThrough:function(h,i){if(h.currentTarget.getAttribute("id")=="power-anim-fw"){this._videoContainerFw._canPlay=true}if(this._videoContainerFw._canPlay){this._overlayContainer.removeClass("loading")}},_progress:function(h){},_videoPlay:function(h,i){},_videoTimeUpdate:function(h,i){if(typeof this._running=="object"){if((this._running.currentTime>=this._nextStop)||(typeof this._callbackPostStop=="function"&&this._running.currentTime>=this._nextPause)){e(h.target).off();this._running.pause();if(typeof this._callbackPostStop!="function"){this._syncVideoCurrentTime();this._running=g;this._runningContainer=g;this._other=g;this._otherContainer=g;if(!this._introPlayed){this._introPlayed=true}}if(typeof this._callbackPostStop=="function"){this._callbackPostStop()}return true}}},_videoEnded:function(h,i){}});e.fn[d]=function(h){var i;this.each(function(){i=e.data(this,"plugin_"+d);if(!i){i=new b(this,h);e.data(this,"plugin_"+d,i)}});return i}})(jQuery,window,document);$(document).ready(function(){Modernizr.addTest("iosinpagevideo",function(){return navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?("playsInline" in document.createElement("video")):true});Modernizr.addTest("samsungbrowser",function(){return navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)});Modernizr.addTest("video",function(){var d=document.createElement("video");var c=false;try{c=!!d.canPlayType;if(c){c=new Boolean(c);c.h264=d.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")}}catch(f){}return c});Modernizr.addTest("lowbandwidth",function(){var c=navigator.connection||{type:0};return c.type==3||c.type==4||/^[23]g$/.test(c.type)});function b(){return !(Modernizr.lowbandwidth)&&!(Modernizr.samsungbrowser)&&Modernizr.video&&Modernizr.iosinpagevideo}if(b()){$("#power-animation").videoSlideAnimation();$("#power-animation").trigger("prepare");var a=!1;$("#power-animation").waypoint(function(c){if(c=="down"&&!a){a=1;$("#power-animation").trigger("start")}},{offset:"65%"})}else{$("#power-animation .video-content").hide()}});