// Switch a submenu ("id" and "url" - for host of submenu)
// If "url" specified, URL will be opened, else only submenu opened
function switch_submenu(id, url)
{
  for (I=0;I<1000;I++)
    if (document.getElementById("submenu_"+I)) {
      document.getElementById("submenu_"+I).style.display = "none";
      document.getElementById("link_"+I).className = '';
      document.getElementById("link_"+I+"_hidden").style.display = "block";
    }
  open_submenu(id);
  if (url!='') window.location.href = url;
}

// Open submenu ("id" for host of submenu)
function open_submenu(id)
{
  if (id) {
    if (document.getElementById("submenu_"+id))
      document.getElementById("submenu_"+id).style.display = "block";
    document.getElementById("link_"+id).className = 'active';
    document.getElementById("link_"+id+"_hidden").style.display = "none";
  }
}