/** jquery.onscreenloader.js **/

(function($)
{$.fn.onscreenloader=function(options){var items=this;items.each(function()
{$(this).load(function(){$(this).parent().find('.loading').hide();});});checkPlacements(items);$(window).bind("scroll",moveViewport);$(window).bind("resize",resizeViewport);return;function resizeViewport()
{checkPlacements(items);};function moveViewport()
{checkPlacements(items);};function checkPlacements(items)
{var windowLeft=$(document).scrollLeft();var windowTop=$(document).scrollTop();var windowRight=windowLeft+$(window).width();var windowBottom=windowTop+$(window).height();return items.each(function()
{if(!$(this).attr('loaded'))
{if(((($(this).offset().left>windowLeft)&&($(this).offset().left<windowRight))||(($(this).offset().left+$(this).width()>windowLeft)&&($(this).offset().left+$(this).width()<windowRight)))&&((($(this).offset().top+$(this).height()>windowTop)&&($(this).offset().top+$(this).height()<windowBottom))||(($(this).offset().top>windowTop)&&($(this).offset().top<windowBottom))))
{if($(this).attr('original'))
{$(this).attr('src',$(this).attr('original'));}
$(this).attr('loaded','loaded');}
else if($(this).attr('src')&&!$(this).attr('original'))
{$(this).attr('original',$(this).attr('src'));$(this).attr('src','/img/empty.gif');}}});}};})(jQuery);

/** end **/
