window.onload = rolloverInit;

function rolloverInit() {
	for (var i=0; i<document.links.length; i++) {
		var linkObj = document.links[i];
		if (linkObj.className) {
			var imgObj = document.getElementById(linkObj.className);
			if (imgObj) {
				setupRollover(linkObj,imgObj);
			}
		}
	}
}

function setupRollover(thisLink,thumbNailImage) {
	thisLink.imgToChange = thumbNailImage;
	thisLink.onmouseout = rollOut;
	thisLink.onmouseover = rollOver;	
	
	thisLink.outImage = new Image();
	thisLink.outImage.src = thumbNailImage.src;

	thisLink.overImage = new Image();
	thisLink.overImage.src = "images/artwork/" + thisLink.id + "Lg.JPG";
}

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

function rollOut() {
	this.imgToChange.src = this.overImage.src;
}

