var h_visible=h=h_height=h_width=0;
document.onmousemove=mousemove;

function initialise() {
  h=document.createElement("div");
  h.appendChild(document.createTextNode("."));
  h.style.position="absolute";
  h.style.zIndex="5";
  h.style.backgroundColor="#f0f7ff";
  h.style.color="#008";
  h.style.border="1px outset";
  h.style.padding="1px";
  h.style.textAlign="center";
  h.style.filter="alpha(opacity=80)";
  if(!document.all && h.style.setProperty) h.style.setProperty('-moz-opacity', 0.8, '');
  h.style.visibility="hidden";
  document.body.appendChild(h);
}

function scro() {
  var scr=0;
  if (typeof(self.pageYOffset)=="number") scr=self.pageYOffset;
  else if (document.body.scrollTop) scr=document.body.scrollTop;
  else if (document.documentElement && document.documentElement.scrollTop) scr=document.documentElement.scrollTop;
  return (scr);
}

function mousemove(e) { if (h_visible) {
  var xpos=ypos=swidth=sheight=0;
  xpos=(e)?e.pageX:event.clientX+document.body.scrollLeft;
  ypos=(e)?e.pageY:event.clientY+scro();
  if (xpos<0) xpos=0;
  if (ypos<0) ypos=0;
  if (typeof(self.innerWidth)=="number") {
    swidth=self.innerWidth-25;
    sheight=self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientWidth) {
    swidth=document.documentElement.clientWidth-25;
    sheight=document.documentElement.clientHeight;
  }
  else if (document.body.clientWidth) {
    swidth=document.body.clientWidth-25;
    sheight=document.body.clientHeight;
  }
  xpos+=(xpos+h_width+6>swidth)?-h_width-6:6;
  ypos+=(ypos+h_height+6-scro()>sheight)?-h_height:6;
  h.style.left=xpos+"px";
  h.style.top=ypos+"px";
  h.style.visibility="visible"
}}

function hint (text, width) { if (document.getElementById) {
  if (!h) initialise();
  if (text) {
	h_visible=1;
	h.firstChild.nodeValue=text;
	h_width=(width)?width:200;
	h.style.width=h_width+"px";
	h_height=h.offsetHeight;
  }
  else if (h_visible) {
    h_visible=0;
    h.style.visibility="hidden";
  }
}}