jQuery(document).ready(function(a){function e(){function e(e){function n(){k&&(m=new Image,m.src=k,m.onload=function(){w=m.width,_=m.height,imgBlocksStructure=p?"":"
",v.append(imgBlocksStructure),f=a(".parallax-img",v),p?(f.attr("src",k),R="none"):f.css("background-image","url("+k+")"),u()})}function g(){var a=f.get(0);a.load(),a.play(),w=a.videoWidth,_=a.videoHeight,k&&(m=new Image,m.src=k,m.onload=function(){w=0==w?m.width:w,_=0==_?m.height:_,x(),t(f,s,T,w,_)}),a.onloadeddata=function(){w=a.videoWidth,_=a.videoHeight,x(),t(f,s,T,w,_)},u()}function u(){switch(notResize=!1,E=I?"parallax_invert":"parallax_normal",R){case"low":R=3;break;case"normal":R=2.25;break;case"hight":R=1.5;break;case"fixed":-1!=d||i()?"video"!=b?(H=!1,notResize=!0,f.css({backgroundAttachment:"fixed",width:"100%",height:"100%"})):(E="parallax_normal",R=2.25):(E="parallax_fixes",R=1);break;case"none":H=!1,E="parallax_none";break;default:R>10&&(R=10),1>=R&&(a.browser.msie?(H=!1,f.css({backgroundAttachment:"fixed"})):(E="parallax_fixes",R=1))}o.resize(x),x(),p||o.scroll(h)}function x(){s=l.width(),c=o.outerHeight(),A=e.height(),v.width(s),notResize||(T=r(E,A,R),t(f,s,T,w,_)),p||h()}function h(){if(H&&!p){var a,t,r;z=e.offset().top,a=l.scrollTop(),t=a+c,r=a-A,t>z&&z>r&&(y=a-z,newPositionTop=I?-parseInt(y/R)-parseInt(c/R):parseInt(y/R),f.css({transform:"translate3d(0px, "+newPositionTop+"px, 0px)"}))}}var f,m,v=e.find(".parallax-bg"),b=v.data("parallax-type"),w=0,_=0,k=v.data("img-url"),R=v.data("speed"),I=v.data("invert"),E="parallax_normal",A=e.height(),z=e.offset().top,T=0,H=!0;switch(notResize=!1,b){case"image":n();break;case"video":f=a(".parallax_media",v),p?(f.remove(),n()):g()}}function t(a,e,t,r,n){var i,r,n,o,l,s,c;i=n/r,containerRatio=t/e,containerRatio>i?(l=t,o=Math.round(l*r/n)):(o=e,l=Math.round(o*n/r)),c=.5*-(o-e),s=.5*-(l-t),a.css({width:o,height:l,marginTop:s,marginLeft:c})}function r(a,e,t){var r=0;switch(a){case"parallax_normal":r=e+parseInt((c-e)/t);break;case"parallax_invert":r=e+parseInt((c+e)/t);break;case"parallax_fixes":r=c;break;case"parallax_none":r=e}return r}function n(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent,t=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=t.exec(e)&&(a=parseFloat(RegExp.$1))}else if("Netscape"==navigator.appName){var e=navigator.userAgent,t=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");null!=t.exec(e)&&(a=parseFloat(RegExp.$1))}return a}function i(){var a=!1;return navigator.userAgent.search("Safari")>=0&&navigator.userAgent.search("Chrome")<0&&(a=!0),a}{var o=a(window),l=a(document),s=l.width(),c=o.outerHeight(),p=!1,d=n();document.documentElement}device.mobile()||device.tablet()?p=!0:(p=!1,-1!=d&&9>d&&(p=!0)),parallax_box.each(function(){e(a(this))})}parallax_box=a("section.parallax-box"),parallax_box.length>0&&e()});