!function(n){var t=n(window),o=t.height();t.on("resize",(function(){o=t.height()})),n.fn.parallax=function(e,i,r){var u,h,l=n(this);function c(){var r=t.scrollTop();l.each((function(){var t=n(this),c=t.offset().top;c+u(t)<r||c>r+o||l.css("backgroundPosition",e+" "+Math.round((h-r)*i)+"px")}))}l.each((function(){h=l.offset().top})),u=r?function(n){return n.outerHeight(!0)}:function(n){return n.height()},(arguments.length<1||null===e)&&(e="50%"),(arguments.length<2||null===i)&&(i=.1),(arguments.length<3||null===r)&&(r=!0),t.on("scroll",c).on("resize",c),c()}}(jQuery);