forked from EverexIO/Ethplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tilda-scripts-2.7.min.js
1 lines (1 loc) · 21.4 KB
/
tilda-scripts-2.7.min.js
1
window.isSearchBot=!1,function(a){if($isMobile=!1,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&($isMobile=!0),/Bot/i.test(navigator.userAgent)&&(window.isSearchBot=!0),window.isMobile=$isMobile,1==$isMobile){var b=function(){for(var g,h,i,j,k,l,b=document.body.querySelectorAll(".t-cover__carrier"),c=a(window).height(),d=0,e=0,f=b.length;e<f;e++)g=b[e],h=g.style,h.height.indexOf("vh")>-1&&(d=parseInt(h.height)/100,i=c+"px",j=a(g).parent(".t-cover"),j&&(j=j[0])&&(k=j.querySelector(".t-cover__filter"),l=j.querySelector(".t-cover__wrapper"),k&&(k.style.height=i),l&&(l.style.height=i),h.height=j.style.height=i));for(var g,h,i,j,k,l,m=document.body.querySelectorAll("[data-height-correct-vh]"),c=a(window).height(),d=0,e=0,f=m.length;e<f;e++)g=m[e],h=g.style,h.height.indexOf("vh")>-1&&(d=parseInt(h.height)/100,i=c+"px",j=a(g).parent(".t-cover"),h.height=i)};a(document).ready(function(){b()}),a(window).load(function(){b()})}1==$isMobile&&(a(window).width()<480?(a(document).ready(function(){a("div[data-customstyle=yes]").each(function(b){a(this).css("font-size").replace("px","")>26&&(a(this).css("font-size",""),a(this).css("line-height",""))}),a("[field]").find("span").each(function(b){a(this).css("font-size").replace("px","")>26&&a(this).css("font-size","")})}),a(window).load(function(){var b=a(window).width();a(".r").each(function(){var c=a(this);a(this).find("div").not("[data-auto-correct-mobile-width=false], .tn-elem, .tn-atom").each(function(){var d=parseInt(a(this).outerWidth(!0));d>b&&(console.log("Block not optimized for mobile width. Block width:"+d+" Block id:"+c.attr("id")),console.log(a(this)),c.css("overflow","auto"),d-3>b&&c.css("word-break","break-all"))})})})):a(window).width()<900&&a(document).ready(function(){a("div[data-customstyle=yes]").each(function(b){a(this).css("font-size").replace("px","")>30&&(a(this).css("font-size",""),a(this).css("line-height",""))}),a("[field]").find("span").each(function(b){a(this).css("font-size").replace("px","")>30&&a(this).css("font-size","")})}))}(jQuery),function(a){function b(){this.setScrollListener()}b.prototype.videoTags=[],b.prototype.defaultConfig={isNeedStop:!1},b.prototype.videoConfigs=[],b.prototype.registerNewVideo=function(a,b){if(!(a instanceof HTMLVideoElement))throw new Error("Wrong tag passed into registerNewVideo");return this.videoTags.indexOf(a)==-1&&(this.videoTags.push(a),this.videoConfigs.push("undefined"==typeof b?this.defaultConfig:b),this.scrollCb(),!0)},b.prototype.unergisterVideo=function(a){if(!(a instanceof HTMLVideoElement))throw new Error("Wrong tag passed into unregisterNewVideo");var b;return(b=this.videoTags.indexOf(a))>-1&&("function"==typeof a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a),this.pauseVideo(a,this.videoConfigs[b]),this.videoTags.splice(b,1),this.videoConfigs.splice(b,1),!0)},b.prototype.pauseVideo=function(a,b){if(!b)throw new Error("Wrong config type!");a.pause(),b.isNeedStop&&a.load()},b.prototype.setScrollListener=function(){a(window).scroll(jQuery.proxy(this.scrollCb,this))},b.prototype.scrollCb=function(){for(var b=a(window).height(),d=null,e=0,f=this.videoTags.length;e<f;e++){if(d=this.videoTags[e],_vrect=this.getVideoBoundingRect(d,!1),Math.abs(_vrect.top)<b&&Math.abs(_vrect.top)>b/2){var g=1-(Math.abs(_vrect.top)-b/2)/(b/2)-.2;g>0&&g<=1&&0!=d.volume&&(d.volume=g)}Math.abs(_vrect.top)>b||0==_vrect.height?this.pauseVideo(d,this.videoConfigs[e]):d.paused&&d.play()}},b.prototype.getVideoObject=function(a){for(var b=0,c=this.videoTags.length;b>c;b++){var d=this.videoTags[b];if(d.v===a)return d}return null},b.prototype.getVideoBoundingRect=function(b,c){"undefined"==typeof c&&(c=!0);var d=null;return c?(d=a(b).parents(".r")[0],d||(d=b)):d=b,d.getBoundingClientRect()},window.videoLoadProcessor=new b}(jQuery),function(a){function b(){this.setScrollCb(),this.itemHeight=screen.availHeight;var b=.25;this.itemTransitionTop=this.itemHeight*b,this.activeItemIndex=null,this.windowHeight=document.documentElement.clientHeight||window.innerHeight||screen.availHeight,this.topOffsetShift=-150,a(window).resize(jQuery.proxy(this.recalculateAllSequencesOffsets,this)),this._resizeInterval=setInterval(jQuery.proxy(this.scrollCb,this),500)}function c(b){var c=a("#rec"+b),d=c.find(".t-cover").height(),e=c.find("div[data-hook-content]").height();if(e>300&&d<e){var e=e+100;c.find(".t-cover").height(e),c.find(".t-cover__filter").height(e),c.find(".t-cover__carrier").height(e),c.find(".t-cover__wrapper").height(e),0==$isMobile&&setTimeout(function(){var a=c.find(".t-cover__carrier");a.find("iframe").length>0&&(console.log("correct video from cover_fixcontentheight"),i(a,e+"px"))},2e3)}}function d(a,b){a.indexOf("https://www.youtube.com/embed")==-1&&(a="https://www.youtube.com/embed"+("/"==a[0]?a:"/"+a));var c=function(a){for(var b=a.split("/"),c=null,d=0,e=b.length;d<e;d++)"embed"==b[d]&&(c=b[d+1]);return c},d=location.protocol+"//"+location.host;return a="yes"!=b?("/"==a[a.length-1]?a:a)+"?autoplay=1&loop=1&enablejsapi=1&&playerapiid=featuredytplayer&controls=0&modestbranding=1&rel=0&showinfo=0&color=white&iv_load_policy=3&theme=light&wmode=transparent&origin="+d+"&playlist="+c(a):("/"==a[a.length-1]?a:a)+"?autoplay=0&loop=0&enablejsapi=1&&playerapiid=featuredytplayer&controls=1&modestbranding=1&rel=0&showinfo=0&color=black&iv_load_policy=3&theme=dark&wmode=transparent&origin="+d}function e(b,c,d){var e,g=a(window),h=a(b),i=0;g.scroll(function(){e&&(window.clearTimeout(e),i>=15&&(f(h,g,c,d),i=0),i++),e=window.setTimeout(function(){f(h,g,c,d),i=0},100)}),g.scroll()}function f(a,b,c,d){var e,f,g,h,i;e=a.offset().top,f=a.height(),g=b.scrollTop(),h=b.height(),i=c.getPlayerState(),g+h>e&&g<=e+f?(1!==i&&c.playVideo(),"yes"==d&&(g>e+f-100?c.setVolume(30):g>e+f-200?c.setVolume(70):g+h<e+200?c.setVolume(30):c.setVolume(100))):g+h<e&&g+h>e-500?2!==i&&(c.playVideo(),c.pauseVideo()):g>e+f&&g<e+f+500?2!==i&&c.pauseVideo():2!==i&&c.pauseVideo()}function h(){if("yes"!==window.loadytapi_flag){window.loadytapi_flag="yes";var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}}function i(b,c){console.log("setWidthHeightYoutubeVideo:"+c);var d=b.find("iframe"),e=b.attr("data-content-video-nocover"),f=b.attr("data-content-video-noadcut-youtube"),g=b.attr("data-content-video-ratio"),h=.5625;if(g>0&&(h=1*parseFloat(g)),"yes"!=e){if(c||(c="100vh"),c.indexOf("vh")>-1){var i=window.innerHeight;i||(i=a(window).height());var j=Math.floor(i*(parseInt(c)/100))}else var j=parseInt(c);var k=Math.floor(parseInt(window.innerWidth));k||(k=a(window).width());var l=k,m=l*h,n=l,o=m,p=m,q=1;if("yes"==f||(o=o+110+110,p=m-220),p<j)if(m<j)var q=j/m+.02;else var q=m/j+.02;var r=Math.floor(n*q),s=Math.floor(o*q),t=s-j,u=r-k;d.height(s+"px"),d.width(r+"px"),t>0&&d.css("margin-top",-Math.floor(t/2)+"px"),u>0&&d.css("margin-left",-Math.floor(u/2)+"px")}else{var m;c||(m=Math.floor(b.width()*h)),c&&c.indexOf("vh")>-1?m=Math.floor(window.innerHeight*(parseInt(c)/100)):c&&(m=parseInt(c)),d.css("width","100%"),d.height(m+"px")}}b.prototype.defaultConfig={orientation:"vertical",speedFactor:1,automated:!1},b.prototype.sequenceObjects=[],b.prototype.recalculateAllSequencesOffsets=function(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeInterval&&clearInterval(this._resizeInterval),this._resizeTimeout=setTimeout(jQuery.proxy(function(){this.scrollCb(),this._resizeInterval=setInterval(jQuery.proxy(this.scrollCb,this),500)},this),10)},b.prototype.registerNewBlock=function(a){if(!(a instanceof HTMLElement))throw new Error("Wrong node type in registerNewBlock");for(var b=0,c=this.sequenceObjects.length;b<c;b++)if(this.sequenceObjects[b].sequenceBlock===a)return!1;var d=a.querySelector('[data-hook="sequence-holder"]'),e=0,f=this.getAbsoluteTopOffset(d),g=function(){var b=Array.prototype.slice.call(a.querySelectorAll('[data-hook="sequence-item"]'),0),c=[];return b.forEach(jQuery.proxy(function(a,b,d){var f=this.getItemHeight(a),g=a.querySelector('[data-hook="item-background"]');a.style.height=f+"px",g.style.height=this.itemHeight+"px",b<d.length-1&&(e+=f),c.push({node:a,height:f,topOffset:this.getAbsoluteTopOffset(a.querySelector(".txt-holder"))-(b==d.length-1?0:this.topOffsetShift),backgroundHolder:g})},this)),c}.call(this),i=(this.itemHeight,{sequenceBlock:a,sequenceHolder:d,sequenceHolderTopOffset:f,sequenceHeight:e,items:g,started:!1,prevBackgroundColor:""});return this.sequenceObjects.push(i),this.scrollCb(),!0},b.prototype.getItemHeight=function(a){var b=a.querySelector("[data-hook='item-text']");a.querySelector("[data-hook='item-background']");st=a.style;var d=parseFloat(getComputedStyle(b).top);b.style.top=d+"px";var e=Math.max(b.clientHeight+d,this.itemHeight);return e},b.prototype.fixTextBlocksPosition=function(a){txtBlocks=Array.prototype.slice.call(a.querySelectorAll('[data-hook="item-text"]'),0),txtBlocks.forEach(function(a,b,c){var d=a.parentNode.querySelector("[data-hook='item-background']");d.style.top="-"+a.clientHeight+"px"})},b.prototype.unergisterBlock=function(a){for(var b=0,c=this.sequenceObjects.length,d=null;b<c;b++)if(this.sequenceObjects[b].sequenceBlock===a){d=b;break}return null!==d&&(this.sequenceObjects.splice(d,1),!0)},b.prototype.getAbsoluteTopOffset=function(a){var b=a.offsetTop;for(a=a.offsetParent;null!=a;)b+=a.offsetTop,a=a.offsetParent;return b},b.prototype.processSequence=function(a){0==a.started&&(a.prevBackgroundColor=document.body.style.backgroundColor,document.body.style.backgroundColor="rgb(0, 0, 0)",a.started=!0);for(var f,h,j,m,n,d=(a.sequenceBlock,a.sequenceHolder,a.items),e=null,k=0,l=d.length;k<l;k++)if(f=d[k].node,n=f.querySelector(".txt-holder"),m=f.getBoundingClientRect(),m.top<this.itemTransitionTop&&m.bottom<m.height+this.itemTransitionTop&&m.bottom>this.itemTransitionTop){e=k;break}if(null!=e){j=m.top/this.itemTransitionTop,j>1?j=1:j<0&&(j=0);for(var k=0,l=d.length;k<l;k++)f=d[k].node,h=d[k].backgroundHolder.style,"fixed"!=h.position&&(h.position="fixed"),k==e?(h.opacity=1-j,f.querySelector(".txt-holder").style.opacity=1-j):k==e-1?(h.opacity=j,f.querySelector(".txt-holder").style.opacity=j):(h.opacity=0,f.querySelector(".txt-holder").style.opacity=0)}},b.prototype.stopSequence=function(a){0!=a.started&&(a.items.forEach(function(a,b,c){a.backgroundHolder.style.position="relative",a.backgroundHolder.style.display="block",a.backgroundHolder.style.opacity=1}),document.body.style.backgroundColor=a.prevBackgroundColor,a.started=!1)},b.prototype.scrollCb=function(){for(var e,c=(a(window).scrollTop(),0),d=this.sequenceObjects.length;c<d;c++){e=this.sequenceObjects[c];var g=e.sequenceHolder.getBoundingClientRect();g.top<0&&g.bottom>0&&g.bottom>g.height-e.sequenceHeight-100?this.processSequence(e):this.stopSequence(e)}},b.prototype.setScrollCb=function(){this._scrollCb=jQuery.proxy(this.scrollCb,this),a(window).scroll(this._scrollCb)},window.sequenceController=new b,window.processVideo=function(b){mp4Src=a(b).attr("data-content-video-url-mp4"),webmSrc=a(b).attr("data-content-video-url-webm"),a(b).css("background-color","transparent"),a(b).css("background-image","");var c={mp4:mp4Src,webm:webmSrc,preload:"none",autoplay:!1,loop:!0,scale:!0,zIndex:0,width:"100%"};vid=a(b).videoBG(c),videoLoadProcessor.registerNewVideo(vid,{isNeedStop:!1})},window.cover_init=function(b){a(document).ready(function(){var d=document.body.querySelector("#coverCarry"+b),e=a(d),f=e.attr("data-content-cover-bg"),g=e.attr("data-content-cover-height"),h=e.attr("data-content-cover-parallax"),i=e.attr("data-content-video-url-mp4"),j=e.attr("data-content-video-url-webm"),k=e.attr("data-content-video-url-youtube"),l=e.attr("data-content-video-noloop"),m=e.attr("data-content-video-nomute"),n=e.attr("data-content-bg-base64"),o=e.attr("data-content-video-nocover");f||(f=""),g||(g=""),h||(h=""),i||(i=""),j||(j=""),k||(k=""),l||(l=""),m||(m=""),k||(k=""),n||(n=""),o&&"yes"==o&&(i="",j="",k=""),!$isMobile||""==j&&""==i&&""==k||e.css("background-image","url('"+f+"')"),c(b);var p=a("#rec"+b).find("img[data-hook-clogo]");if(p.length&&p.load(function(){c(b)}),(""!==i||""!==j||""!==k)&&0==$isMobile)if(""!=k||""==i&&""==j){if(""!=k){e.css("background-color","#000000"),e.css("background-image","");var t,u=0,v=a(window);v.scroll(function(){t&&window.clearTimeout(t),t=window.setTimeout(function(){if(u=e.find("iframe").length,!(u>0)){var a,b,c,f;a=e.offset().top,b=e.height(),c=v.scrollTop(),f=v.height(),c+f>a-500&&c<=a+b+500&&processYoutubeVideo(d,g)}},100)}),v.scroll()}}else{if(e.css("background-color","#000000"),e.css("background-image","url('https://tilda.ws/img/spinner-white.gif')"),e.css("background-size","auto"),""!=l)var q=!1;else var q=!0;if(""!=m)var r=1;else var r="";var s="";"fixed"==h&&(g.indexOf("vh")>-1&&parseInt(g)>100&&(e.css("height","100vh"),s="yes"),g.indexOf("px")>-1&&parseInt(g)>a(window).height()&&(e.css("height","100vh"),s="yes"));var t,u="",v=a(window),w=e.parent();v.scroll(function(){if(t&&window.clearTimeout(t),t=window.setTimeout(function(){if(!(u>0)){var a,b,c,d;if(a=e.offset().top,b=e.height(),c=v.scrollTop(),d=v.height(),c+d>a-500&&c<=a+b+500){var g=e.videoBG({mp4:i,webm:j,poster:"",preload:"none",autoplay:!1,loop:q,volume:r,scale:!0,zIndex:0,width:"100%"});videoLoadProcessor.registerNewVideo(g),u=1}}},100),"fixed"==h&&"yes"==s){var a,b,c,d;a=w.offset().top,b=w.height(),c=v.scrollTop(),d=v.height(),c>=a+b-d?(e.css("position","absolute"),e.css("bottom","0px"),e.css("top","auto")):c>=a?(e.css("position","fixed"),e.css("top","0px")):c<a&&(e.css("position","relative"),e.css("top","auto"))}}),v.scroll()}if("dynamic"==h&&0==$isMobile&&e.parallax("50%",.2,!0),"yes"==n&&""!=f&&""==i&&""==j&&""==k){var x="";a("<img/>").attr("src",f).load(function(){a(this).remove(),e.css("background-image","url('"+f+"')"),e.css("opacity","1")}),"yes"!=x&&(e.css("background-image",""),e.css("opacity","0"),e.css("transition","opacity 25ms"))}var y=a("#rec"+b).find(".t-cover__arrow-wrapper");y.length>0&&y.click(function(){var c=a("#rec"+b).height();c>0&&a("html, body").animate({scrollTop:a("#rec"+b).offset().top+c},500)})})},a(document).ready(function(){a(".t-cover__carrier").each(function(){var b=a(this).attr("data-content-cover-id");b>0&&cover_init(b)})});var g=a.Deferred();window.processYoutubeVideo=function(b,c){h();var f=function(){var f=a(b),g=f.attr("data-content-video-url-youtube"),h=f.attr("data-content-video-nomute"),j=f.attr("data-content-video-noloop"),k=f.attr("data-content-video-nocover"),l=document.createElement("iframe");l.src=d(g,k),l.frameBorder=0;var m;if(b.appendChild(l),0==$isMobile){new YT.Player(l,{events:{onReady:function(a){e(b,a.target,h),a.target.setVolume&&"yes"!=h&&a.target.setVolume(0),a.target.setLoop(!0)},onStateChange:function(b){if(b.target.setVolume&&"yes"!=h&&b.target.setVolume(0),b.data===-1){var c=window.fix_scrolltop_beforestop_youtube;c>=0&&(a("html, body").scrollTop(c),delete window.fix_scrolltop_beforestop_youtube)}b.data===YT.PlayerState.PLAYING?m=window.setInterval(function(){var a=b.target.getCurrentTime(),c=b.target.getDuration();a+1>c&&0!==c&&(b.target.seekTo(0),"yes"===j&&(b.target.stopVideo(),b.target.clearVideo()))},1e3):window.clearTimeout(m)}}})}i(f,c)};g.then(f)},window.onYouTubeIframeAPIReady=function(){g.resolve()}}(jQuery),function(a){function b(){this.callbacks={}}b.prototype.defaultConfig={single:!1,context:null},b.prototype.addEventListener=function(a,b,c){evtCallbacks=this._getEventCallbacks(a),evtCallbacks||(evtCallbacks=this.callbacks[a]=[]),evtCallbacks.push({callback:b,config:"object"==typeof c?c:this.defaultConfig})},b.prototype._getEventCallbacks=function(a){return this.callbacks[a]},b.prototype.removeEventListener=function(a,b){var c=this._getEventCallbacks(a);if(!c)return!1;for(var f,d=0,e=c.length;d<e;d++)if(f=c[d],b===f.callback)return c.splice(d,1),!0;return!1},b.prototype.emitEvent=function(a,b){var c=[];extend(c,this._getEventCallbacks(a));for(var f,g,h,d=0,e=c.length;d<e;d++)f=c[d],g=f.callback,h=f.config,h.context?g.call(h.context,b):g(b),h.single&&this.removeEventListener(a,g)},window.observer=new b}(jQuery),function(c){c(document).ready(function(){function f(){if(d.length)for(var b,g,h,a=d.length-1;a>=0;a--)b=c(d[a]),g=b.offset().top,h=e.scrollTop()+e.height()-100,g<h&&(b.fadeTo(500,1,function(){}),d.splice(a,1));else e.unbind("scroll",f)}if(0==$isMobile&&"yes"!==c("#allrecords").attr("data-blocks-animationoff")&&0==window.isSearchBot){c(".r").each(function(a){c(this).attr("style")&&c(this).attr("style").indexOf("background-color")!==-1&&c(this).attr("data-animationappear","off")});var d=c(".r").not("[data-animationappear=off], [data-screen-min], [data-screen-max]"),e=c(window);d.each(function(d){a=c(this).offset().top,b=e.scrollTop()+e.height()+300,a>1e3&&a>b&&c(this).fadeTo(0,0)}),e.scroll(f),f()}c("body").height()<c(window).height()-100&&c(".t-tildalabel").css("display","none")})}(jQuery),function(a){function b(){var d,e,f,b=a(window).width(),c=a("div.r[data-screen-max], div.r[data-screen-min]");c.each(function(c){f=a(this).css("display"),d=a(this).attr("data-screen-max"),void 0===d&&(d=1e4),d=parseInt(d),e=a(this).attr("data-screen-min"),void 0===e&&(e=0),e=parseInt(e),e<=d&&(b<=d&&b>e?"block"!=f&&a(this).css("display","block"):"none"!=f&&a(this).css("display","none"))})}a(document).ready(function(){b()}),a(window).resize(function(){b()})}(jQuery),function(a){a.fn.videoBG=function(b,c){var c={};if("object"==typeof b)c=a.extend({},a.fn.videoBG.defaults,b);else{if(b)return a(b).videoBG(c);c=a.fn.videoBG.defaults}var d=a(this);if(d.length){"static"!=d.css("position")&&d.css("position")||d.css("position","relative"),0==c.width&&(c.width=d.width()),0==c.height&&(c.height=d.height());var e=a.fn.videoBG.wrapper();e.height(c.height).width(c.width),c.textReplacement?(c.scale=!0,d.width(c.width).height(c.height).css("text-indent","-9999px")):e.css("z-index",c.zIndex+1);var f=a.fn.videoBG.video(c);return c.scale&&(e.height(c.height).width(c.width),f.height(c.height).width(c.width)),d.html(e),d.append(f),f.find("video")[0]}},a.fn.videoBG.setFullscreen=function(b){var c=a(window).width(),d=a(window).height();if(b.css("min-height",0).css("min-width",0),b.parent().width(c).height(d),c/d>b.aspectRatio){b.width(c).height("auto");var e=b.height(),f=(e-d)/2;f<0&&(f=0),b.css("top",-f)}else{b.width("auto").height(d);var g=b.width(),f=(g-c)/2;if(f<0&&(f=0),b.css("left",-f),0===f){setTimeout(function(){a.fn.videoBG.setFullscreen(b)},500)}}a("body > .videoBG_wrapper").width(c).height(d)},a.fn.videoBG.video=function(b){var c=a("<div/>");c.addClass("videoBG").css("position",b.position).css("z-index",b.zIndex).css("top",0).css("left",0).css("height",b.height).css("width",b.width).css("opacity",b.opacity).css("overflow","hidden");var d=a("<video/>");if(d.css("position","absolute").css("z-index",b.zIndex).attr("poster",b.poster).css("top",0).css("left",0).css("min-width","100%").css("min-height","100%"),b.autoplay&&d.attr("autoplay",b.autoplay),b.volume>0?d.prop("volume",b.volume):d.prop("volume",0),b.fullscreen){d.bind("canplay",function(){d.aspectRatio=d.width()/d.height(),a.fn.videoBG.setFullscreen(d)});var e;a(window).resize(function(){clearTimeout(e),e=setTimeout(function(){a.fn.videoBG.setFullscreen(d)},100)}),a.fn.videoBG.setFullscreen(d)}var f=d[0];b.loop&&(loops_left=b.loop,d.bind("ended",function(){loops_left&&f.play(),loops_left!==!0&&loops_left--})),d.bind("canplay",function(){b.autoplay&&f.play()}),a.fn.videoBG.supportsVideo()&&(a.fn.videoBG.supportType("webm")&&""!=b.webm?d.attr("src",b.webm):a.fn.videoBG.supportType("mp4")&&""!=b.mp4?d.attr("src",b.mp4):d.attr("src",b.ogv));var g=a("<img/>");return g.attr("src",b.poster).css("position","absolute").css("z-index",b.zIndex).css("top",0).css("left",0).css("min-width","100%").css("min-height","100%"),a.fn.videoBG.supportsVideo()?c.html(d):c.html(g),b.textReplacement&&(c.css("min-height",1).css("min-width",1),d.css("min-height",1).css("min-width",1),g.css("min-height",1).css("min-width",1),c.height(b.height).width(b.width),d.height(b.height).width(b.width),g.height(b.height).width(b.width)),a.fn.videoBG.supportsVideo(),c},a.fn.videoBG.supportsVideo=function(){return document.createElement("video").canPlayType},a.fn.videoBG.supportType=function(b){if(!a.fn.videoBG.supportsVideo())return!1;var c=document.createElement("video");switch(b){case"webm":return c.canPlayType('video/webm; codecs="vp8, vorbis"');case"mp4":return c.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');case"ogv":return c.canPlayType('video/ogg; codecs="theora, vorbis"')}return!1},a.fn.videoBG.wrapper=function(){var b=a("<div/>");return b.addClass("videoBG_wrapper").css("position","absolute").css("top",0).css("left",0),b},a.fn.videoBG.defaults={mp4:"",ogv:"",webm:"",poster:"",autoplay:!0,loop:!0,scale:!1,position:"absolute",opacity:1,textReplacement:!1,zIndex:0,width:0,height:0,fullscreen:!1,imgFallback:!0}}(jQuery),function(a){var b=a(window),c=b.height();b.resize(function(){c=b.height()}),a.fn.parallax=function(d,e,f){function l(){var d=b.scrollTop();g.each(function(){var b=a(this),f=b.offset().top,g=h(b),i=this.getBoundingClientRect();if(!(f+g<d||f>d+c)){var j=-1*Math.round(i.top*e);k?this.style["-webkit-transform"]="translateY("+j+"px)":this.style.top=j+"px"}})}var h,i,g=a(this),k="undefined"!=typeof document.body.style["-webkit-transform"];k&&g.css("position","relative"),window.correctFirstTop4Parallax=function(){g.each(function(){i=g.offset().top})},window.correctFirstTop4Parallax(),h=f?function(a){return a.outerHeight(!0)}:function(a){return a.height()},(arguments.length<1||null===d)&&(d="50%"),(arguments.length<2||null===e)&&(e=.1),(arguments.length<3||null===f)&&(f=!0),a(window).resize(window.correctFirstTop4Parallax),b.bind("scroll",l).resize(l),"complete"!==document.readyState?window.addEventListener("load",function(){l()}):l()}}(jQuery);