// 
// This script is made for making rollovers simpler when you don't want 
// to use all the fireworks or imageready export process crap
// 
// NOT WORKING WITH NESTCAPE 4
//
// Simply add -- onMouseOver="xMouseOver(this);" onMouseOut="xMouseOut(this);" -- on the image tag
// and add a "_o" string on your rollover image
// i.e. = "button01.jpeg" -> "button01_o.jpeg"
//
// <a href="#" ><img src="images/b1.jpg" alt="" border="0" onMouseOver="xMouseOver(this);" onMouseOut="xMouseOut(this);" /></a>

function getFileName(xFile) {
	var tabFile = new Array();
	var foundFileStart = false;
	var foundFileType = false;
	for (i=xFile.length;i>0;i--) {
		if (xFile.charAt(i) == "." && foundFileType == false) {
		  foundFileType = true;
		  var indexFileType = i+1;
		} else if (xFile.charAt(i) == "/" && foundFileStart == false) {
		  foundFileStart = true;
		  var indexFileStart = i+1;
		}
	}
	tabFile["xFileType"] = xFile.substr(indexFileType,xFile.length);
	tabFile["xFileName"] = xFile.substring(indexFileStart,indexFileType-1);
	tabFile["xFilePath"] = xFile.substring(0,indexFileStart);
	return(tabFile);
}
function xMouseOver(xImg) {
	var tabFile = getFileName(xImg.src);
	xImg.oSrc=xImg.src; 
	xImg.src = tabFile["xFilePath"]+tabFile["xFileName"]+"_o."+tabFile["xFileType"];
}
function xMouseOut(xImg) {
	xImg.src = xImg.oSrc;
}

function xClassOver(xObject) {
	var xClassName = xObject.className;
	xObject.xOldClassName = xClassName;
	xObject.className=xClassName+'_o';
}
	
function xClassOut(xObject) {
	xObject.className=xObject.xOldClassName;
}