$(document).bind("ready",function(){home_carousel.init()});var home_carousel={phone:!1,$carousel:null,$slider:null,init:function(){home_carousel.$carousel=$(".home-carousel");home_carousel.$slider=home_carousel.$carousel.find(".slides");enquire.register("all and (max-width: 599px)",{match:function(){home_carousel.phone=!0}});home_carousel.$slider.bxSlider({nextText:"",prevText:"",slideSelector:".slide",adaptiveHeight:!0,auto:home_carousel.phone?!1:!0,pause:5e3,onSliderLoad:function(){home_carousel.$slider.each(function(){$(this).on("click",function(n){var t=$(n.target),s=t.hasClass(".overlay")||t.closest(".overlay").length>0,h=t.closest(".slide-video").length>0,u,o,r;if(s)return n.preventDefault(),u=t.closest(".slide").data("link"),window.location.href=u,!1;if(!s&&h){n.preventDefault();var f=t.closest(".slide-video").data("modal-link"),e=.6,i=Math.min(1200,$(window).width()-400);return f?(u=f.replace("youtu.be","www.youtube.com/embed/").replace(new RegExp("watch\\?v=","i"),"v/"),home_carousel.phone?window.location.href=f:$.fancybox({autoPlay:!0,padding:0,autoScale:!1,transitionIn:"none",transitionOut:"none",title:this.title,width:i,height:i*e,href:u,type:"iframe"})):(o=t.closest(".slide-video").find(".ooyala-video-container"),o.length>0&&(r=o.first(),r.hide(),r.css({width:i,height:i*e}),playOoyalaElement(r),$.fancybox({autoPlay:!0,padding:0,autoScale:!1,transitionIn:"none",transitionOut:"none",title:this.title,width:i,height:i*e,href:"#"+r.attr("id")}))),!1}})});setTimeout(function(){$.event.trigger({type:"home_carousel_loaded"})},300)}})}}