function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

function getObject( obj ) {
  if ( document.getElementById ) {
    obj = document.getElementById( obj );
  } else if ( document.all ) {
    obj = document.all.item( obj );
  } else {
    obj = null;
  }
  return obj;
}

function showWin(div,e,dy) {

  div = getObject( div );
  var _x;
  var _y;
  //if (document.all) {
  //  _x = 170 + document.body.scrollLeft;
  //  _y = event.clientY + document.body.scrollTop;
  //} else {
  //  _x = e.pageX -400;
  //  _y = e.pageY;
  //  if (_x < 170) {_x = 170}
  //}

  //if (IE) { // grab the x-y pos.s if browser is IE
  //  _x = 170 + document.body.scrollLeft
  //  _y = event.clientY + document.body.scrollTop
  //} else {  // grab the x-y pos.s if browser is NS
  //  _x = e.pageX
  //  _y = e.pageY
  //  if (_x < 170) {_x = 170}
  //}  
  //// catch possible negative values in NS4
  //if (_x < 0){_x = 0}
  //if (_y < 0){_y = 0}  

  if (IE) { // grab the x-y pos.s if browser is IE
    _x = document.body.scrollLeft +170;
    _y = document.body.scrollTop +event.clientY -dy;
  }
  //if (browser.isIE) { // grab the x-y pos.s if browser is IE
  //  _x = document.body.scrollLeft +170;
  //  _y = document.body.scrollTop +event.clientY;
  //}
  if (browser.isNS) {  // grab the x-y pos.s if browser is NS
    _x = window.scrollX +170;
    _y = e.pageY -dy;
  }  

  //if (document.documentElement && document.documentElement.scrollTop) {
  //  theTop = document.documentElement.scrollTop;
  //  theLeft = document.documentElement.scrollLeft;
  //} else if (document.body) {
  //  theTop = document.body.scrollTop;
  //  theLeft = document.body.scrollLeft;
  //} else {
  //  theTop = e.pageY;
  //  theLeft = window.scrollX;
  //}
  //_x = theLeft +170;
  //_y = theTop -dy;

  // catch possible negative values
  if (_x < 0){_x = 170}
  if (_y < 0){_y = 30}  

  div.style.top = _y + 'px';
  div.style.left = _x + 'px';
  div.style.display = "block";
  div.style.visibility = "visible";
}

function closeWin(div,e) { 
  div = getObject( div );
  div.style.display = "none";
  div.style.visibility = "hidden";
}

