var dhtml = 0;
var _ax1 = 0;
var _ax2 = 0;
var _ax3 = 0;

if (document.getElementById) {
	_ax3 = 1;
	dhtml = 1;
} else {
  if (document.all) { _ax2 = 1; dhtml = 1; }
  else { browserVersion = parseInt(navigator.appVersion);
  if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { _ax1 = 1; dhtml = 1; } }
}

function getStyle(_obj, _x) {
	if (_x) {
		if (_ax3) {
			return (document.getElementById(_obj).style);
	} else {
			if (_ax2) {
				return (document.all[_obj].style);
			} else {
				if (_ax1) return (document.layers[_obj]);
			}
		}
	} else {
		if (_ax3) {
			return (document.getElementById(_obj));
		} else {
			if (_ax2) {
				return (document.all[_obj]);
			} else {
				if (_ax1) return (document.layers[_obj]);
			}
		}
	}
}

function getWidth() {
  if (window.innerWidth != null) return window.innerWidth;
  if (document.body.clientWidth != null) return document.body.clientWidth;
  return (null);
}

function tooltip(evt, _obj) {
	if (dhtml) {
		var _xwp = getWidth();
		_xds = getStyle(_obj, 1);
		_xdm = getStyle(_obj, 0);
		_xst = _xds.visibility;
		if (_xdm.offsetWidth) {
			_xew = _xdm.offsetWidth;
		} else if (_xdm.clip.width) {
			_xew = _xdm.clip.width;
		}
		if (_xst == "visible" || _xst == "show") {
			_xds.visibility = "hidden";
		} else {
			if (evt.y || evt.pageY) {
				if (evt.pageY) {
					_xtv = evt.pageY + 0;
					_xlv = evt.pageX - (_xew / 100) + 20;
				} else {
					if (document.documentElement && document.documentElement.scrollTop) {
						_xtv = evt.y + 0 + document.documentElement.scrollTop;
						_xlv = evt.x - (_xew / 100) + 20 + document.documentElement.scrollLeft;
					} else {
						_xtv = evt.y + 0 + document.body.scrollTop;
						_xlv = evt.x - (_xew / 100) + 20 + document.body.scrollLeft;
					}
				}
				if (_xlv < 2) {
					_xlv = 2;
				} else if (_xlv + _xew > _xwp) {
					_xlv -= _xew / 2;
				}
				if (!_ax1) {
					_xlv += 'px';
					_xtv += 'px'
				}
				_xds.left = _xlv;
				_xds.top = _xtv;
			}
			_xds.visibility = "visible";
		}
	}
}
