varImageLoader=function(a,b){this.wrapper=ainstanceofHTMLImageElement?a:null;if(!this.wrapper)throwError("Param 1 expected to be an HTMLImageElement (<img>), but "+a.constructor.name+" received");this.loaded=!1;AJAX.send("./pictures/index.php",function(a){this.images=JSON.parse(a);this.loaded=!0;b.call(this)}.bind(this),"GET")};
ImageLoader.prototype.load=function(a,b){if(!this.loaded)throwError("image tree not loaded yet");if("string"!=typeofa)throwError("Param 1 expected to be a <String>");a=a.replace(/:/g,"/");if("function"!=typeofb)throwError("Param 2 expected to be a <Function>");if(~this.images.indexOf("/"+a))returnthis.wrapper.addEventListener("load",b,!1),this.wrapper.src="./pictures/"+a,!0;console.warn("Resource not found!")};