function preloaderObject(pr) {
	var preload, preloaded;
	var onload, onprogress;
	var me=this;

	if ($.isArray(pr))
		preload = pr;
	else
		preload = [];
	preloaded = [];

	this.img = function(n) {
		return preloaded[n];
	};
	this.load = function(l) {
		if (l === undefined) {
			if (this.onload !== undefined)
				this.onload();
		} else if ($.isFunction(l))
			this.onload = l;
	};
	this.progress = function(l) {
		if (l === undefined) {
			if (this.onprogress !== undefined)
				this.onprogress();
		} else if ($.isFunction(l))
			this.onprogress = l;
	};
	this.queue = function(o) {
		preload.push(o);
	};
	this.run = function() {
		var n = preloaded.length,m=preload.length;

		if (this.onprogress !== undefined)
			this.onprogress(n,m);

		if (n < m) {
			preloaded[n] = $("<img/>")
				.load(function(e) {
					if (e.target.parentNode === null) {/* IE bug */
//						preloaded[n].unbind("error");
//						preloaded[n].unbind("load");
						//setTimeout(function() {me.run.call(me);}, 2000);
						setTimeout(function(){me.run.call(me)}, 200);
					}
				})
				.error(function(e) {
					if (e.target.parentNode === null) {/* IE bug */
						preloaded[n].unbind("error");
						preloaded[n].unbind("load");
						me.run.call(me);
					}
				})
				.attr({src:preload[n]}); 
			return;
		}

		if (this.onload !== undefined)
			this.onload();
	};

	this.waitLoad = function(coda) {
		var n=0;
		var m=coda.length;
		var deq = function(e) {
			var elemento = coda.filter("[src="+e.target.src+"]");
			n += elemento.length;

			if (me.onprogress !== undefined)
				me.onprogress(n, m);

			if (n < m)
				return;

			if (me.onload !== undefined)
				me.onload();
		};

		coda.load(deq).error(deq);
		coda.each(function(){
			$(this).attr({src: $(this).attr("src")});
		});
	}

}