var menuIDvisible = "" ;
var entryIDselected = "" ;
var activeMenuIndex = -1;

var maxOpacity = 100 ;
var minOpacity = 0 ;

function setOpacity(obj,opacity){
opacity=(opacity==100) ? 99.999 : opacity;
obj.style.filter = "alpha(opacity:"+opacity+")";  // IE/Win
obj.style.KHTMLOpacity = opacity/100; // Safari<1.2, Konqueror
obj.style.MozOpacity = opacity/100;   // Older Mozilla and Firefox
obj.style.opacity = opacity/100;      // Safari 1.2, newer Firefox and Mozilla, CSS3
}

function hideMenus()
{
    hideMenu('iconMenuID','iconMenuLayer', 1);
    hideMenu('corsiMenuID','corsiMenuLayer', 2);
}

function hideMenu( entryID, menuID, actMenuIndex )
{
  if ( activeMenuIndex == -1 ) return ;

  x = new Object ;
 
  if ( actMenuIndex == 0 )
  {
      if (document.getElementById) x = document.getElementById( menuIDvisible ) ;
    	else if (document.all) x = document.all[menuIDvisible] ;
    	else if (document.layers) x = document.layers[menuIDvisible] ;
  }
  else
  {
      if (document.getElementById) x = document.getElementById( menuID ) ;
    	else if (document.all) x = document.all[menuID] ;
    	else if (document.layers) x = document.layers[menuID] ;
  }

  setOpacity( x, minOpacity ) ;
  x.style.visibility = "hidden" ;

  menuIDvisible = "" ;
  entryIDselected = "" ;
  activeMenuIndex = -1;
}

function showMenu( entryID, menuID, actMenuIndex )
{
  if ( activeMenuIndex == -1 && actMenuIndex == -1 ) return ;

  x = new Object ;

  if (document.getElementById) x = document.getElementById( menuID );
	else if (document.all) x = document.all['desc'];
	else if (document.layers) x = document.layers[menuID];

  setOpacity( x, maxOpacity ) ;
  x.style.visibility = "visible" ;

    menuIDvisible = menuID ;
    entryIDselected = entryID ;
		activeMenuIndex = actMenuIndex ;
}
