Código PHP:
var x;
var y;
var NS = (document.layers || (document.getElementById && !document.all)) ? true : false;
if (NS)
{
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = capturaMouse;
}
function capturaMouse(e)
{
x = e.pageX;
y = e.pageY;
}
function mostrarCapa(txt1)
{
x = (NS) ? x : event.clientX + document.body.scrollLeft;
y = (NS) ? y : event.clientY + document.body.scrollTop;
if (document.getElementById('p1'))
{
capa = document.getElementById('info');
pa1 = document.getElementById('p1');
pa1.innerHTML = txt1;
capa.style.visibility = 'visible';
capa.style.top = y - capa.offsetHeight/2;
posMax = parseInt(document.body.clientWidth - (capa.offsetWidth+5));
if ((x+20) >= posMax) capa.style.left = posMax;
else capa.style.left = x + 20;
}
}
function ocultarCapa()
{
if (document.getElementById('p1'))
{
capa = document.getElementById('info');
capa.style.visibility = 'hidden';
}
}
hay algo mal??