function empty(str)
{
	return (str == "") ? true : false;
}

function validateArg(arg) // get boolean values for function arguments
{
	if ((arg == null) || (arg == "undefined") || (empty(arg)) || (arg.length < 1)) return false;
	else return true;
}

function returnDhtmlFeature(arg)
{
	var feature = null;
	if (document.all) feature = document.all(arg).style;  // IE
	else if (document.layers) feature = document.layers[arg];  // NN
	else if (document.getElementById) feature = document.getElementById(arg).style;  // N6
	return feature;
}

function setVisibilityName(state)
{
	var visibilityName = state;
	if (document.layers) { // N4
		visibilityName = (state == "visible") ? "show" : "hide";
	}
	return visibilityName;
}

var activeNavigation = null;
var timeoutId = 0;

function handleNaviVisibility(idName)
{
	var element = '';
	var state;
	
	if (activeNavigation != null) {
		window.clearTimeout(timeoutId);
		state = setVisibilityName("hidden"); // hide if visible
		element = returnDhtmlFeature(activeNavigation + "menu"); // dynamic menu
		element.visibility = state; // hide if visible
	}
	if (validateArg(idName)) {
		if (idName != "") {
			activeNavigation = idName;
			state = setVisibilityName("visible"); // hide if visible
			element = returnDhtmlFeature(activeNavigation + "menu"); // dynamic menu
			element.visibility = state; // show if hidden
		}
	}
}

function handleNaviTimeout()
{
	this.timeoutId = window.setTimeout("handleNaviVisibility();", 2000);
}