
//Function to preload images
//(C) 2003 Thomas Wittek, tw@zentrufuge.biz
//Usage: preloadImages("img1.gif", "img2.jpg", ...);
//Setting: quiet (put error message in window status if not quiet)
var quiet  = false;
//Code...
var errors = "";
function loadError(src) {
	if (errors != "") errors += ", ";
	errors += src;
	if ((errors != "") && (quiet == false)) window.status = "Couldn't preload images " + errors;
}
function preloadImages() {
	if (document.images) {
		var files = preloadImages.arguments;
		if (document.preloadArray==null) document.preloadArray = new Array();
		var i = document.preloadArray.length;
		with (document) for (var j = 0; j < files.length; j++) {
			preloadArray[i] = new Image;
			preloadArray[i].onerror = new Function("loadError('" + files[j] + "');");
			preloadArray[i++].src = files[j];
		}
	}
}
