var actualImage = "";
var oldImage = new String;

function turnOn (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	if (imgSrc.indexOf("_over.") >= 0)
		replaceInImageSrc(imgId, "_over.", "_on.")
	else
		replaceInImageSrc(imgId, "_off.", "_on.");
} // function turnOn

function turnOver (imgId) {
	replaceInImageSrc(imgId, "_off.", "_over.");
} // function turnOver

function turnOff (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	if (imgSrc.indexOf("_over.") >= 0)
		replaceInImageSrc(imgId, "_over.", "_off.")
	else
		replaceInImageSrc(imgId, "_on.", "_off.");
} // function turnOff

function replaceInImageSrc (imgId, replace, replaceBy)
{
	if (dom) {
		imgSrc = document.getElementById(imgId).getAttribute("src");
		if (imgSrc.indexOf(replace) > 0) imgSrc = imgSrc.substring(0, imgSrc.indexOf(replace)) + replaceBy + imgSrc.substring(imgSrc.indexOf(replace) + replace.length, imgSrc.length);
		document.getElementById(imgId).setAttribute("src", imgSrc);
	}
} // function replaceInImageSrc

function setImg (imgId) {
	oldImage = actualImage;
	actualImage = imgId;
	if (oldImage != "") turnOff(oldImage);
	if (imgId != "") turnOn(actualImage);
} // function setImg

