// JAVASCRIPT IMAGE SOURCE CHANGER
// by Jon Waller
// 2007

staticSuffix = "_static.";
hoverSuffix = "_hover.";

overrideClass = "no_hover";

function imgSrcChangerInit() {
	//
	var imgNodes = document.getElementsByTagName("img");
	//
	for (i = 0; i < imgNodes.length; i++) {
		if (imgNodes[i].src.indexOf(staticSuffix) != -1 && imgNodes[i].className.indexOf(overrideClass) == -1) {
			imgNodes[i].onmouseover = function() { hoverImgSrc(this); };
			imgNodes[i].onmouseout = function() { staticImgSrc(this); };
		}
	}
}

function hoverImgSrc(x) {
	newImgSrc = x.src.replace(staticSuffix,hoverSuffix);
	x.src = newImgSrc;
	//
	if (x.parentNode.tagName == "A") {
		x.style.cursor = "pointer";
	}
}

function staticImgSrc(x) {
	newImgSrc = x.src.replace(hoverSuffix,staticSuffix);
	x.src = newImgSrc;
}
