//Main Nav

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

function removeClassName(el, name) {

  var i, curList, newList;

  if (el.className == null)
    return;

  // Remove the given class name from the element's className property.

  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}

// Submenu links

var submenu=new Array()

submenu[0]='<img src="images/blank.gif" width="78" height="13"><a href="/news/news.html" target="main" onmouseover="onMouseOver(clubnews)" onmouseout="onMouseOut(clubnews)" border="0"><img src="images/nav/clubnews.gif" name="clubnews" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="/news/comingsoon.html" target="main" onmouseover="onMouseOver(comingsoon)" onmouseout="onMouseOut(comingsoon)" border="0"><img src="images/nav/comingsoon.gif" name="comingsoon" border="0"></a>'

submenu[1]='<img src="images/blank.gif" width="130" height="13"><a href="http://www.trashclub.co.uk/gallery/index.php?cat=6" target="main" onmouseover="onMouseOver(flyers)" onmouseout="onMouseOut(flyers)" border="0"><img src="images/nav/flyers.gif" name="flyers" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="/gallery/index.php" target="main" target="main" onmouseover="onMouseOver(photos)" onmouseout="onMouseOut(photos)" border="0"><img src="images/nav/photos.gif" name="photos" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="press.html" target="main" onmouseover="onMouseOver(press)" onmouseout="onMouseOut(press)" border="0"><img src="images/nav/press.gif" name="press" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="interviews.shtml" target="main" onmouseover="onMouseOver(interviews)" onmouseout="onMouseOut(interviews)" border="0"><img src="images/nav/interviews.gif" name="interviews" border="0"></a>'

submenu[2]='<img src="images/blank.gif" width="208" height="13"><a href="/djs/" target="main" onmouseover="onMouseOver(djs)" onmouseout="onMouseOut(djs)" border="0"><img src="images/nav/djs.gif" name="djs" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="/radio/" target="main" onmouseover="onMouseOver(radio)" onmouseout="onMouseOut(radio)" border="0"><img src="images/nav/radio.gif" name="radio" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="podcasts.html" target="main" onmouseover="onMouseOver(podcasts)" onmouseout="onMouseOut(podcasts)" border="0"><img src="images/nav/podcasts.gif" name="podcasts" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="video.html" target="main" onmouseover="onMouseOver(video)" onmouseout="onMouseOut(video)" border="0"><img src="images/nav/video.gif" name="video" border="0"></a>'

submenu[3]='<img src="images/blank.gif" width="18" height="13"><a href="about.html" target="main" onmouseover="onMouseOver(info)" onmouseout="onMouseOut(info)" border="0"><img src="images/nav/info.gif" name="info" border="0"></a><img src="images/blank.gif" width="8" height="13"><a href="history.html" target="main" onmouseover="onMouseOver(history)" onmouseout="onMouseOut(history)" border="0"><img src="images/nav/history.gif" name="history" border="0"></a>'


var menuobj=document.getElementById? document.getElementById("subs") : document.all


var activeButton = null;

function buttonClick(event, which) {

  var button;

  // Get the target button element.

  if (browser.isIE)
    button = window.event.srcElement;
  else
    button = event.currentTarget;
	
  // Blur focus from the link to remove that annoying outline.

  button.blur();

  // Reset the currently active button, if any.

  if (activeButton != null)
    resetButton(activeButton);

  // Activate this button, unless it was the currently active one

  if (button != activeButton) {
    depressButton(button);
    activeButton = button;
	thecontent=(which==-1)? "" : submenu[which]
  }
  
  else {
    activeButton = null;
	thecontent = ""
  }
	
  menuobj.innerHTML=thecontent

  return false;
}

function depressButton(button) {
button.className += "active";
}

function resetButton(button) {
  removeClassName(button, "active");
}

function resetSub(button) {
  menuobj.innerHTML=""
}



