Javascript: IMAGE PRELOAD

Author
Justas
Description
How to get rid of the delay that happens when you use multiple images with 'onmouseover'? Preload all the images. You can supply one image url as an argument to this function, or an array of image urls.
Visits
1818
Share
Digg Del.icio.us Reddit Simpy StumbleUpon Furl Yahoo Spurl Google Blinklist Blinkbits Ma.Gnolia Technorati Newsvine Netvouz Slashdot Netscape
function ImagePreload() {
	if (typeof(arguments) != 'undefined') {
		for (i=0; i<arguments.length; i++ ) {
			if (typeof(arguments[i]) == "object") {
				for (k=0; k<arguments[i].length; k++) {
					var oImage = new Image;
					oImage.src = arguments[i][k];
				}
			}
 
			if (typeof(arguments[i]) == "string") {
				var oImage = new Image;
				oImage.src = arguments[i];
			}
		}
	}
}