//script to handle top menu image swaps

var browser = navigator.appName;
var version = parseInt(navigator.appVersion);
var animButtons = false;


if (browser == "Netscape" && version >= 3) 
{
animButtons = true; // ie. can do this at all
}

if (browser == "Microsoft Internet Explorer" && version >= 4) 
{
animButtons = true; // ie. can do this at all
}


if (animButtons == true) //create 7 new image objects and load mouseOver pics into them
{
var buttonPics = new Array(7); 
var origButtonPics = new Array(7);

	for (ctr=0; ctr < 7; ctr++)
	{
	buttonPics[ctr] = new Image;
	buttonPics[ctr].src = "but" + ctr + "dn.jpg";
	origButtonPics[ctr] = new Image; //used for making sure orig images are never reloaded from URL but are always kept locally - only used as necessary
	}
}


function buttonDn(btn, pic)//replaces image for this object with one preloaded
{
if (animButtons == true) // ie. we can do this
{
z = "origButtonPics[" + pic + "].src = document.images." + btn + ".src";
eval(z); //stores a reference to the image for the normal state to prevent risk of browser making a url request for this image
y = "document.images." + btn + ".src = buttonPics[" + pic + "].src";
eval(y);

}
}
 
function buttonAway(btn, pic)
{
if (animButtons == true) // ie. we can do this
{
y = "document.images." + btn + ".src = origButtonPics[" + pic + "].src";
eval(y);
}
}




