/* */
timerID=null;
isLoaded=false;
layermenudirection=null;

/*
 * Get an object DOM-, IE4- or NS4-style
 * (by Peter-Paul Koch, see http://www.xs4all.nl/~ppk/js/index.html)
 */
function getObj(name) {
  if (document.getElementById) {
    this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;
  } else if (document.all) {
    this.obj = document.all[name];
    this.style = document.all[name].style;
  } else if (document.layers) {
    this.obj = document.layers[name];
    this.style = document.layers[name];
  }
}

function showMenu() {
  if (navigator.appVersion.substring(0,1)<4 || !isLoaded) return;
  if(timerID) {
    clearTimeout(timerID);
    timerID=null;
  }
  var lm = new getObj('layerMenu');
  var qf = new getObj('quickfinder');
  if (lm && qf) {
    if (navigator.appName == 'Netscape' &&
        navigator.appVersion.substring(0,1) == 4) {
      if (layermenudirection == 'horizontal') {
        lm.obj.x=2;
      } else {
        lm.obj.x=qf.obj.pageX+2;
      }
      lm.obj.y=qf.obj.pageY+70;
    } else {
      if (layermenudirection == 'horizontal') {
        lm.style.left=2;
      } else {
        lm.style.left=qf.obj.parentNode.offsetLeft+4;
      }
      if (qf.obj.offsetHeight) {
        h = qf.obj.offsetHeight;
      } else {
        h = 70;
      }
      lm.style.top=qf.obj.parentNode.offsetTop+h;
    }
    lm.style.visibility="visible";
  }
}

function hideMenu() {
  var lm = new getObj('layerMenu');
  lm.style.visibility="hidden";
}
		
function fadeOut() {
  if (navigator.appVersion.substring(0,1)<4) return;
  if(timerID) {
    clearTimeout(timerID);
    timerID=null;
  }
  timerID=setTimeout("hideMenu()",500);
}

/* Function that swaps images. */

function di20(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

