// JavaScript Document
// Div Floating Popup JScript Routine
// ----------------------------------
//
//	Add <body onLoad="init();" id="thepage"> to activate
//	and call with ---->> onMouseover="doText('Hi!<br>This is the Text', this);" onMouseOut="doClear();" <<---
//	on any element.
//
// Start The Mouse Trapping Routine
if (document.layers) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=mtrack;
var ent; // The floating div object
var posx=0; // mouseX
var posy=0; // mouseY
var offsetX=16; // Offset X Div From Mouse
var offsetY=16; // Offset Y
var popUp = false; // Display = False

// Initialisation Routine
function init() {
ent = document.createElement("div");

//
// Style The Popup Box HERE!
//
ent.style.color = "#000000";
ent.style.font = "normal 9px verdana";
ent.style.padding = "1px 1px 1px 1px";
ent.style.background = "#FFFFCC";
ent.style.border = "1px Solid #cccccc";
//
//
//

// Don't change these
ent.style.left = -100;
ent.style.top = -100;
ent.style.position = 'absolute';
ent.innerHTML = '';
ent.style.zIndex = 10;
document.getElementById("thepage").appendChild(ent);
}

// Mouse Tracking Math Routine
function mtrack(e) {
if (popUp) {
if (!e) var e = window.event;
if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft;
posy = e.clientY + document.body.scrollTop;
}
ent.style.left = posx + offsetX;
ent.style.top = posy + offsetY;
}
}

// Change floating div to correct text on mouseover
function doText(t, e) {
popUp = true;
ent.innerHTML = t;
}

// Change back to nothing
function doClear() {
popUp = false;
ent.style.left = -100;
ent.style.top = -100;
ent.innerHTML = "";
}
