//Upload this script and reference it in the openpage.inc file. 
//<script type="text/javascript" language="JavaScript1.2" src="../DSN/wwwyoursitecom/Content/Javascripts/imgswap.js"></script>
//On the image you want to swap, use: onmouseover="imgSwap(this)" in the <img tag
//Example: <img onmouseover="imgSwap(this)" src="../DSN/wwwyoursitecom/Content/Images/home.gif">
//Upload the original image and the rollover image with the name extension of _hot
//Example: home.gif and home_hot.gif
//You can change _hot to whatever you like. Just make sure your rollover file follows suit.



function imgSwap(pic)
{
	var path = pic.src;
	var overState = "-hover";
	var imgStr, hover, type;
	
	if(path.indexOf(".gif") != -1) {
		type = ".gif";
		imgStr = path.substring(0, path.indexOf(type))
		hover = imgStr + overState + type;
	} else if(path.indexOf(".jpg") != -1) {
		type = ".jpg";
		imgStr = path.substring(0, path.indexOf(type))
		hover = imgStr + overState + type;
	} else {
		alert("Unsupported Image Format.");
		type = hover = null;
		pic.onmouseover = null;
		return;
	}
	
	pic.src = hover;
	
	pic.onmouseout = function() {
		path = this.src;
		imgStr = path.substring(0, path.indexOf(overState + type))
		hover = imgStr + type;
		this.src = hover;
		this.onmouseout = null;
	}

}
