
function getMouseX(e) {
  var IE = document.all?true:false
  if (!e) e = window.event;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = e.clientX;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
  }
  return tempX;
}
function getMouseY(e) {
  var IE = document.all?true:false
  if (!e) e = window.event;
  if (IE) { // grab the x-y pos.s if browser is IE
    var scrollpos = document.body.scrollTop;
    if (document.body.scrollTop==0) scrollpos = document.documentElement.scrollTop; 
    tempY = e.clientY + scrollpos;
  } else {  // grab the x-y pos.s if browser is NS
    tempY = e.pageY;
  }
  return tempY
}
function positionitem (itemid, X, Y) {
 document.getElementById(itemid).style.top = Y;
 document.getElementById(itemid).style.left = X;
}

function settooltip (itemid, itemcontent, e) {
 if (itemcontent!=='') {
  var target = document.getElementById(itemid);
  target.innerHTML = itemcontent; 
  //positionitem (itemid, getMouseX(e), getMouseY(e));
  target.style.top = getMouseY(e)+"px";
  target.style.left = getMouseX(e)+"px";
  target.style.display = "block";
 }
}

function cleartooltip (itemid) {
 if (itemid!==null) document.getElementById(itemid).style.display = "none";
}

