var ns = !document.all;
var xOff = 0;
var yOff = 20;
var ttVisible = false;
var ttEl = null;
var ttStyle = null;

function tooltipOnLoad() {
  ttEl = ns ? document.getElementById('idTooltip') :
    document.all.idTooltip;
  if(ttEl ==  null) return;
  ttStyle = ttEl.style;
  if(ttStyle ==  null) return;
  ttStyle.visibility='visible';
  ttStyle.display='none';
  ttVisible = false;
  document.onmousemove = tooltipProcMouseMove;
}

function tooltipProcMouseMove(e) {
  if(ttVisible) return;
  if(ttEl ==  null || ttStyle ==  null) return;
  var x = ns ? e.pageX : event.x + document.body.scrollLeft;
  ttStyle.left=x + xOff;
  var y = ns ? e.pageY : event.y + document.body.scrollTop;
  ttStyle.top=y + yOff;
}

function tooltipShow(msg) {
  if(msg == null || msg == '') return;
  if(ttEl ==  null || ttStyle ==  null) return;
  var s =
'<table border=1 bordercolor=black '+
'cellpadding=2 cellspacing=0>'+
'<tr><td class=tdTooltip>'+
msg+
'</tr></td></table>';
  ttEl.innerHTML = s;
  ttStyle.display = 'inline';
  ttVisible = true;
}

function tooltipKill(){
  if(ttEl ==  null || ttStyle ==  null) return;
  ttStyle.display = 'none';
  ttVisible = false;
}
