/**

 * imageSwap.js

 * One Earth One Mission

 * JavaScript code for image swapping.

 *

 * Dependencies: util.js

 *

 * Last modified by Min Huang 02/29/2004

 */



var imageNameBackup;

var imageUrlBackup;



/**

 * imageSwap(imageName, imageUrl)

 * Swaps an image.  Use with onMouseOver

 * @param imageName		Name of the image to swap in

 * @param imageUrl		Location of the image to swap in

 */

function imageSwap(imageName, imageUrl) {

	if (!document.images[imageName])

		return;

	imageNameBackup = imageName;

	imageUrlBackup = document.images[imageName].src;

	document.images[imageName].src = imageUrl;

}



/**

 * imageRestore()

 * Restores an image.  Use with onMouseOut

 * @param imageName		Name of the image to swap in

 * @param imageUrl		Location of the image to swap in

 */

function imageRestore() {

	if (!imageNameBackup || !imageUrlBackup)

		return;

	document.images[imageNameBackup].src = imageUrlBackup;

}




/**

 * Preloads your images.  Call this at the beginning of the

 * body.

 */

function imagePreload() {

	/*

	imageArray = new Array();

	for (var i = 0; i < imagePreload.arguments.length; i++) {

		imageArray[i] = new Image();

		imageArray[i] = imagePreload.arguments[i];

	}

	*/

	document.write("<div style=\"position: absolute; visibility: hidden\">");

	for (var i = 0; i < imagePreload.arguments.length; i++) {

		document.write("<img src=\"" + imagePreload.arguments[i] + "\">");

	}

	document.write("</div>");

}
