var menuActive = 0
var menuOn = 0
var onLayer
var timeOn = null
 
// SHOW MENU
function showLayer(layerName)
{
	if (timeOn != null) 
	{
		clearTimeout(timeOn)
		hideLayer(onLayer)
	}
	
	// W3C dom compliant browsers (IE5, Mozilla etc.)
    if (document.getElementById)
    {
        document.getElementById(layerName).style.visibility = 
            "visible";
        
    }
    // NS4 layers
    if (document.layers) 
    {
        document.layers[layerName].visibility =
            "show";
        
    }
    // Anything which supports document.all (IE4; some others like Konqueror)
    if (document.all)
        document.all[layerName].visibility = 
            "visible";
		
	onLayer = layerName
	
}

// HIDE MENU
function hideLayer(layerName)
{
	if (menuActive == 0) 
	{
		// W3C dom compliant browsers (IE5, Mozilla etc.)
		if (document.getElementById)
		{
			document.getElementById(layerName).style.visibility = 
				"hidden";
			
		}
		// NS4 layers
		if (document.layers) 
		{
			document.layers[layerName].visibility =
				"hide";
		
		}
		// Anything which supports document.all (IE4; some others like Konqueror)
		if (document.all)
			document.all[layerName].visibility = 
				"hidden";
	}
}
// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
}// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 1000)
 }
 
