// Default section - before any navigation items are clicked.
var activesection = null;
var initialsection = 'bio';

onload = function () {
   swap ( initialsection, 'in' );
   activesection = initialsection;
}

function swap ( section, type ) {
   if ( section != activesection ) {
      if ( type == 'in' ) {
         bgimage = 'url(/images/fachovernavback.gif)';
         bgcolor = '#CFFE4C';
         fgcolor = '#373634';
      }

      else {
         bgimage = 'url(/images/facnavback.gif)';
         bgcolor = '#000000';
         fgcolor = '#FFFFFF';
      }

      navitem = document.getElementById ( section );
      navitem.style.backgroundImage = bgimage;
      navitem.style.backgroundColor = bgcolor;
      navitem.style.color = fgcolor;
   }
}

function unswapall () {
   var sections = new Array ( 'bio', 'works', 'courses', 'links' );
   var i = 0;
   while ( sections[i] ) {
      swap ( sections[i], 'out' );
      i++;
   }
}

function link ( section, name ) {
   activesection = null;
   unswapall ();
   swap ( section, 'in' );
   activesection = section;
   frames['contentbody'].location.href = '?id=' + name +"&where=" +section;
}

