<!--
// Copyright (c) 2000 internet.com Corp. 
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Yehuda Shiran.
// docjslib version 3.1. Released February 25, 2001.
// docjslib is a cross-browser library. You should not worry about the browser in your code.

//Determine browser type
function browserSniffer() {
  this.ie4 = document.all && !document.getElementById;
  this.ns4 = document.layers;
  this.ie5 = document.all && document.getElementById;
  this.ns6 = document.getElementById && !document.all;
}

//Choose and affix the proper Subclass
function createTheProperSubClass() {
  var browserType = new browserSniffer();
  if (browserType.ie4) {
    this.className = "docjslibIE4SubClass";
  }
  else if (browserType.ie5) {
    this.className = "docjslibIE5SubClass";
  }
  else if (browserType.ns4) {
    this.className = "docjslibNS4SubClass";
  }
  else if (browserType.ns6) {
    this.className = "docjslibNS6SubClass";
  }
  this.getTheProperSubClass = getTheProperSubClassMethod;
    function getTheProperSubClassMethod() {
    // example: return new docjslibIE5SubClass();
	return eval('new ' + this.className + '()');
  }
}
var browserType = new browserSniffer();
if (browserType.ie5) {
function docjslibIE5SubClass() {
  this.inheritFrom = docjslibSuperClass;
  this.inheritFrom();
  
  this.getSrc = getSrcMethod;
  this.setSrc = setSrcMethod;
  this.setPosFromLeft = setPosFromLeftMethod;
  this.setPosFromTop = setPosFromTopMethod;
  this.setZposition = setZpositionMethod;
  this.setVisibility = setVisibilityMethod;
  this.doThisCommandEveryIntervalMS = doThisCommandEveryIntervalMSMethod;
  this.getWindowWidth = getWindowWidthMethod;
  this.getWindowHeight = getWindowHeightMethod;
  this.getPageScrollLeft = getPageScrollLeftMethod;
  this.getPageScrollTop = getPageScrollTopMethod;
  this.findHighestZ = findHighestZMethod;

  function getSrcMethod(id) {
    return document.getElementById(id).src;
  }

  function setSrcMethod(id, url) {
    document.getElementById(id).src = url;
  }
  
  function setPosFromLeftMethod(id, xCoord) {
    document.getElementById(id).style.left = xCoord;
  }
  
  function setPosFromTopMethod(id, yCoord) {
    document.getElementById(id).style.top = yCoord;
  }

  function setZpositionMethod(id, z) {
    document.getElementById(id).style.zIndex = z;
  }
  
  function setVisibilityMethod(id, flag) {
    var str = (flag) ? 'visible' : 'hidden';
    document.getElementById(id).style.visibility = str;
  }

  function doThisCommandEveryIntervalMSMethod(command, interval) {
    setInterval(eval('"' + command + '"'), interval);
  }

  function getWindowWidthMethod() {
    return document.body.clientWidth;
  }

  function getWindowHeightMethod() {
    return document.body.clientHeight;
  }

  function getPageScrollLeftMethod() {
    return document.body.scrollLeft;
  }

  function getPageScrollTopMethod() {
    return document.body.scrollTop;
  }
  
  function findHighestZMethod() {
    var documentDivs = new Array();
    document.divs = document.getElementById("DIV");
    var highestZ = 0;
    for (var i = 0; i < documentDivs.length; i++) {
      var zIndex = documentDivs[i].style.zIndex;
      highestZ = (zIndex > highestZ) ? zIndex : highestZ;
    }
    return highestZ;
  }
 }
}
else if (browserType.ie4) {function docjslibIE4SubClass() {
  this.inheritFrom = docjslibSuperClass;
  this.inheritFrom();
  
  this.getSrc = getSrcMethod;
  this.setSrc = setSrcMethod;
  this.setPosFromLeft = setPosFromLeftMethod;
  this.setPosFromTop = setPosFromTopMethod;
  this.setZposition = setZpositionMethod;
  this.setVisibility = setVisibilityMethod;
  this.doThisCommandEveryIntervalMS = doThisCommandEveryIntervalMSMethod;
  this.getWindowWidth = getWindowWidthMethod;
  this.getWindowHeight = getWindowHeightMethod;
  this.getPageScrollLeft = getPageScrollLeftMethod;
  this.getPageScrollTop = getPageScrollTopMethod;
  this.findHighestZ = findHighestZMethod;

  function getSrcMethod(id) {
    return eval("document.all." + id + "img.src");
  }
  
  function setSrcMethod(id, url) {
    eval("document.all." + id).src = url;
  }
  
  function setPosFromLeftMethod(id, xCoord) {
    eval("document.all." + id).style.left = xCoord;
  }
  
  function setPosFromTopMethod(id, yCoord) {
    eval("document.all." + id).style.top = yCoord;
  }

  function setZpositionMethod(id, z) {
    eval("document.all." + id).style.zIndex = z;
  }

  function setVisibilityMethod(id, flag) {
    var str = (flag) ? 'visible' : 'hidden';
    eval("document.all." + id).style.visibility = str;
  }
  
  function doThisCommandEveryIntervalMSMethod(command, interval) {
    setInterval(eval('"' + command + '"'), interval);
  }

  function getWindowWidthMethod() {
    return document.body.clientWidth;
  }

  function getWindowHeightMethod() {
    return document.body.clientHeight;
  }

  function getPageScrollLeftMethod() {
    return document.body.scrollLeft;
  }

  function getPageScrollTopMethod() {
    return document.body.scrollTop;
  }
  
  function findHighestZMethod() {
    var documentDivs = new Array();
    documentDivs = document.all.tags("DIV");
    var highestZ = 0;
    for (var i = 0; i < documentDivs.length; i++) {
      var zIndex = documentDivs[i].style.zIndex;
      highestZ = (zIndex > highestZ) ? zIndex : highestZ;
    }
    return highestZ;
  }
 }
}
else if (browserType.ns4) {function docjslibNS4SubClass() {
  this.inheritFrom = docjslibSuperClass;
  this.inheritFrom();
  
  this.getSrc = getSrcMethod;
  this.setSrc = setSrcMethod;
  this.setPosFromLeft = setPosFromLeftMethod;
  this.setPosFromTop = setPosFromTopMethod;
  this.setZposition = setZpositionMethod;
  this.setVisibility = setVisibilityMethod;
  this.doThisCommandEveryIntervalMS = doThisCommandEveryIntervalMSMethod;
  this.getWindowWidth = getWindowWidthMethod;
  this.getWindowHeight = getWindowHeightMethod;
  this.getPageScrollLeft = getPageScrollLeftMethod;
  this.getPageScrollTop = getPageScrollTopMethod;
  this.findHighestZ = findHighestZMethod;
  
  function getSrcMethod(id) {
    return eval("document." + id + ".document." + id + ".src");
  }
  
  function setSrcMethod(id, url) {
    eval("document." + id + ".document." + id).src = url;
  }
  
  function setPosFromLeftMethod(id, xCoord) {
    eval("document." + id).left = xCoord;
  }
  
  function setPosFromTopMethod(id, yCoord) {
    eval("document." + id).top = yCoord;
  }

  function setZpositionMethod(id, z) {
    eval("document." + id).zIndex = z;
  }

  function setVisibilityMethod(id, flag) {
    var str = (flag) ? 'show' : 'hide';
    eval("document." + id).visibility = str;
  }
  
  function doThisCommandEveryIntervalMSMethod(command, interval) {
  setInterval(eval('"' + command + '"'), interval);
  }

  function getWindowWidthMethod() {
    return window.innerWidth;
  }

  function getWindowHeightMethod() {
    return window.innerHeight;
  }

  function getPageScrollLeftMethod() {
    return window.pageXOffset;
  }

  function getPageScrollTopMethod() {
    return window.pageYOffset;
  }
  
  function findHighestZMethod() {
    var documentDivs = new Array();
    documentDivs = document.layers;
    var highestZ = 0;
    for (var i = 0; i < documentDivs.length; i++) {
      var zIndex = documentDivs[i].zIndex;
      highestZ = (zIndex > highestZ) ? zIndex : highestZ;
    }
    return highestZ;
  }
}}
else if (browserType.ns6) {function docjslibNS6SubClass() {
  this.inheritFrom = docjslibSuperClass;
  this.inheritFrom();
  
  this.getSrc = getSrcMethod;
  this.setSrc = setSrcMethod;
  this.setPosFromLeft = setPosFromLeftMethod;
  this.setPosFromTop = setPosFromTopMethod;
  this.setZposition = setZpositionMethod;
  this.setVisibility = setVisibilityMethod;
  this.doThisCommandEveryIntervalMS = doThisCommandEveryIntervalMSMethod;
  this.getWindowWidth = getWindowWidthMethod;
  this.getWindowHeight = getWindowHeightMethod;
  this.getPageScrollLeft = getPageScrollLeftMethod;
  this.getPageScrollTop = getPageScrollTopMethod;
  this.findHighestZ = findHighestZMethod;

  function getSrcMethod(id) {
    return document.getElementById(id).src;
  }

  function setSrcMethod(id, url) {
    document.getElementById(id).src = url;
  }
  
  function setPosFromLeftMethod(id, xCoord) {
    document.getElementById(id).style.left = xCoord;
  }
  
  function setPosFromTopMethod(id, yCoord) {
    document.getElementById(id).style.top = yCoord;
  }

  function setZpositionMethod(id, z) {
    document.getElementById(id).style.zIndex = z;
  }
  
  function setVisibilityMethod(id, flag) {
    var str = (flag) ? 'visible' : 'hidden';
    document.getElementById(id).style.visibility = str;
  }
  
  function doThisCommandEveryIntervalMSMethod(command, interval) {
    setInterval(eval('"' + command + '"'), interval);
  }

  function getWindowWidthMethod() {
    return window.innerWidth;
  }

  function getWindowHeightMethod() {
    return window.innerHeight;
  }

  function getPageScrollLeftMethod() {
    return window.pageXOffset;
  }
  
  function getPageScrollTopMethod() {
    return window.pageYOffset;
  }
  
  function findHighestZMethod() {
    var documentDivs = new Array();
    document.divs = document.getElementById("DIV");
    var highestZ = 0;
    for (var i = 0; i < documentDivs.length; i++) {
      var zIndex = documentDivs[i].style.zIndex;
      highestZ = (zIndex > highestZ) ? zIndex : highestZ;
    }
    return highestZ;
  }
}}

//Load cross-browser Superclass
function docjslibSuperClass() {
  this.makeImage = makeImageMethod;

  function makeImageMethod(imgID,  // given id
                   imgURL,         // image URL
                   imgHeight,      // image height
                   imgWidth,       // image width
                   imgAlt,         // alternative image
                   posFromLeft,    // absolute position from left of window
                   posFromTop,     // absolute position from top of window
                   clickParam1,    // parameter passed to "onclick" handler
                   clickParam2)    // parameter passed to "onclick" handler
  {
    document.write(
    '<STYLE TYPE="text/css">',
    '#', imgID, ' {',
      'position: absolute;',
      'left: ', posFromLeft, ';',
      'top: ', posFromTop, ';',
      'width: ', imgWidth, ';',
      'z-index: 1',
    '}',
    '</STYLE>',
    '<DIV ID="', imgID, '">',
    '<A HREF="javascript:', "handleImageClick('", imgID, "'", ',', clickParam1, ',', 
    clickParam2, ')">',
    '<IMG NAME="', imgID, 'img" ID="', imgID, 'img" SRC="', imgURL, '" ALT="', imgAlt, 
    '" BORDER="0" ', 'HEIGHT="', imgHeight, '" WIDTH="', imgWidth, '">',
    '</A></DIV>'
    );
  }
}
// End docjslib Version 3.1
//-->
