
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";
    
    window.document.images[layerName + "_img"].src = "/images/navigation/" + layerName + "_over.gif";
		
	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";
		}
		
		window.document.images[layerName + "_img"].src = "/images/navigation/" + layerName + ".gif";
}
// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",800)
}// 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)", 200)
 }
 
 // IMAGE SWAP
function rollOver(imageName, over) 
{
	if(window.document.images) 
  	{
    	if (over)
      		window.document.images[imageName].src = "/images/navigation/" + imageName + "_over.gif";
    	else
      		window.document.images[imageName].src = "/images/navigation/" + imageName + ".gif";
  	}
}

