(function(B,A){jQuerywindow=B(A);B.fn.lazyload=function(C){var E=this;var D={threshold:0,failure_limit:0,event:"scroll",effect:"fadeIn",container:A,data_attribute:"original",skip_invisible:true,appear:null,load:null};function F(){var G=0;E.each(function(){var H=B(this);if(D.skip_invisible&&!H.is(":visible")){return }if(B.abovethetop(this,D)||B.leftofbegin(this,D)){}else{if(!B.belowthefold(this,D)&&!B.rightoffold(this,D)){H.trigger("appear")}else{if(++G>D.failure_limit){return false}}}})}if(C){if(undefined!==C.failurelimit){C.failure_limit=C.failurelimit;delete C.failurelimit}if(undefined!==C.effectspeed){C.effect_speed=C.effectspeed;delete C.effectspeed}B.extend(D,C)}jQuerycontainer=(D.container===undefined||D.container===A)?jQuerywindow:B(D.container);if(0===D.event.indexOf("scroll")){jQuerycontainer.bind(D.event,function(G){return F()})}this.each(function(){var G=this;var H=B(G);G.loaded=false;H.one("appear",function(){if(!this.loaded){if(D.appear){var I=E.length;D.appear.call(G,I,D)}B("").bind("load",function(){H.hide().attr("src",H.data(D.data_attribute))[D.effect](D.effect_speed);G.loaded=true;var J=B.grep(E,function(L){return !L.loaded});E=B(J);if(D.load){var K=E.length;D.load.call(G,K,D)}}).attr("src",H.data(D.data_attribute))}});if(0!==D.event.indexOf("scroll")){H.bind(D.event,function(I){if(!G.loaded){H.trigger("appear")}})}});jQuerywindow.bind("resize",function(G){F()});F();return this};B.belowthefold=function(D,E){var C;if(E.container===undefined||E.container===A){C=jQuerywindow.height()+jQuerywindow.scrollTop()}else{C=jQuerycontainer.offset().top+jQuerycontainer.height()}return C<=B(D).offset().top-E.threshold};B.rightoffold=function(D,E){var C;if(E.container===undefined||E.container===A){C=jQuerywindow.width()+jQuerywindow.scrollLeft()}else{C=jQuerycontainer.offset().left+jQuerycontainer.width()}return C<=B(D).offset().left-E.threshold};B.abovethetop=function(D,E){var C;if(E.container===undefined||E.container===A){C=jQuerywindow.scrollTop()}else{C=jQuerycontainer.offset().top}return C>=B(D).offset().top+E.threshold+B(D).height()};B.leftofbegin=function(D,E){var C;if(E.container===undefined||E.container===A){C=jQuerywindow.scrollLeft()}else{C=jQuerycontainer.offset().left}return C>=B(D).offset().left+E.threshold+B(D).width()};B.inviewport=function(C,D){return !B.rightofscreen(C,D)&&!B.leftofscreen(C,D)&&!B.belowthefold(C,D)&&!B.abovethetop(C,D)};B.extend(B.expr[":"],{"below-the-fold":function(C){return B.belowthefold(C,{threshold:500,container:A})},"above-the-top":function(C){return !B.belowthefold(C,{threshold:500,container:A})},"right-of-screen":function(C){return B.rightoffold(C,{threshold:500,container:A})},"left-of-screen":function(C){return !B.rightoffold(C,{threshold:500,container:A})},"in-viewport":function(C){return !B.inviewport(C,{threshold:500,container:A})},"above-the-fold":function(C){return !B.belowthefold(C,{threshold:500,container:A})},"right-of-fold":function(C){return B.rightoffold(C,{threshold:500,container:A})},"left-of-fold":function(C){return !B.rightoffold(C,{threshold:500,container:A})}})})(jQuery,window);jQuery(function(){jQuery("img.fader").lazyload({failure_limit:50,effect:"fadeIn"})});