/*
 * jQuery plugin: Preload & Fallback - 0.1
 * (c) 2009 NoMoreSleep <thomas@0nomoresleep.net> - http://www.nomoresleep.net
 */

var preload = {
	images:function(images, callback){
		var img = document.createElement('img');
		img.src = images.shift();

		var int = setInterval(function(){
			if(img.complete){ 
				clearInterval(int);
				if(images.length > 0){
					return preload.images(images, callback);
				}
				callback();
			}
		}, 1);
	}
}