var sowb=window.sowb||{};sowb.SiteOriginSlider=function(a){return{playSlideVideo:function(e){a(e).find("video").each(function(){void 0!==this.play&&this.play()})},pauseSlideVideo:function(e){a(e).find("video").each(function(){void 0!==this.pause&&this.pause()})},setupActiveSlide:function(e,i,t){var s=a(e).find(".cycle-sentinel"),n=a(i),o=n.find("video.sow-background-element");if(void 0===t?s.css("height",n.outerHeight()):s.animate({height:n.outerHeight()},t),o.length){var d=n.outerWidth()/n.outerHeight();o.outerWidth()/o.outerHeight() li").removeClass("sow-active").eq(i.slideNum-1).addClass("sow-active"),u.pauseSlideVideo(t),u.setupActiveSlide(o,s,i.speed),w(s).trigger("sowSlideCycleBefore")},"cycle-initialized":function(e,i){u.playSlideVideo(w(this).find(".cycle-slide-active")),u.setupActiveSlide(n,i.slides[0]),d.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),w(this).find(".cycle-slide-active").trigger("sowSlideInitial"),i.slideCount<=1&&(d.hide(),a.hide()),w(window).resize(),setTimeout(function(){t(),u.setupActiveSlide(n,i.slides[0]),n.find(".cycle-sentinel").empty()},200)}}).cycle({slides:"> .sow-slider-image",speed:c.speed,timeout:c.timeout,swipe:c.swipe,"swipe-fx":"scrollHorz",log:!1}),n.find("video.sow-background-element").on("loadeddata",function(){u.setupActiveSlide(n,n.find(".cycle-slide-active"))}),d.add(a).hide(),1 li > a").click(function(e){e.preventDefault(),n.cycle("goto",w(this).data("goto"))}),a.find("> a").click(function(e){e.preventDefault(),n.cycle(w(this).data("action"))}),o.keydown(function(e){37===e.which?n.cycle("prev"):39===e.which&&n.cycle("next")})}},e=n.find("img"),i=0,t=!1;e.each(function(){w(this);this.complete?i++:w(this).one("load",function(){++i!==e.length||t||(r(),t=!0)}).attr("src",w(this).attr("src")),i!==e.length||t||(r(),t=!0)}),0===e.length&&r(),n.data("initialized",!0)})},sowb.setupSliders(),w(sowb).on("setup_widgets",sowb.setupSliders)}),window.sowb=sowb;