// rollover.js
// handle the rollover animations

function rollover_init()
{
	var_init();   // from web page

	// get browser info
	with(navigator) {
		code = appCodeName;
		app = appName;
		version = appVersion;
		iver = parseInt(version);
		ua = userAgent;
	}

	s_hot  = suffixes[0];	// shortcut names
	s_cold = suffixes[1];

	// works in "Mozilla" 3+ (includes MSIE 4)
	okay = ((code == "Mozilla" && iver >= 3 ) ? true : false);

	// this uses eval to create variables and to pre-load the images. 
	for (var i = 0; i < imagenames.length; i++) {
    		var name = imagenames[i];
    		var ion  = "r" + name + "on";
		var ioff = "r" + name + "off";
		eval(ion  + " = new Image()");
		eval(ion  + ".src = '" + path + name + s_hot + ext + "'");
		eval(ioff + " = new Image()");
		eval(ioff + ".src = '" + path + name + s_cold + ext + "'");
	}
} // rollover_init

function over(imgname) {
// for onMouseOver
	if (!okay) {
		return true;	// EXIT unless okay
	}
	// swap in the "on" image
	eval("document." + imgname + ".src = r" + imgname + "on.src");
	return true;
}

function out(imgname)
// for onMouseOut
{
	if (!okay) {
		return true; // EXIT unless okay
	}
	// swap in the "off" image
	eval("document." + imgname + ".src = r" + imgname + "off.src");
	return true;
}

