  wmtt = null;
  
  document.onmousemove = updateWMTT;
  
  function updateWMTT(e) {
  	x = (document.all) ? window.event.x + document.documentElement.scrollLeft : e.pageX;
  	y = (document.all) ? window.event.y + document.documentElement.scrollTop  : e.pageY;
  	if (wmtt != null) {
  		wmtt.style.left = (x + 20) + "px";
  		wmtt.style.top 	= (y + 20) + "px";
  	}
  	if (wmtt != null) {
    	if((parseInt(wmtt.style.left)+parseInt(wmtt.style.width))+30 > document.body.offsetWidth){
        // switch x-position of tooltip to avoid vertical overflow
        wmtt.style.left = (x - parseInt(wmtt.style.width) - 40) + "px";
      }
    }
  }
  
  function showWMTT(id) {
  	wmtt = document.getElementById(id);
  	wmtt.style.display = "block"
  }
  
  function hideWMTT() {
  	wmtt.style.display = "none";
  }

