function ImageLoader(){this.name="image loader object";this.image_queues={};this.error_queues={};this.q_locks={};this.max_concurrent=(document.all)?1:5;this.currently_loading=[];this.pending_load=[]}ImageLoader.prototype.addToQueue=function(B,A,C){if(this.image_queues[B]==null){this.image_queues[B]=[]}if(this.error_queues[B]==null){this.error_queues[B]=[]}this.image_queues[B].push(A);this.error_queues[B].push(C)};ImageLoader.prototype.callQueue=function(A,B){if(!this.lock(A)){return false}var D;if(B){D=this.error_queues[A]}else{D=this.image_queues[A]}for(var C=0;C<D.length;C++){D[C](A)}this.unlock(A)};ImageLoader.prototype._doneLoading=function(D){this.image_queues[D]=[];this.error_queues[D]=[];var A=-1;for(var B=0;B<this.currently_loading.length;B++){if(this.currently_loading[B]==D){A=B;break}}this.currently_loading.splice(B,1);if(this.pending_load.length>0){var C=this.pending_load.shift();this._doLoad(C)}};ImageLoader.prototype.lock=function(A){if(this.q_locks[A]){return false}else{this.q_locks[A]=true;return true}};ImageLoader.prototype.unlock=function(A){this.q_locks[A]=null};ImageLoader.prototype.loadImage=function(C,A,B){this.addToQueue(C,A,B);if(this.currently_loading.length<this.max_concurrent){this._doLoad(C)}else{this.pending_load.push(C)}};ImageLoader.prototype._doLoad=function(D){this.currently_loading.push(D);var B=new Image();var C=this;B.onload=function(){C.callQueue(D);C._doneLoading(D);C=null};var A=function(){C.callQueue(D,true);C._doneLoading(D);C=null};B.onabort=A;B.onerror=A;B.src=D};var LOADER=new ImageLoader();function deferLoad(D,C,A){var B=D;$(window).load(function(){LOADER.loadImage(C,function(){$(B).fadeOut("fast",function(){$(B).attr("src",C).fadeIn("fast");if(A!=undefined&&A!=null){A(B,C)}})},function(){$(B).fadeOut("fast");B=null})})};