//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]='<a href="http://www.ksfm.com/pages/2908864.php">DJ Main Page</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/2637778.php">Wayne, Jay and Reagan</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/2667573.php">Big Al</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/2667692.php">Tony Tecate</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/5877212.php">Boondock</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/2667766.php">The Specialist</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/1466870.php">MTV TRL</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/1107199.php">Club 102</a>'
submenu[1]='<a href="http://www.ksfm.com/pages/425193.php">KSFM Playlist</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/425194.php">Top 10 Requested Songs</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/604169.php">Request A Song Online!</a>'
submenu[2]='<a href="http://www.ksfm.com/pages/2746191.php">Browse All KSFM Pics!</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/611722.php">All Access Pics</a> &nbsp; | &nbsp; <a href="http://www.ksfm.com/pages/1298393.php">In The Streets</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=""
}