/**
 * Rednexus Menu script
 *
 * @author Xander van Alst
 * @copyright Copyright 2005/2006 Xander van Alst
 * @name index.php
 * @version 1.0
 *
 * This script is tested on IE, Fireworks en Gecko (KDE)
 * usage:
 * <img src="normal image" hsrc="hover source">
 */

//xva The code below will enable the hovering effect on a image
var iCache = new Object();
for( var x = 0, ar = document.images; ar[x]; x++ ) {
	var im = ar[x];
	if( im.getAttribute ) { im.hsrc = im.getAttribute('hsrc'); }
	if( im.hsrc) {
		if( !iCache[im.src] ) {
			iCache[im.src] = new Image();
			iCache[im.src].src = im.src;
		}
		im.rsrc = im.src;
		im.onmouseout = function () { this.src = this.rsrc; };
		if( !iCache[im.hsrc] ) {
			iCache[im.hsrc] = new Image();
			iCache[im.hsrc].src = im.hsrc;
		}
		im.onmouseover = function () { this.src = this.hsrc; };
	}
}
