var activeImage = "";
var offSuffix = "_off";
var onSuffix = "_on";

/**
* Preload images for rollovers
* variable number of arguments
* arg0 image type suffix ('.png'/'.gif' etc)
* arg1 base path to the images to preload
* arg2..n image names
*/
function preload()
{
	if (document.images)
	{
		var suffix = arguments[0];
		var path = arguments[1];
		var argLen = arguments.length;
		for (var i = 2; i < argLen; i++)
		{
			var arg = arguments[i];
			self[arg] = new Image();
			self[arg].src = path + arg  + offSuffix + suffix;
			self[arg + onSuffix] = new Image();
			self[arg + onSuffix].src = path + arg  + onSuffix + suffix;
		}
	}
}

/**
* Perform a rollover on the named image
* uid provides for instances where the same image rollover appears twice or more
* on a page
*/
function rollover(imageName, uid)
{
	if (uid == undefined)
		uid = imageName
	else if (uid == activeImage)
		return;
	if (document.images && self[imageName + onSuffix])
	{
		document.images[uid].src = self[imageName + onSuffix].src;
	}
}

/**
* Perform a rollout on the named image
* uid provides for instances where the same image rollover appears twice or more
* on a page
*/
function rollout(imageName, uid)
{
	if (uid == undefined)
		uid = imageName;
	else if (uid == activeImage)
		return;
	if (document.images && self[imageName])
	{
		document.images[uid].src = self[imageName].src;
	}
}





