I'm having trouble with an image preloader and roll over function and can't see where it is that I've screwed up.
If anyone out there can take a look at this and give me a push in the right direction it'd be appreciated.
Cheers

Here's the javascript:

Code:
<script>	
	preloadNavImages = new Array();

	image_url = new Array(6);
	image_url[0] = "images/navMenu/button1.jpg";
	image_url[1] = "images/navMenu/button1_over.jpg";
	image_url[2] = "images/navMenu/button2.jpg.jpg";
	image_url[3] = "images/navMenu/button2_over.jpg";
	image_url[4] = "images/navMenu/button3.jpg.jpg";
	image_url[5] = "images/navMenu/button3_over.jpg";
	


	for(i=0; i < image_url.length; i++) { 
		preloadNavImages[i] = new Image;
		preloadNavImages[i].src = image_url[i];
	}

	function rollOver(image,position) {
	image.src = image_url[position].src
	}

</script>
Here's an example of what I have in the body:
Code:
<a href="home.html"><img src="images/navMenu/button1.jpg"
	onMouseOver="rollOver(this,1)"
	onMouseOut="rollOver(this,0)"
/></a>