var imgPath = null;
var oldRef = null;
var oldSrc = null;

function preloadImages()
{
	// if the document has images
	if(document.images) {
	
		// if the imageArray doesn't exist then create it
		if(!document.imageArray) document.imageArray = new Array();
	
		// loop through all the images in the page and look for
		// the string "_up." - i added the period(.) to avoid confusion
		// with _up appearing in the id/name (e.g. sign_up_up.gif)
		// and replace "_up." with "_over." and create a new Image
		for(var i=0; i<document.images.length; i++) {
	
			imgSrc = document.images[i].src;
			if(imgSrc.lastIndexOf("_off.") != -1) {
				document.imageArray[i].src = document.images[i].src.replace("_off.", "_over.");
				document.imageArray[i] = new Image();
			}
		}			
	}	
}

function rollOut() 
{
	if(document.images) {
		document.images[oldRef].src = oldSrc;
	}
}

function rollOver(imgRef)
{
	if(document.images) {
		oldRef = imgRef;
		oldSrc = document.images[imgRef].src;
		document.images[imgRef].src = document.images[imgRef].src.replace("_off.", "_over.");
	}
}