<!--
/* PAGE ONLOAD EVENTS */

// define as a variable so pages can add additional functions to run on load
var onLoadScripts = "";
window.onload = function() {
  onLoadScripts += "createMouseovers();";
  setTimeout(onLoadScripts,50);
  }

/* DROP-DOWN MENU FUNCTION */

function dropDownPageSelect(selectBox,selectedOption,linkAddress) {
  var selectedLink = selectBox.options[selectedOption].value;
  if ((selectedLink != "#") && (selectedLink != ""))
    document.location = linkAddress + selectedLink;
  }

/* LEFT MENU BUTTON FUNCTIONS */

var myButt;

function buttonDepress(myTd) {
  if (document.getElementById)
    myButt = document.getElementById(myTd);
  else if (document.all)
    myButt = document.all.myTd;
  if (document.getElementById || document.all) {
    myButt.style.borderBottomColor = "#EDE7DD";
    myButt.style.borderTopColor = "#8A7143";
    myButt.style.backgroundColor = "#AF9E82";
    }
  }

function buttonUnDepress() {
  if (document.getElementById || document.all) {
    myButt.style.borderBottomColor = "#A98A52";
    myButt.style.borderTopColor = "#EDE9E2";
    myButt.style.backgroundColor = "#C7B796";
    }
  }

/* MOUSEOVER CREATION FUNCTION */
function createMouseovers() {
  var overExt = "-ON";
  if (document.getElementsByTagName) {
    var imgs = document.getElementsByTagName("IMG")
    var i, dotAt, imgFile, imgExt, preloads = new Array(imgs.length);
    for (i = 0; i < imgs.length; i++) {
      if (imgs[i].className && imgs[i].className == "mouseover") {
        dotAt  = imgs[i].src.lastIndexOf(".");
        if (dotAt > 0) {
          imgFile = imgs[i].src.substr(0,dotAt);
          imgExt  = imgs[i].src.substr(dotAt+1);
          if (imgFile.lastIndexOf(overExt) == imgFile.length - overExt.length) {
            // do nothing; image is already on
            }
          else {
            eval("imgs[i].onmouseover = function () {this.src = '" + imgFile + overExt + "." + imgExt + "'};");
            eval("imgs[i].onmouseout = function () {this.src = '" + imgFile + "." + imgExt + "'};");
            preloads[i]     = new Image;
            preloads[i].src = imgFile + overExt+ "." + imgExt;
            }
          }
        }
      }
    }
  }

/* MISCELLANEOUS FUNCTIONS */

function popupWindow(url,w,h) {
  var winProps = "toolbar=yes,location=no,directories=no,status=no,menubar=yes,resizable=yes,scrollbars=yes,width=" + w + ",height=" + h + ",left=10,top=10";
  var popupWin = window.open(url,"popupWin",winProps);
  popupWin.focus();
  }
//-->
