// Mildly modified script of JS-menu for control of catalogue menu

// Switch a submenu ("id" and "url" - for host of submenu)
// If "url" specified, URL will be opened, else only submenu opened
function switch_subsections(id, url)
{
  for (I=0;I<1000;I++)
    if (document.getElementById("subsections_"+I)) {
      document.getElementById("subsections_"+I).style.display = "none";
      document.getElementById("cat_link_"+I).className = '';
      document.getElementById("cat_img_"+I).style.display = "none";
    }
  open_subsections(id);
  if (url!='') window.location.href = url;
}

// Open submenu ("id" for host of submenu)
function open_subsections(id)
{
  if (id) {
    if (document.getElementById("subsections_"+id))
      document.getElementById("subsections_"+id).style.display = "block";
    document.getElementById("cat_link_"+id).className = 'active';
    document.getElementById("cat_img_"+id).style.display = "inline";
  }
}