(function($){$.fn.lazyLoad=function(options){var defaults={loadImg:'/images/anims/loading.gif'};var options=$.extend(defaults,options);$(this).each(function(){$('body').prepend('<div class="lazy-window-top" style="position:fixed; background-color:transparent; opacity:0; height:1px; width:100%; top:1px; margin:0 auto;"></div>');$('body').append('<div class="lazy-window-bottom" style="position:fixed; background-color:transparent; opacity:0; height:1px; width:100%; bottom:1px; margin:0 auto;"></div>');var allImages=$(this).find('img');allImages.each(function(){var imageSRC=$(this).attr("src");var imageREL=$(this).attr("rel");if(imageSRC!=""){$(this).attr("rel",imageSRC)}$(this).prop("src",options.loadImg)});checkPos();$(window).scroll(function(e){checkPos()});function checkPos(){var windowTopOffset=$('.lazy-window-top').offset();var windowTopHeight=$('.lazy-window-top').height();var windowTop=parseInt(windowTopHeight+windowTopOffset.top);var windowBottomOffset=$('.lazy-window-bottom').offset();var windowBottomHeight=$('.lazy-window-bottom').height();var windowBottom=parseInt(windowBottomHeight+windowBottomOffset.top);allImages.each(function(){var imageOffset1=$(this).offset();var imageHeight=$(this).height();var imageBottom=parseInt(imageOffset1.top+imageHeight);if(imageOffset1.top<windowBottom&&imageBottom>windowTop){imageSRC1=$(this).attr("rel");$(this).attr("src",imageSRC1)}})}})}})(jQuery);
