!function($){var $window=$(window),windowHeight=$window.height();$window.resize(function(){windowHeight=$window.height()}),$.fn.parallax=function(xpos,speedFactor){function update(){var pos=$window.scrollTop();$this.each(function(){var $element=$(this),top=$element.offset().top;top+getHeight($element)<pos||top>pos+windowHeight||$this.css("backgroundPosition",xpos+" "+Math.round((firstTop-pos)*speedFactor)+"px")})}var $this=$(this),getHeight,firstTop,paddingTop=0;$this.each(function(){firstTop=$this.offset().top}),getHeight=function(jqo){return jqo.outerHeight(!0)},(arguments.length<1||null===xpos)&&(xpos="50%"),(arguments.length<2||null===speedFactor)&&(speedFactor=.1),(arguments.length<3||null===outerHeight)&&(outerHeight=!0),$window.bind("scroll",update).resize(update),update()}}(jQuery);