// JavaScript Document

window.onload = initRollover;


function initRollover() {
	for (var i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A"){
			discardImage(document.images[i]);
		}
	}
}

function discardImage(thisImage) {
	if (thisImage.id != false){
		setupRollover(thisImage);
		}
	}

function setupRollover(thisImage){
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "images/header_menu/" + thisImage.id + "_over.png";
	thisImage.onmouseover = rollOver;
}

function rollOut() {
	this.src = this.outImage.src;
}

function rollOver() {
	this.src = this.overImage.src;
}
