// JavaScript Document

var allImages;

addOnload(getAllImages);

function getAllImages() {
	global: allImages;
	allImages = document.getElementsByTagName("img");
}

addOnload(imgMouseOver);

function imgMouseOver() {
	global: allImages;
	var allClases;
	for (i=0; i<allImages.length; i++) {
		allClases = allImages[i].className.split(" ");
		if (allClases.indexOf("imgSwap") > -1) {
			allImages[i].onmouseover = imgSwapImage;
			allImages[i].onmouseout = imgSwapImage;
		}
	}
}

function imgSwapImage() {
	var imageLocation = this.src;
	var thePath = imageLocation.substring(0,imageLocation.lastIndexOf("/"));
	var theFile = imageLocation.substring(imageLocation.lastIndexOf("/") + 1, imageLocation.length);
	if (theFile.indexOf("_") == 0) theFile = theFile.substring(1,theFile.length); else theFile = "_" + theFile;
	this.src = thePath+"/"+theFile;
}