jQuery.fn.imageLoader=function(k,c){var b=$.extend({},$.fn.imageLoader.defaults,k);var d=1;var a=this;var j=[];var e=(typeof b.images[0]=="object")?true:false;g();for(var f=0;f<b.images.length;f++){j["img"+f]=new Image();$(j["img"+f]).load(function(){if(b.hideImages){$(this).hide()}$(a).append(this);h()}).attr((e?b.images[f]:{src:b.images[f]}))}return $(this);function h(){d++;if((b.images.length+1)==d){if(b.endableSplashScreen){$("#imageLoaderSplashArea").remove()}if(typeof c=="function"){c.call()}}else{if(b.endableSplashScreen&&b.enableSplashScreenText){$("#imageLoaderSplashArea p.loadingText").html("Loading "+d+" of "+b.images.length)}}}function g(){if(b.endableSplashScreen){var i='<div id="imageLoaderSplashArea">'+((b.enableSplashScreenImage)?'<img src="'+b.splashScreenImage+'" class="splashScreenImage" />':"")+((b.enableSplashScreenText)?'<p class="loadingText">Loading '+d+" of "+b.images.length+"</p>":"")+"</div>";$(a).append(i)}}};jQuery.fn.imageLoader.defaults={images:[],splashScreenImage:"images/splashScreenImage.gif",enableSplashScreenImage:1,enableSplashScreenText:1,endableSplashScreen:1,hideImages:1};
