
function init(e)
{
  startList();
  externalLinks();
  setFocus();
  if(page=='')
  {
    fadein();
  }
}

// fix IE's non-support of hover
function startList()
{
  // is this IE/Win?
  if (document.all && document.getElementById)
  {
    navRoot = document.getElementById("topnavs");
    for (i=0; i<navRoot.childNodes.length; i++)
    {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI")
      {
        node.onmouseover=function()
        {
          this.className+=" over";
        }
        node.onmouseout=function()
        {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  } // end if IE/Win
} // end startList

// Target attribute is not allowed under xhtml "strict"
// use rel="external" in links to open new window
// (courtesy SitePoint.com)
function externalLinks()
{
  if (!document.getElementsByTagName) { return; }
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++)
  {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
        anchor.getAttribute("rel") == "external")
    {
      anchor.target = "_blank";
    }  // end if
  }  // end for
}  // end externalLinks

// set the entry focus to the first blank 
// in the first form displayed
function setFocus()
{
  return; // disabled until IE error is preventable
  if(document.forms[0])
  {
    var el = document.forms[0].elements[0];
    if(el.type == "text" || el.type == "textarea")
    {
      el.focus();
    }
  }
} // end setFocus

/*
           BetterMarquee
   Waters Gulch Digital text fader
   Copyright (C) 2005 Rik Nilsson
*/ 
hex=255 // Initial color value 255=white
function fadein()
{
  if(hex>0)
  { //If color is not black yet
    hex-=11; // increase color darkness
    document.getElementById("message").style.color="rgb("+hex+","+hex+","+hex+")";
    setTimeout("fadein()",100);
  } else {
    fadeout();
    //hex=255 //reset hex value
  }
}
function fadeout()
{
  if(hex<255)
  { //If color is not black yet
    hex+=11; // increase color darkness
    document.getElementById("message").style.color="rgb("+hex+","+hex+","+hex+")";
    setTimeout("fadeout()",100);
  } else {
    fadein();
    //hex=255 //reset hex value
  }
} // end BetterMarquee

window.onload = init;
