//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="weapons.html">Weapons</a> &raquo; <a href="w_nuclear.html">Nuclear</a> - <a href="w_chemical.html">Chemical</a> - <a href="w_biological.html">Biological</a> - <a href="w_landmines.html">Landmines</a>'

submenu[1]='<a href="history.html">History</a> &raquo; <a href="h_firstwmd.html">First WMD</a> - <a href="h_wwi.html">World War I</a> - <a href="h_wwii.html">World War II</a> - <a href="h_coldwar.html">Cold War</a>'

submenu[2]='<a href="wmdtoday.html">WMD Today</a> &raquo; <a href="wt_armscontrol.html">Arms Control</a> - <a href="wt_casestudy.html">Case Studies</a> - <a href="wt_affectyou.html">Affects you</a> - <a href="wt_youcando.html">Your Actions</a> - <a href="wt_terrorism.html">Terrorism</a>'

submenu[3]='<a href="interactive.html">Interact</a> &raquo; <a href="i_games.html">Games</a> - <a href="i_quiz.html">Quizzes</a> - <a href="i_poll.html">Polls</a> - <a href="i_interviews.html">Interviews</a>'

submenu[4]='<a href="tools.html">Tools</a> &raquo; <a href="t_glossary.html">Glossary</a> - <a href="t_sitemap.html">Site Map</a> - <a href="../flash/index.html">Flash Site</a> - <a href="../txt/index.html">Text Only</a>'

var menuobj=document.getElementById? document.getElementById("subs") : document.all


var activeButton = null;

function showElement(event, which) {

	thecontent=(which==-1)? "" : submenu[which]

  menuobj.innerHTML=thecontent

  return false;
}  

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=""
}



// Script provided by Spoono.com Free online webdesign resource
