$(function(){function f(){r=new Swiper(".js__home_slider",{pagination:{el:".js__c-slider__nav",type:"bullets",clickable:!0},loop:!0,queueStartCallbacks:!0,touchRatio:1,speed:1400,on:{transitionStart:function(){if($(".js__home_slider video").length)n.find(".swiper-slide-active .js__video_el").trigger("play"),n.find(".swiper-slide-next .js__video_el").trigger("play");else return},transitionEnd:function(){if($(".js__home_slider video").length){n.find(".swiper-slide-prev .js__video_el").trigger("pause");e();var t=n.find(".js__video_slide:not(.swiper-slide-active) video");t.each(function(){$(this).trigger("pause");$(this).currentTime=0;$(this).load()})}else return;this.pagination.update();console.log("next")}}})}function e(){$(".swiper-slide-active .js__video_el").on("ended",function(n){console.log(n);r.slideNext();r.pagination.update()})}function o(n,t){var u=i.height(),r=i.height()-t;n.css({height:r})}function s(){var n=navigator.userAgent.toLowerCase();return n.indexOf("msie")!=-1?parseInt(n.split("msie")[1]):!1}function l(n){var r=$(".js-preloader__percent"),t=parseInt(n.progress*100),u=$(".js-progress-indicator"),i;r.html(t);i=new TimelineMax;i.to(u,.1,{width:t+"%"})}function a(){$(".js__video_slide").each(function(n){var i=$(this),r=t.getResult(n);i.prepend(r);$(".js__home_slider").find("video").addClass("js__video_el")});f();setTimeout(function(){h()},1e3)}function h(){TweenMax.to($(".js-preloader"),.5,{opacity:0,onComplete:function(){$(".js-preloader").hide()}})}function v(){$(".js__video_slide").each(function(){var n=$(this),i=n.data("src"),t;t='<div class="no-video" style="background-image: url('+i+')"><\/div>';n.prepend(t)});f();h()}var i=$(window),c=$("header"),n=$(".js__home_slider"),r={},u=c.height(),t={};o(n,u);i.on("resize",_.throttle(function(){o(n,u)},100));$(window).on("load",function(){$(".swiper-slide-active .js__video_el").trigger("play");e()});if(window.isIEOld=s()&&s()<9,i.width()>599){if(!isIEOld){t=new createjs.LoadQueue(!0);t.installPlugin(createjs.Video);t.on("progress",l,this);t.on("complete",a,this);t.loadManifest(videoManifest)}}else v()})