/*
This script is called by product_zoom_in.php.
It allows the users to see a larger version of an image upon mouseover.
The image does NOT revert on mouseout.
The images must be contained in a link with a class of "textField" and an ID equal to the filename of the image.
*/
try{ // always try standard first;
addEventListener('load', rolloverInit, false);
addEventListener('load', initForms, false);
addEventListener('load', initForm, false);
} catch(e){ // so far MSIE browser is the only one that doesn't use addEventListener;
attachEvent('onload', rolloverInit);
attachEvent('onload', initForms);
attachEvent('onload', initForm);
}



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,textImage) {
	thisLink.imgToChange = textImage;
	thisLink.onmouseover = rollOver;	
	
	thisLink.outImage = new Image();
	thisLink.outImage.src = textImage.src;

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

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