function onYouTubeIframeAPIReady(){var e=($(".video").length,!1);$(".video").each(function(t){var o=this;new YT.Player($(this)[0],{videoId:$(this).data("id"),events:{onReady:function(t){var a=setInterval(function(){var i=t.target.getCurrentTime(),r=t.target.getDuration(),n=i/r*100;!e&&$(o).data("ruTrigger")&&r-i<=$(o).data("ruTriggerTime")&&(e=!0,ru.videoTriggerModal(o)),n>=90&&(ga("send","event","Videos","watched until 90%",t.target.getVideoData().title),clearInterval(a))},5e3)},onStateChange:function(e){e.data==YT.PlayerState.ENDED?ga("send","event","Videos","finished video",e.target.getVideoData().title):e.data==YT.PlayerState.PLAYING&&ga("send","event","Videos","play",e.target.getVideoData().title)}}})})}actionkit.forms.contextRoot="/context/",actionkit.forms.initPage(),actionkit.sharing.initShareTools(),actionkit.forms.initForm("act");var ru=ru||{};ru.removePop=function(e){$(".pop-background").removeClass("active").css("height","auto"),$(this).removeClass("pop post-pop").parent().removeClass("pop-parent").css("height",ru.savedHeight),$(".button.pop").remove(),$("html").removeClass("scroll-lock"),window.innerWidth<480&&$("body").animate({scrollTop:ru.savedY-$("#main-nav-header").height()-15},0)},ru.pop=function(e){e.addClass("pre-pop").parent().addClass("pre-pop-parent"),e.click(function(t){if(!e.hasClass("pop")){var o=this,a=$("#main-nav-header").height()+("none"==$(".bottom-button").css("display"))?10:$(".bottom-button").height(),i=$(window).height()-a;ru.savedHeight=$(t.target).outerHeight(!0)+32,$(t.target).parent().addClass("pop-parent").css("height",i),ru.savedY=$(t.target).parent().offset().top,$(t.target).addClass("pop").before(''),window.innerWidth<480&&$("body").animate({scrollTop:$(o).offset().top-$("#main-nav-header").height()},1500,"swing",function(e){$(o).addClass("post-pop")}),$("html").addClass("scroll-lock"),$(".pop-background").addClass("active").height($(document).height()),$(".hide-modal, .pop, .pop-background.active").one("click",$.proxy(ru.removePop,o)),$(window).on("keydown",function(e){27===e.which&&($(window).off(),$.proxy(ru.removePop,o)(e))})}})},ru.videoTriggerModal=function(e){$(".pop-background").addClass("active").css("display","block").height($(document).height()),$(".video-trigger-modal").slideDown(),$(".video-trigger-modal .button.close").one("click",ru.closeVideoTriggerModal),$(window).one("scroll",ru.closeVideoTriggerModal),$(window).on("keydown",function(e){27===e.which&&($(window).off(),ru.closeVideoTriggerModal())})},ru.closeVideoTriggerModal=function(e){$(".video-trigger-modal").hide(),$(".pop-background").removeClass("active").css("display","none")};var tag=document.createElement("script");tag.src="proxy.php?url=https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);