var pre;
var post;
var DOM = 0;
var oLastDiv = '';
var oTimer = setTimeout("clearMenu()", 200);

if (document.layers){
  //Netscape 4 specific code
  pre = 'document.';
  post = '';
  DOM = 1
}
if (document.getElementById){
  //Netscape 6 specific code
  pre = 'document.getElementById("';
  post = '").style';
  DOM = 1;
}
if (document.all){
  //IE4+ specific code
  pre = 'document.all.';
  post = '.style';
  DOM = 1;
}

function loadMenu( oLayer ) {
  if ( DOM == 1 ) {
    showMenu( oLayer )
  } else {
    var s = "default.asp?page=" + oLayer + ".htm"
    window.location.href = s
  }
}

function showMenu( oLayer ) {
  if (( DOM == 1 ) && ( isLoaded == "Yes" )) {
    clearMenu();
    eval(pre + oLayer + post).left = getLeftEdge()
    eval(pre + oLayer + post).visibility = 'visible';
    oLastDiv = oLayer;
  // oTimer = setTimeout("clearMenu()", 200);
  }
}

function clearMenu() {
  if (oLastDiv != "") {
    eval(pre + oLastDiv + post).visibility = 'hidden';
  }
  clearTimeout(oTimer)
}

function highLight(Obj) {
  Obj.style.background ="#e6fef2";
  clearTimeout(oTimer)
}

function unHighLight(Obj) {
  Obj.style.background ="White";
  oTimer = setTimeout("clearMenu()", 200);
}

function setReady() {
  isLoaded = 1;
}


//  ---[ Object Positioning Functions ]---

function windowWidth() {
  var nWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    nWidth = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth  ) {
    nWidth = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
    nWidth = document.body.clientWidth;
  }
  return nWidth
}

function getLeftEdge() {
  var nWidth = parseInt(windowWidth());
  var nPos = (nWidth < 760) ? 124 : 124 + ((nWidth - 760)/2);
  return nPos;
}


