//====================================================================================================
//	Creates a rollover for the specified image.
//====================================================================================================
function SetupLink(img)
{
	var tmp = null;
	
	img.srcOff = img.src;
	img.srcOn = img.srcOff.replace(/_off/gi, "_on");
	
	if (Image)
	{
		tmp = new Image();
		tmp.src = img.srcOn;
	}
	
	img.onmouseout = function()
	{
		this.src = this.srcOff;
	}
	
	img.onmouseover = function()
	{
		this.src = this.srcOn;
	}
}

//====================================================================================================
//	Creates rollovers for all images in the document matching the specified class name.
//====================================================================================================
function SetupLinkRollovers()
{
	var imageList = null;
	
	if (document.getElementsByTagName) imageList = document.getElementsByTagName("img");
	else imageList = document.images;
	
	for (var i = 0; i < imageList.length; i++)
	{
		if (imageList[i].className && imageList[i].className == "link")
		{
			SetupLink(imageList[i]);
		}
	}
}

if (window.addEventListener) window.addEventListener("load", SetupLinkRollovers, false);
else if (window.attachEvent) window.attachEvent("onload", SetupLinkRollovers);
