var gl_menuBar_f = new Array(0, 0, 0, 0, 0, 0, 0, 0);

function menuBar_on(num)
{  
   if (gl_menuBar_f[num] != 1)
   {
      gl_menuBar_f[num] = 2; // en attente.
      menuBar(num);
   }
}

function menuBar_reset_flags()
{
   for (cpt = 0; cpt < 8; ++cpt)
      if (gl_menuBar_f[cpt] != 1)
         gl_menuBar_f[cpt] = 0;
}


function menuBar_out(num)
{
   menuBar_reset_flags();

}

function menuBar(num)
{ 
   if (gl_menuBar_f[num] == 2)
   {
      gl_menuBar_f = new Array(0, 0, 0, 0, 0, 0, 0, 0);
      gl_menuBar_f[num] = 1;
      var cpt;
      for (cpt = 0; cpt < 8; ++cpt)
         if (cpt != num && document.getElementById("menuBarTab_" + cpt) != null)
         {
            document.getElementById("menuTable_" + cpt).style.display = "none";
            
            menuEnCours = null;
            document.getElementById("menuBarTab_" + cpt).setAttribute("class", "tabOff_" + cpt);
            document.getElementById("menuBarTab_" + cpt).setAttribute("className", "tabOff_" + cpt);
         }
      if (document.getElementById("menuBarTab_" + num) != null)
      {
         document.getElementById("menuBarTab_" + num).setAttribute("class", "tabOn_" + num);
         document.getElementById("menuBarTab_" + num).setAttribute("className", "tabOn_" + num);
         
         document.getElementById("menuTable_" + num).style.display = "block";
         document.getElementById("menuBarContent_" + num).style.display = "block";
      }
   }
}