var version = 0;
var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
check_version();

function check_version () {
   // need to check for browser capability
   if (browserName == "Netscape" && browserVer <= 4) {
        version = 4;

 	// adjust style sheet if needed (and if possible)
 	if (document.tags != null) {
	   document.tags.BODY.marginLeft = "-5em";
	   document.tags.BODY.marginTop = "-5em";
	}
   } else if (browserName == "Netscape" && browserVer >= 3) {
	version = 3;

   } else if (browserName != "Netscape") {
        browserVer = parseInt(window.clientInformation.appVersion);
        if (browserVer >= 3) {
                version = 3;
        }
   }
   this.version = version;
//   window.onerror = log_error;
}

function log_error (message, url, line) {
    return true;
}

function install_img (name, on_url, off_url) {
  var version = this.version;
  if (version >= 3) {
    var img_off = name + "0";
    var img_on = name + "1";

    document[img_off] = new Image();
    document[img_off].src = off_url;

    document[img_on] = new Image();
    document[img_on].src = on_url;
  }

}

function highlight (layer, topic) {
  var doc;

  if ((layer == null) && (topic == null)) {
    return true;
  }

  if (topic == null) {
    // assume only one argument (the topic) given to function
    topic = layer;
    layer = null;
  }

  if ((layer != null) && (document.layers != null) && 
      (document.layers[layer] != null)) {
    doc = document.layers[layer].document;
  } else {
    doc = document;
  }

  if (doc.images[topic] == null) {
    return true;
  }

  var img_name = topic + "1";
  doc.images[topic].src = document[img_name].src; // changes image
  return true;
}

function leave (layer, topic) {
  var doc;

  if ((layer == null) && (topic == null)) {
    return true;
  }

  if (topic == null) {
    // assume only one argument (the topic) given to function
    topic = layer;
    layer = null;
  }

  if ((layer != null) && (document.layers != null) && 
      (document.layers[layer] != null)) {
    doc = document.layers[layer].document;
  } else {
    doc = document;
  }

  if (doc.images[topic] == null) {
    return true;
  }

  var img_name = topic + "0";
  doc.images[topic].src = document[img_name].src; // changes image
  return true;
}

