/*
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
*/

/**
*	DELAY MENUS v2
*	works with sub-sub menus as well
*/
var old_menus = [];
var delay = 300;

function MM_showHideLayers() {
	var i, p, v, obj, args = MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i += 3) {
		if ((obj=MM_findObj(args[i])) != null) {
			v = args[i+2];
			if (obj.style) {
				v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
				showhide(obj, v);
			}
		}
	}
}
function hideAllOthers()
{
	while(old_menus.length) {
		var menu = old_menus.pop();
		if(typeof menu.timeout != "undefined") window.clearTimeout(menu.timeout);
		menu.style.visibility = "hidden";
	}
}
function showhide(e, v)
{
	if(typeof e == "undefined") return;
	if(v == "visible") {
		hideAllOthers();
		if(typeof e.timeout != "undefined") window.clearTimeout(e.timeout);
		e.style.visibility = v;
	} else {
		if(typeof e.timeout != "undefined") window.clearTimeout(e.timeout);
		e.hideAfterDelay = function(){ var me = e; me.timeout = window.setTimeout(function(){ me.style.visibility = "hidden"}, delay) };
		e.hideAfterDelay();
		old_menus.push(e);
	}
}
/*---------------------------------------------------------*/
