(function(){function h(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("msie")?parseInt(a.split("msie")[1]):!1}if(void 0==jQuery)console.log("Jquery not included!");else if(void 0==Modernizr.video)console.log("Modernizr not included!");else{var b=jQuery,k=h(),g=0,e=0;jQuery.fn.extend({ensureLoad:function(a){return this.each(function(){this.complete||4===this.readyState?a.call(this):"uninitialized"===this.readyState&&0===this.src.indexOf("data:")?(b(this).trigger("error"),a.call(this)):
(b(this).one("load",a),k&&(void 0!=this.src&&-1==this.src.indexOf("?"))&&(this.src=this.src+"?"+(new Date).getTime()))})}});video_background=function(a,f){this.hidden=!1;this.$holder=a;this.id="video_background_video_"+g;g++;this.parameters={position:"absolute","z-index":"-1",video_ratio:!1,loop:!0,autoplay:!0,muted:!1,mp4:!1,webm:!1,ogg:!1,flv:!1,youtube:!1,priority:"html5",fallback_image:!1,sizing:"fill",start:0};b.each(f,b.proxy(function(a,b){this.parameters[a]=b},this));this.$video_holder=b('
').appendTo(a).css({"z-index":this.parameters["z-index"],position:this.parameters.position,top:0,left:0,right:0,bottom:0,overflow:"hidden"});this.ismobile=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i);this.supports_flash=9";!1!==this.parameters.mp4&&(a+='');!1!==this.parameters.webm&&(a+='');
!1!==this.parameters.ogg&&(a+='');this.$video=b(a+"").css({position:"absolute"});this.$video_holder.append(this.$video);this.video=this.$video.get(0);!1!==this.parameters.video_ratio&&(this.resize_timeout=!1,b(window).resize(b.proxy(function(){clearTimeout(this.resize_timeout);this.resize_timeout=setTimeout(b.proxy(this.video_resize,this),10)},this)),this.video_resize());this.parameters.muted&&this.mute()},video_resize:function(){var a=
this.$video_holder.width(),b=this.$video_holder.height(),c=a,d=a/this.parameters.video_ratio;d').appendTo(this.$video_holder).css({position:"absolute"});this.youtube_ready=!1;if(0==e){var f=document.createElement("script");
f.src="https://www.youtube.com/iframe_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(f,c);e=1;window.onYouTubeIframeAPIReady=b.proxy(function(){a.trigger("yt_loaded");this.build_youtube();e=2},this)}else 1==e?a.bind("yt_loaded",b.proxy(this.build_youtube,this)):2==e&&this.build_youtube()},build_youtube:function(){var a={loop:this.parameters.loop?1:0,start:this.parameters.start,autoplay:this.parameters.autoplay?1:0,controls:0,showinfo:0,wmode:"transparent",iv_load_policy:3,
modestbranding:1,rel:0};this.parameters.loop&&(a.playlist=this.parameters.youtube);this.player=new YT.Player(this.id+"_yt",{height:"100%",width:"100%",playerVars:a,videoId:this.parameters.youtube,events:{onReady:b.proxy(this.youtube_ready_fun,this)}})},youtube_ready_fun:function(a){this.youtube_ready=!0;this.$video=b("#"+this.id+"_yt");!1!==this.parameters.video_ratio&&(this.resize_timeout=!1,b(window).resize(b.proxy(function(){clearTimeout(this.resize_timeout);this.resize_timeout=setTimeout(b.proxy(this.video_resize,
this),10)},this)),this.video_resize());this.parameters.muted&&this.mute()},make_flash:function(){var a={url:!1!=this.parameters.mp4?this.parameters.mp4:this.parameters.flv,loop:this.parameters.loop,autoplay:this.parameters.autoplay,muted:this.parameters.muted};this.$video_holder.append('');swfobject.embedSWF("flash/video.swf",this.id+"_flash","100%","100%","9.0",null,a,{allowfullscreen:!0,allowScriptAccess:"always",wmode:"transparent"},{name:"background-video-swf"},
b.proxy(this.flash_callback,this))},flash_callback:function(a){this.video=b(a.target).get(0);this.parameters.muted&&this.mute()},make_image:function(){!1!==this.parameters.fallback_image&&(this.$img=b('').appendTo(this.$video_holder).css({position:"absolute"}),this.$img.ensureLoad(b.proxy(this.image_loaded,this)))},image_loaded:function(){this.original_width=this.$img.width();this.original_height=this.$img.height();this.resize_timeout=!1;b(window).resize(b.proxy(function(){clearTimeout(this.resize_timeout);
this.resize_timeout=setTimeout(b.proxy(this.image_resize,this),10)},this));this.image_resize()},image_resize:function(){var a=this.$video_holder.width(),b=this.$video_holder.height(),c=a,d=this.original_height/(this.original_width/a);if("adjust"==this.parameters.sizing&&d>b||"fill"==this.parameters.sizing&&d