function onYouTubeIframeAPIReady(){Videos.SetUp.array()}$(document).ready(function(){Videos.Init()});var Videos=function(){return{selector:"[data-video]",dataName:"video",initialWidth:480,initialHeight:270,ytApiSrc:"//www.youtube.com/iframe_api",parentEls:undefined,videos:[],Init:function(){this.SetUp.init()},SetUp:{init:function(){Videos.parentEls=$(Videos.selector).parent();Videos.parentEls.length&&Videos.SetUp.youtube()},array:function(){Videos.parentEls.each(function(n){var t=$(this),i=t.children(Videos.selector),r=$.trim(i.data(Videos.dataName));Videos.videos.push({parentEl:t,videoId:r,index:n,player:new YT.Player(i[0],{enablejsapi:1,height:Videos.initialHeight,width:Videos.initialWidth,videoId:r,origin:window.location.host,rel:0})});Videos.Ready()})},youtube:function(){var t=document.createElement("script"),n;t.src=Videos.ytApiSrc;n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}},Ready:function(){Videos.parentEls.each(function(){var n=$(this);Videos.MaintainAspectRatio(n.children("iframe").first())})},MaintainAspectRatio:function(n){var t=n.height()/n.width(),i=n.attr("width"),r=n.attr("height");n.data("aspect-ratio",t).data("width",i).data("height",r);n.removeAttr("width").removeAttr("height");Videos.SetDimensions(n);Videos.OnResize(n)},OnResize:function(n){var t=debounce(function(){Videos.SetDimensions(n)},100);$(window).resize(function(){t()})},SetDimensions:function(n){Videos.SetWidth(n);Videos.SetHeight(n)},SetWidth:function(n){n.css({width:""});var t=n.parent(),r=n.data("width"),i=t.width();n.width(i)},SetHeight:function(n){var t=n.parent().width(),i=n.data("aspect-ratio"),r=n.data("width"),u=n.data("height");n.height(t*i)}}}()