window.onload = rolloverInit;

function rolloverInit() {
	for (var i=0; i<document.images.length; i++) {
		if ((document.images[i].parentNode.tagName == "A") && (document.images[i].src.search(/nav/) >= 0)){
			setupRollover(document.images[i]);
			}
	}
}

function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = thisImage.src.substr(0,thisImage.src.lastIndexOf("/")) + "/" + thisImage.id + "On.gif";
	thisImage.onmouseover = rollOver;
	
	thisImage.parentNode.childImage = thisImage;
	thisImage.parentNode.onblur = rollOutChild;
	thisImage.parentNode.onfocus = rollOverChild;
}

function rollOut() {
	this.src = this.outImage.src;
}

function rollOver() {
	this.src = this.overImage.src;
}

function rollOutChild() {
	this.childImage.src = this.childImage.outImage.src;
}

function rollOverChild() {
	this.childImage.src = this.childImage.overImage.src;
}
