<!--
// functions for handling rollovers and preloading of rollovers.
// set handles below for image names.

var off_handle = "_off";
var on_handle = "_over";
var down_handle = "_down";

// Pre Caching Over Images function
// Call using CacheOverImages('a','b') etc
function CacheOverImages() {
	if (document.images) {
		numberofargs=arguments.length;
		for (x=0; x<numberofargs; x++) {
			this[x] = new Image();
			this[x].src="" + arguments[x] + "_over.gif";
		}
	}
}

// Mouse-over function
// Swaps image for same image name with "_off" appended
function MouseOver(image) {
	if (image && document.images && image.src.indexOf(on_handle + ".")==-1 && image.src.indexOf(down_handle + ".")==-1) {
		var imagename = image.src.substring(0,(image.src.indexOf(off_handle + ".")))
		var imagetype = image.src.substring(((image.src.indexOf(off_handle + "."))+off_handle.length),image.src.length);
		image.src = "" + imagename + on_handle + imagetype;
	}
}

// Mouse-out function
// Swaps a mouse-over image for the original image name
function MouseOut(image) {
	if (image && document.images && image.src.indexOf(on_handle + ".")!=-1 && image.src.indexOf(down_handle + ".")==-1) {
		var imagename = image.src.substring(0,(image.src.indexOf(on_handle + ".")))
		var imagetype = image.src.substring(((image.src.indexOf(on_handle + "."))+on_handle.length),image.src.length);
		image.src = "" + imagename + off_handle + imagetype;
	}
}

// Mouse-down function
// Swaps image for same image name with "-down" appended
function MouseDown(image) {
	TurnOffAllMouseDowns();
	if (image && document.images && image.src.indexOf(down_handle + ".")==-1) {
		var imagename = image.src.substring(0,(image.src.indexOf(on_handle + ".")))
		var imagetype = image.src.substring(((image.src.indexOf(on_handle + "."))+on_handle.length),image.src.length);
		image.src = "" + imagename + down_handle + imagetype;
	}
}

// TurnOffAllMouseDowns function
// Loops through all images on the page and swaps all images with downhandle to offhandle.
function TurnOffAllMouseDowns() {
	for (tempx=0; tempx<=document.images.length; tempx++) {
		if (document.images[tempx] && document.images[tempx].src.indexOf(down_handle + ".")!=-1) {
			var imagename = document.images[tempx].src.substring(0,(document.images[tempx].src.indexOf(down_handle + ".")))
			var imagetype = document.images[tempx].src.substring(((document.images[tempx].src.indexOf(down_handle + "."))+down_handle.length),document.images[tempx].src.length);
			document.images[tempx].src = "" + imagename + off_handle + imagetype;
		}
	}
}
//-->