var ie = document.all;
var ns6 = document.getElementById && !ie;

var tipactive = false;
var tooltip_y = 0;
var tooltip_x = 0;

if (ie) {
  var tip = document.all["tooltip"];
} else if (ns6) {
  var tip = document.getElementById? document.getElementById("tooltip") : "";
}

function showtip(text) {
  if (ie || ns6) {
    tipactive = true;
    tip.innerHTML = text;
    tip.style.left = (tooltip_x-200) + "px";
    tip.style.top =  (tooltip_y+10) + "px";
    tip.style.visibility="visible";    
    return false;
  }  
}

function positiontip(e) {
    if (ie) {
      tooltip_y = event.y + document.body.scrollTop;
      tooltip_x = event.x + document.body.scrollLeft;
    } else if (ns6) {
      tooltip_y = e.pageY;
      tooltip_x = e.pageX;
    }
  if (tipactive) {
    tip.style.left = (tooltip_x-200) + "px";
    tip.style.top =  (tooltip_y+10) + "px";
  }  
}

function hidetip(){
  if (ns6||ie){
    tipactive = false;
    tip.style.visibility = "hidden";
    tip.style.left="-1000px";
  }
}

document.onmousemove = positiontip;
