var hide_timer = null;

function sizeto(num, size, destsize)
{
  elem = document.getElementById("menu" + num);

  if (size >= destsize)
  {
    size = destsize;
  }
  else
  {
    setTimeout('sizeto('+num+', '+(size+30)+', '+destsize+')', 20);
  }
  elem.style.width = (size) + "px";
  return;
}

function show_menu(obj, num)
{
  for (i=1; i<=7; i++)
  {
    elem2 = document.getElementById("menu"+i);
    if (elem2 && i != num)
    {
      hide_menu (i);
    }
  }

  elem3 = document.getElementById("vol"+num);
  elem3.style.background = "160px 5px url(images/arr_orange.gif) no-repeat";

  elem4 = document.getElementById("volb"+num);
  elem4.style.color = "#E9C379";

  elem = document.getElementById("menu"+num);
  elem.style.width = "0px";
  elem.style.visibility = "visible";
  sizeto(num, 0, 234);
}

function hide_menu(num)
{
  clearTimeout(hide_timer);  
  hide_timer = null;

  elem = document.getElementById("menu"+num);
  elem.style.visibility = "hidden";

  elem3 = document.getElementById("vol"+num);
  elem3.style.backgroundImage = "none";

  elem4 = document.getElementById("volb"+num);
  elem4.style.color = "#FFFFFF";
}

function clear_hide_timer(num)
{ 
  if (hide_timer != null)
  {
    clearTimeout(hide_timer);
    hide_timer = null;
  }
}

function set_hide_timer(num)
{
  hide_timer = setTimeout("hide_menu("+num+")", 200);
}
