// JavaScript Document

window.onload=rolloverInit;

function rolloverInit() {
	for (var i=0; i<document.Images.length; i++) {
		if (document.Images[i].parentNode.tagName == "A") {
			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 = "Images/" + thisImage.id + "OVER.jpg";
	thisImage.onmouseover = rollOver;
	
	thisImage.downImage = new Image();
	thisImage.downImage.src = "Images/" + thisImage.id + "DOWN.jpg";
	thisImage.onmousedown = pressDown;
	
	thisImage.upImage = new Image();
	thisImage.upImage.src = "Images/" + thisImage.id + "OVER.jpg";
	thisImage.onmouseup = pressUp;
}

function rollOver() {
	this.src = this.overImage.src;
	}
function rollOut() {
	this.src = this.outImage.src;
	}
function pressDown() {
	this.src = this.downImage.src;
	}
function pressUp() {
	this.src = this.upImage.src;
	}
