FireFox Error Console
Warning: Use of captureEvents() is deprecated. To upgrade your code, use the DOM 2 addEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.addEventListener
Warning: Error in parsing value for 'visibility'. Declaration dropped.
Error: document.object1 is undefined
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all ? true : false
// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
function show() {
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;
}
function hide() {
document.onmousemove = null;
document.getElementById('object1').style.display = "none";
}
// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0) { tempX = 0 }
if (tempY < 0) { tempY = 0 }
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
document.getElementById('object1').style.top = tempY + 15 + 'px';
document.getElementById('object1').style.left = tempX + 20 + 'px';
document.getElementById('object1').style.display = "block";
return true
}
<div id="object1" style="position: absolute;top:0px;left:0px; display:none; z-index: 100">