Preloader=function(){this.callbacks=[];this.images=[];this.loadedImages=[];this.imagesLoaded=0};Preloader.prototype={add:function(b){if(typeof b=="string"){this.images.push(b)}if(typeof b=="array"||typeof b=="object"){for(var a=0;a<b.length;a++){this.images.push(b[a])}}},onFinish:function(b){if(typeof b=="function"){this.callbacks.push(b)}if(typeof b=="array"||typeof b=="object"){for(var a=0;a<b.length;a++){this.callbacks.push(b[a])}}},load:function(){for(var a=0;a<this.images.length;a++){var b=this;this.loadedImages[a]=new Image();this.loadedImages[a].onload=function(){b.checkFinished.apply(b)};this.loadedImages[a].src=this.images[a]}},checkFinished:function(){this.imagesLoaded++;if(this.imagesLoaded==this.images.length){this.fireFinish()}},fireFinish:function(){for(var a=0;a<this.callbacks.length;a++){this.callbacks[a]()}this.images=[];this.loadedImages=[];this.imagesLoaded=0;this.callbacks=[]}};