// Regular Scripts

// Page Functions
function pagePrint()
{
  window.print();
}
















function setEvent(o,v,i) //event registration
{
  if (i!=null && o!=null && v=="mouseover")
  {
    if (isIE) o.attachEvent("onmouseover",function () {tags[i].mouseover();});
    else o.addEventListener("mouseover",tags[i].mouseover,false);
  }
  else if (i!=null && o!=null && v=="mouseout")
  {
    if (isIE) o.attachEvent("onmouseout",function () {tags[i].mouseout();});
    else o.addEventListener("mouseout",tags[i].mouseout,false);
  }
  return null;
} //setEvent

var myMenu = {
  index: null,
  items: new Array(),
  cursor: null,
  timer: null
};//end myMenu

function setMenu()
{
  myMenu.index=idIndex("drop");
  if (myMenu.index!=null)
  {
    for (n=0; n<tags[myMenu.index].childNodes.length; n++) //for every list item
    {
      myMenu.items[n] = objIndex(tags[myMenu.index].childNodes[n]);
      tags[myMenu.items[n]].index=n;
      tags[myMenu.items[n]].mouseover=showMenu;
      setEvent(tags[myMenu.index].childNodes[n],"mouseover",myMenu.items[n]);
      tags[myMenu.items[n]].mouseout=softShut;
      setEvent(tags[myMenu.index].childNodes[n],"mouseout",myMenu.items[n]);
    } //for
  } //if
} //setMenu

function showMenu()
{
  if (myMenu.cursor!=null && myMenu.cursor!=this.index)
  {
    shutMenu(myMenu.items[myMenu.cursor]);
  }
  if (myMenu.timer!=null)
  {
    clearTimeout(myMenu.timer);
    myMenu.timer=null;
  }
  if (myMenu.cursor!=this.index)
  {
    myMenu.cursor=this.index;
    if (tags[myMenu.items[myMenu.cursor]].className)
    {
      tags[myMenu.items[myMenu.cursor]].oldClass = tags[myMenu.items[myMenu.cursor]].className;
      tags[myMenu.items[myMenu.cursor]].className = tags[myMenu.items[myMenu.cursor]].className + " show";
    }
    else tags[myMenu.items[myMenu.cursor]].className = "show";
  }
  return null;
}

function shutMenu(ind)
{
  if (tags[ind].className)
  {
    if (tags[ind].className!="show") tags[ind].className=tags[ind].oldClass;
    else tags[ind].className = "";
  }
  myMenu.cursor=null;
  return null;
} //shutMenu

function softShut() { myMenu.timer=setTimeout("shutMenu(myMenu.items[myMenu.cursor])",1600); return null; }//softShut

var isIE = false;
var app = {init: function () {this.browser = this.load(this.list) || "An unknown browser"; return;}, load: function (x) {for (var i=0;i<x.length;i++) {var ds = x[i].s; var dp = x[i].prop; if (ds) {if (ds.indexOf(x[i].ss) != -1) return x[i].id;else if (dp) return x[i].id;}} return;}, list: [{s: navigator.userAgent, ss: "OmniWeb", vs: "OmniWeb/", id: "OmniWeb"},{s: navigator.vendor, ss: "Apple", id: "Safari"},{prop: window.opera, id: "Opera"},{s: navigator.vendor, ss: "iCab", id: "iCab"},{s: navigator.vendor, ss: "KDE", id: "Konqueror"},{s: navigator.userAgent, ss: "Firefox", id: "Firefox"},{s: navigator.vendor, ss: "Camino", id: "Camino"},{s: navigator.userAgent, ss: "Netscape", id: "Netscape"},/*Net(6+)*/{s: navigator.userAgent, ss: "MSIE", id: "Explorer", vs: "MSIE"},{s: navigator.userAgent, ss: "Gecko", id: "Mozilla", vs: "rv"},{s: navigator.userAgent, ss: "Mozilla", id: "Netscape", vs: "Mozilla"}/*Net (4-)*/]}; //Browser Detect -Quirksmode.org
var tags = new Array();
function loadTags() { if (document.all && isIE) tags=document.all; else tags=document.getElementsByTagName('*'); return; } //loadTags
function objIndex(o) { for (t=0; t<tags.length; t++) { if (tags[t]==o) return t; } return null; } //objIndex
function idIndex(i) { for (t=0; t<tags.length; t++) { if (tags[t].id==i) return t; } return null; } //idIndex


function pageLoad()
{
  app.init();
  if (app.browser=="Explorer") isIE=!isIE;
  loadTags();
  var check = idIndex("calculatorForm");
  if (check!=null) setCalculator();
  setMenu();
} //pageLoad



window.onload = pageLoad;
