



var NS4x = (typeof(document.layers) != 'undefined');

// Internet Explorer, Netscape (not 4.x), Mozilla
var hideName = 'hidden';
var showName = 'visible';

// indicates the id number of the submenu currently active
var persistMenu;

// handle to the hide timer of the active submenu 
var timeoutHandle;

// Changes the status bar, shows the menu indicated by id, sets the menu hide timer	
function subtopicsIN(id, newStatus) {
	setStatus(newStatus);
	if (window.NS4x) return;
	if (window.timeoutHandle) clearTimeout(window.timeoutHandle);
	if (persistMenu >= 0) subtopicsOUT(persistMenu);
	var handle = getObject("topics"+id);
	if (handle) {
		handle.visibility = window.showName;
		persistMenu = id;
	}
}

// Instantly turns off the menu by id and clears the timer if there is one.
function subtopicsOUT(id) {
	if (window.NS4x) return;
	if (timeoutHandle) clearTimeout(window.timeoutHandle);
	var handle = getObject("topics" + id);
	if (handle) {
		handle.visibility = window.hideName;
	}
}

// Keep the currently active menu active by resetting the menu hide timer
function menuIN(newStatus) {
	setStatus(newStatus);
	if (window.NS4x) return;
	if (window.timeoutHandle) clearTimeout(window.timeoutHandle)
}

// This sets a menu hide timer which will turn off the active submenu
function menuOUT() {
	if (window.NS4x) return;
	window.timeoutHandle = setTimeout("subtopicsOUT("+persistMenu+")",1000)
}

