//*******************************************************
//Written by Jomond Kuang
//Last updated: 26-8-05
//Version 1.2: Changed to support javascript 1.3
//
//This class handles mouse over events for images.
//When the mouse is placed over the image, it changes
//to the image specified. The mouseover image must have
//the same name as the image object passed, but be
//suffixed with "_over". This class also handles the
//preloading if of over mouse effect images.
//*******************************************************

function imageChange(theImage)
{	
	theImageSrc = theImage.src;
	changeImage = "";
	if (theImageSrc.indexOf("_over") == -1)
	{
		changeImage = makeOverImage(theImageSrc);
	}
	else
	{
		changeImage = makeOriginalImage(theImageSrc);
	}
	theImage.src = changeImage;
}

function preloadImage(theImage)
{
	theImageSrc = theImage.src;
	anImage = new Image();
	anImage.src = makeOverImage(theImageSrc);
}

function makeOverImage(imageSrc)
{
	imageName = imageSrc.substring(0, theImageSrc.lastIndexOf("."));
	imageExtension = imageSrc.replace(imageName, "");
	theImageOverSrc = imageName + "_over" + imageExtension;
	return theImageOverSrc;
}

function makeOriginalImage(ImageSrc)
{
	return ImageSrc.replace("_over", "");	
}