/*!
* parallax.js v1.5.0 (http://pixelcog.github.io/parallax.js/)
* with webp and scrolling support by paul
* @copyright 2016 PixelCog, Inc.
* @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
*/
!function(t,i,e,s){function o(e,r){var h=this;if("object"==typeof r&&(delete r.refresh,delete r.render,t.extend(this,r)),this.$element=t(e),this.$element.is("div")){var a=i.getComputedStyle(this.$element[0]).getPropertyValue("background-image");if("none"!==a&&!a.includes("rgba(")&&a){var n=a.slice(4,-1).replace(/['"]/g,"");this.imageSrc=n}}else this.$element.is("img")&&(this.imageSrc=this.$element[0].currentSrc||this.$element.attr("src"));!this.imageSrc&&this.$element.is("img")&&(this.imageSrc=this.$element.attr("src"));var l=(this.position+"").toLowerCase().match(/\S+/g)||[];if(l.length<1&&l.push("center"),1==l.length&&l.push(l[0]),"top"!=l[0]&&"bottom"!=l[0]&&"left"!=l[1]&&"right"!=l[1]||(l=[l[1],l[0]]),this.positionX!==s&&(l[0]=this.positionX.toLowerCase()),this.positionY!==s&&(l[1]=this.positionY.toLowerCase()),h.positionX=l[0],h.positionY=l[1],"left"!=this.positionX&&"right"!=this.positionX&&(isNaN(parseInt(this.positionX))?this.positionX="center":this.positionX=parseInt(this.positionX)),"top"!=this.positionY&&"bottom"!=this.positionY&&(isNaN(parseInt(this.positionY))?this.positionY="center":this.positionY=parseInt(this.positionY)),this.position=this.positionX+(isNaN(this.positionX)?"":"px")+" "+this.positionY+(isNaN(this.positionY)?"":"px"),navigator.userAgent.match(/(iPod|iPhone|iPad)/))return this.imageSrc&&this.iosFix&&!this.$element.is("img")&&this.$element.css({backgroundImage:"url("+this.imageSrc+")",backgroundSize:"cover",backgroundAttachment:"scroll",backgroundPosition:this.position}),this;if(navigator.userAgent.match(/(Android)/))return this.imageSrc&&this.androidFix&&!this.$element.is("img")&&this.$element.css({backgroundImage:"url("+this.imageSrc+")",backgroundSize:"cover",backgroundAttachment:"scroll",backgroundPosition:this.position}),this;this.$mirror=t("<div />").prependTo(this.mirrorContainer);var d=this.$element.find(">.parallax-slider"),p=!1;0==d.length?this.$slider=t("<img />").prependTo(this.$mirror):(this.$slider=d.prependTo(this.$mirror),p=!0),this.$mirror.addClass("parallax-mirror").css({visibility:"hidden",zIndex:this.zIndex,position:"fixed",top:0,left:0,overflow:"hidden"}),void 0===this.overlayColor||null===this.overlayColor||""==this.overlayColor||(this.$overlay=t("<div />").appendTo(this.$mirror),this.$overlay.addClass("parallax-overlay").css({visibility:"hidden",zIndex:this.zIndex,position:"absolute",top:0,left:0,background:this.overlayColor,clear:"float"})),this.$slider.addClass("parallax-slider").one("load",(function(){h.naturalHeight&&h.naturalWidth||(h.naturalHeight=this.naturalHeight||this.height||1,h.naturalWidth=this.naturalWidth||this.width||1),h.aspectRatio=h.naturalWidth/h.naturalHeight,o.isSetup||o.setup(),o.sliders.push(h),o.isFresh=!1,o.requestRender()})),p||(this.$slider[0].src=this.imageSrc),(this.naturalHeight&&this.naturalWidth||this.$slider[0].complete||d.length>0)&&this.$slider.trigger("load")}!function(){for(var t=0,e=["ms","moz","webkit","o"],s=0;s<e.length&&!i.requestAnimationFrame;++s)i.requestAnimationFrame=i[e[s]+"RequestAnimationFrame"],i.cancelAnimationFrame=i[e[s]+"CancelAnimationFrame"]||i[e[s]+"CancelRequestAnimationFrame"];i.requestAnimationFrame||(i.requestAnimationFrame=function(e){var s=(new Date).getTime(),o=Math.max(0,16-(s-t)),r=i.setTimeout((function(){e(s+o)}),o);return t=s+o,r}),i.cancelAnimationFrame||(i.cancelAnimationFrame=function(t){clearTimeout(t)})}(),t.extend(o.prototype,{speed:.2,bleed:0,zIndex:-100,iosFix:!0,androidFix:!0,position:"center",overScrollFix:!1,mirrorContainer:"body",refresh:function(){this.boxWidth=this.$element.outerWidth(),this.boxHeight=this.$element.outerHeight()+2*this.bleed,this.boxOffsetTop=this.$element.offset().top-this.bleed,this.boxOffsetLeft=this.$element.offset().left,this.boxOffsetBottom=this.boxOffsetTop+this.boxHeight;var t,i=o.winHeight,e=o.docHeight,s=Math.min(this.boxOffsetTop,e-i),r=Math.max(this.boxOffsetTop+this.boxHeight-i,0),h=this.boxHeight+(s-r)*(1-this.speed)|0,a=(this.boxOffsetTop-s)*(1-this.speed)|0;h*this.aspectRatio>=this.boxWidth?(this.imageWidth=h*this.aspectRatio|0,this.imageHeight=h,this.offsetBaseTop=a,t=this.imageWidth-this.boxWidth,"left"==this.positionX?this.offsetLeft=0:"right"==this.positionX?this.offsetLeft=-t:isNaN(this.positionX)?this.offsetLeft=-t/2|0:this.offsetLeft=Math.max(this.positionX,-t)):(this.imageWidth=this.boxWidth,this.imageHeight=this.boxWidth/this.aspectRatio|0,this.offsetLeft=0,t=this.imageHeight-h,"top"==this.positionY?this.offsetBaseTop=a:"bottom"==this.positionY?this.offsetBaseTop=a-t:isNaN(this.positionY)?this.offsetBaseTop=a-t/2|0:this.offsetBaseTop=a+Math.max(this.positionY,-t))},render:function(){var t=o.scrollTop,i=o.scrollLeft,e=this.overScrollFix?o.overScroll:0,s=t+o.winHeight;this.boxOffsetBottom>t&&this.boxOffsetTop<=s?(this.visibility="visible",this.mirrorTop=this.boxOffsetTop-t,this.mirrorLeft=this.boxOffsetLeft-i,this.offsetTop=this.offsetBaseTop-this.mirrorTop*(1-this.speed)):this.visibility="hidden",this.$mirror.css({transform:"translate3d("+this.mirrorLeft+"px, "+(this.mirrorTop-e)+"px, 0px)",visibility:this.visibility,height:this.boxHeight,width:this.boxWidth}),void 0!==this.$overlay&&this.$overlay.css({transform:"translate3d(0px, 0px, 0px)",visibility:this.visibility,height:"100%",width:"100%"}),this.$slider.css({transform:"translate3d("+this.offsetLeft+"px, "+this.offsetTop+"px, 0px)",position:"absolute",height:this.imageHeight,width:this.imageWidth,maxWidth:"none"})}}),t.extend(o,{scrollTop:0,scrollLeft:0,winHeight:0,winWidth:0,docHeight:1<<30,docWidth:1<<30,sliders:[],isReady:!1,isFresh:!1,isBusy:!1,setup:function(){if(!this.isReady){var s=this,r=t(e),h=t(i),a=function(){o.winHeight=h.height(),o.winWidth=h.width(),o.docHeight=r.height(),o.docWidth=r.width()},n=function(){var t=h.scrollTop(),i=o.docHeight-o.winHeight,e=o.docWidth-o.winWidth;o.scrollTop=Math.max(0,Math.min(i,t)),o.scrollLeft=Math.max(0,Math.min(e,h.scrollLeft())),o.overScroll=Math.max(t-i,Math.min(t,0))};h.on("resize.px.parallax load.px.parallax",(function(){a(),s.refresh(),o.isFresh=!1,o.requestRender()})).on("scroll.px.parallax load.px.parallax",(function(){n(),o.requestRender()})),a(),n(),this.isReady=!0;var l=-1;!function t(){if(l==i.pageYOffset)return i.requestAnimationFrame(t),!1;l=i.pageYOffset,s.render(),i.requestAnimationFrame(t)}()}},configure:function(i){"object"==typeof i&&(delete i.refresh,delete i.render,t.extend(this.prototype,i))},refresh:function(){t.each(this.sliders,(function(){this.refresh()})),this.isFresh=!0},render:function(){this.isFresh||this.refresh(),t.each(this.sliders,(function(){this.render()}))},requestRender:function(){this.render(),this.isBusy=!1},destroy:function(e){var s,r=t(e).data("px.parallax");for(r.$mirror.remove(),s=0;s<this.sliders.length;s+=1)this.sliders[s]==r&&this.sliders.splice(s,1);t(e).data("px.parallax",!1),0===this.sliders.length&&(t(i).off("scroll.px.parallax resize.px.parallax load.px.parallax"),this.isReady=!1,o.isSetup=!1)}});var r=t.fn.parallax;t.fn.parallax=function(s){return this.each((function(){var r=t(this),h="object"==typeof s&&s;this==i||this==e||r.is("body")?o.configure(h):r.data("px.parallax")?"object"==typeof s&&t.extend(r.data("px.parallax"),h):(h=t.extend({},r.data(),h),r.data("px.parallax",new o(this,h))),"string"==typeof s&&("destroy"==s?o.destroy(this):o[s]())}))},t.fn.parallax.Constructor=o,t.fn.parallax.noConflict=function(){return t.fn.parallax=r,this},t((function(){t('[data-parallax="scroll"]').parallax()}))}(jQuery,window,document);