
var started = false;
if (document.layers)
  document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = function (evt) {
  var cursor = 
     document.layers ? document.cursor :
     document.all ? document.all.cursor :
     document.getElementById ? document.getElementById('cursor') : null;
  if (!started) {
    if (document.layers)
      cursor.visibility = 'show';
    else 
      cursor.style.visibility = 'visible';
    started = true;
  }
  if (document.layers) {
    cursor.left = evt.pageX +20;
    cursor.top = evt.pageY +20;
  }
  else if (document.all) {
    cursor.style.pixelLeft = event.x +20;
    cursor.style.pixelTop = event.y +20;
  }
  else if (document.getElementById) {
    cursor.style.left = evt.pageX + '20px';
    cursor.style.top = evt.pageY + '20px';
  }
}  

