window.onload = rolloverInit;

function rolloverInit() {
	var navigation = document.getElementById("nav");
	var theImages = navigation.getElementsByTagName("img");
	for (var i=0; i<theImages.length; i++) {
		if (theImages[i].parentNode.tagName == "A") {
			setupRollover(theImages[i]);
		}
	}
}

function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;

	thisImage.overImage = new Image();
	thisImage.overImage.src = "../images/" + thisImage.id + "_over.gif";
	thisImage.onmouseover = rollOver;	
}

function rollOut() {
	this.src = this.outImage.src;
}

function rollOver() {
	this.src = this.overImage.src;
}