nMaxItem = 4;
NameIndex = 0;

DefaultState = 1;
MouseOverState = 2;
MouseDownState = 3;
imgCounter = 0;

ImageList = new Array();


browserOK = (
	((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) ||
	((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )) ||
	((navigator.appName == "Opera") && (parseInt(navigator.appVersion) >= 8 ))
);


function AddImageToImageList(name, Default, MouseOver, MouseDown)
{
	ImageList[imgCounter] = new Array(nMaxItem);
	ImageList[imgCounter][NameIndex] = name;
	ImageList[imgCounter][DefaultState] = new Image();
	ImageList[imgCounter][DefaultState].src = Default;
	if (MouseOver != "") {
		ImageList[imgCounter][MouseOverState] = new Image();
		ImageList[imgCounter][MouseOverState].src = MouseOver;
	}
	if (MouseDown != "") {
		ImageList[imgCounter][MouseDownState] = new Image();
		ImageList[imgCounter][MouseDownState].src = MouseDown;
	}

	imgCounter++;
}


function ReplaceImage(name, state)
{
	for (i = 0; i < imgCounter; i++) {
		if (document.images[ImageList[i][NameIndex]] != null) {
			if ((name == ImageList[i][NameIndex]) && (ImageList[i][state] != null))
				document.images[name].src = ImageList[i][state].src;
		}
	}
}

AddImageToImageList("home", "files/home.gif", "files/home1.gif", "files/home2.gif");
AddImageToImageList("download", "files/download.gif", "files/download1.gif", "files/download2.gif");
AddImageToImageList("help", "files/help.gif", "files/help1.gif", "files/help2.gif");
AddImageToImageList("faq", "files/faq.gif", "files/faq1.gif", "files/faq2.gif");
AddImageToImageList("tutorial", "files/tutorial.gif", "files/tutorial1.gif", "files/tutorial2.gif");
AddImageToImageList("forum", "files/forum.gif", "files/forum1.gif", "files/forum2.gif");
AddImageToImageList("donate", "files/donate.gif", "files/donate1.gif", "files/donate2.gif");
