
browserName = navigator.appName;

browserVer = parseInt(navigator.appVersion);

if (navigator.userAgent.indexOf("Mozilla/3.0") != -1) version = "n3";
else if (browserName == "Netscape" && browserVer >= 4) version = "n3";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 3) version = "n3";
else version = "n2";

if (version == "n3") {
	switch1on = new Image();
	switch1on.src = "images/shared/outreach_roll.gif";
	switch2on = new Image();
	switch2on.src = "images/shared/lessons_roll.gif";
	switch3on = new Image();
	switch3on.src = "images/shared/access_roll.gif";
	
	switch1off = new Image();
	switch1off.src = "images/shared/outreach_off.gif";
	switch2off = new Image();
	switch2off.src = "images/shared/lessons_off.gif";
	switch3off = new Image();
	switch3off.src = "images/shared/access_off.gif";
}

function img_act(imgName) {
	if (version == "n3") {
		imgOn = eval(imgName + "on.src");
		var iCount = 0;
		
		img_inact_all();

		// This is Netscape-only behavior for images on a separate layer
		if (typeof(document[imgName]) == "undefined") {
			// roll the image wherever it may be
			for (iCount = 0; iCount < document.layers.length; iCount++) {
				if (typeof(document.layers[iCount].document[imgName]) != "undefined") {
					document.layers[iCount].document[imgName].src = imgOn;
				}
			}

		} else {
			document[imgName].src = imgOn;
		}
	}
}

function img_inact(imgName) {
	if (version == "n3") {
		imgOff = eval(imgName + "off.src");
		var iCount = 0;
		
		// This is Netscape-only behavior for images on a separate layer
		if (typeof(document[imgName]) == "undefined") {
			// roll the image wherever it may be
			for (iCount = 0; iCount < document.layers.length; iCount++) {
				if (typeof(document.layers[iCount].document[imgName]) != "undefined") {
					document.layers[iCount].document[imgName].src = imgOff;
				}
			}

		} else {
			document[imgName].src = imgOff;
		}
	}
}

// Use instead of img_inact inside onMouseOut when onMouseOver causes a fly-out menu,
// in which case, onMouseOut should not un-highlight the image (because even though
// the mouse is out of the image, it's probably in the menu, so it makes sense to keep
// it highlighted).  Therefore, we use this to unhighlight everything when the next
// image is highlighted.
function img_inact_all() {
	document["switch1"].src = switch1off.src
	document["switch2"].src = switch2off.src
	document["switch3"].src = switch3off.src
}
