//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="#1998-01">Ozy&#039;s First Day of School</a> | <a href="#1998-02">P.E. Class</a> | <a href="#1998-03">President Millie</a> | <a href="#1998-04">Millie Strives for "Cool"</a> | <a href="#1998-05">Millie the Artist</a> | <a href="#1998-06">Llewellyn Revealed</a> | <a href="#1998-07">Ozy&#039;s Haircut</a> | <a href="#1998-08">Seasonal Speculation</a>'

submenu[1]='<a href="#1999-01">Millie Deals with Ozy&#039;s Absence</a> | <a href="#1999-02">School Bullies</a> | <a href="#1999-03">The Search For Non-Commercialism</a> | <a href="#1999-04">Political Scandals</a> | <a href="#1999-05">Avery&#039;s Religion</a> | <a href="#1999-06">Millie Takes Jeremy to Court</a> | <a href="#1999-07">Avery&#039;s "Rebellion"</a> | <a href="#1999-08">Draconic Dentistry</a> | <a href="#1999-09">The Neighborhood Association</a> | <a href="#1999-10">Avery and Tobacco</a> | <a href="#1999-11">The World Beyond the Couch</a> | <a href="#1999-12">Avery the Self-Advertiser</a> | <a href="#1999-13">A Karma Cocoa Stain</a> | <a href="#1999-14">Ozy&#039;s Psychiatric Evaluation</a> | <a href="#1999-15">School Uniforms</a> | <a href="#1999-16">Christmas &#039;99</a>'

submenu[2]='<a href="#2000-01">Uniform Policy Cancelled</a> | <a href="#2000-02">Uniforms Revisited</a> | <a href="#2000-03">Millie &amp; Locke Swap Duties</a> | <a href="#2000-04">Stephan&#039;s Crush</a> | <a href="#2000-05">The Book of Wisdom</a> | <a href="#2000-06">Avery&#039;s Game Show</a> | <a href="#2000-07">Dragon Family Reunion - Part I</a> | <a href="#2000-08">Dragon Family Reunion - Part II</a> | <a href="#2000-09">"They"</a> | <a href="#2000-10">Gay Rights</a> | <a href="#2000-11">Millie the Visionary</a> | <a href="#2000-12">Llewellyn &#039;00</a> | <a href="#2000-13">Millie&#039;s Group Project</a> | <a href="#2000-14">Candidate Llewellyn and the Media</a> | <a href="#2000-15">The Recount</a> | <a href="#2000-16">Frozen Fur</a> | <a href="#2000-17">Felicia&#039;s "Club"</a> | <a href="#2000-18">Christmas 2000</a>'

submenu[3]='<a href="#2001-01">Ozy&#039;s Winter Coat</a> | <a href="#2001-02">Stephan&#039;s Dissapearance</a> | <a href="#2001-03">Millie&#039;s "Puppet Government"</a> | <a href="#2001-04">Avery&#039;s Sitcom</a> | <a href="#2001-05">Millie&#039;s Freedom of Speech</a> | <a href="#2001-06">Snow Day</a> | <a href="#2001-07">Accupuncture</a> | <a href="#2001-08">School Advertising</a> | <a href="#2001-09">The Formation of Greater Llewellynlland</a> | <a href="#2001-10">Avery&#039;s Band</a> | <a href="#2001-11">Ozy&#039;s Homeschooling</a> | <a href="#2001-12">"Flat Earth Books"</a> | <a href="#2001-13">The Attic</a> | <a href="#2001-14">Locke&#039;s Military Coup</a> | <a href="#2001-15">The Hair Curse</a> | <a href="#2001-16">Milliecorp</a> | <a href="#2001-17">Llewellynlland Vacations</a> | <a href="#2001-18">Standardized Testing</a> | <a href="#2001-19">Stephan In Love (Again)</a> | <a href="#2001-20">Dragon Horns and Wings</a> | <a href="#2001-21">Christmas &#039;01</a>'

submenu[4]='<a href="#2002-01">Llewellyn&#039;s Testimony</a> | <a href="#2002-02">School Play</a> | <a href="#2002-03">Webcomic</a> | <a href="#2002-04">Millie&#039;s Self-Judgement</a> | <a href="#2002-05">Llewellyn&#039;s Inventions</a> | <a href="#2002-06">Jury Duty</a> | <a href="#2002-07">Ozy&#039;s Adoption</a> | <a href="#2002-08">Theological Millie</a> | <a href="#2002-09">Millie&#039;s Father</a> | <a href="#2002-10">Perpetual Motion</a> | <a href="#2002-11">The Meaning of Life</a> | <a href="#2002-12">Millie&#039;s "Boyfriend"</a> | <a href="#2002-13">School Photographs</a> | <a href="#2002-14">Avery&#039;s "Reality Television"</a> | <a href="#2002-15">Christmas &#039;02</a>'

submenu[5]='<a href="#2003-01">New Year&#039;s &#039;03</a> | <a href="#2003-02">Millie&#039;s Confessional</a> | <a href="#2003-03">Llewellyn &#039;04 - Early Announcement</a> | <a href="#2003-04">Millie&#039;s Headbag</a> | <a href="#2003-05">Millie&#039;s Brief "Coolness"</a> | <a href="#2003-06">Evil Millie</a> | <a href="#2003-07">Spelling Bee</a> | <a href="#2003-08">The "Gay" Insult</a> | <a href="#2003-09">Weapons of Mass Destruction</a> | <a href="#2003-10">Fire Copyright</a> | <a href="#2003-11">The <I>Harry Potter</I> Syndrome</a> | <a href="#2003-12">Beach Vacation</a> | <a href="#2003-13">The Cutting of Mattress Tags</a>'

submenu[6]='<a href="#2004-01">Millie&#039;s Metamorphosis</a> | <a href="#2004-02">Zen Campaigning</a> | <a href="#2004-03">Avery&#039;s Self-Change</a> | <a href="#2004-04">More Early Campaigning</a> | <a href="#2004-05">Evil Eradication</a> | <a href="#2004-06">The Mercury Thermometer Incident</a> | <a href="#2004-07">Press Conferences</a> | <a href="#2004-08">Election Season</a> | <a href="#2004-09">Ozy&#039;s Mother</a>'

submenu[7]='<a href="#2005-01">Carbs</a> | <a href="#2005-02">Millie&#039;s Bath</a> | <a href="#2005-03">Poetry</a> | <a href="#2005-04">Jumprope</a> | <a href="#2005-05">School Violence</a> | <a href="#2005-06">Zen Avery</a> | <a href="#2005-07">Magazine Sales</a> | <a href="#2005-08">Junk Drawer</a> | <a href="#2005-09">Investigation</a> | <a href="#2005-10">Hair Protection</a> | <a href="#2005-11">Bald Millie</a> | <a href="#2005-12">Blackmail</a> | <a href="#2005-13">Homework Rebellion</a> | <a href="#2005-14">Novel Writing</a> | <a href="#2005-15">Eyesight</a> | <a href="#2005-16">Blogosphere</a> | <a href="#2005-17">Secret Santas</a>'

submenu[8]='<a href="#2006-01">The Walrus Ambassador</a> | <a href="#2006-02">Iambic Penslammeters</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=""
}



