Hola señores
De todos modos preferi dividir la funcion y aplicarla con eventos directamente al objeto de esta forma:
Código HTML:
function tooltipOverThis (obj)
{
var ob = document.getElementById(obj.id);
//
var tit = ob.title;
window.tempObjTitle = tit;
ob.removeAttribute ('title');
//
var tt = document.createElement ('div');
tt.style.backgroundColor = '#000';
tt.style.fontFamily = 'Helvetica, Arial, sans-serif';
tt.style.fontSize = '10px';
tt.style.color = '#FFF';
tt.style.border = 'solid 1px #FFF';
tt.style.padding = '6px';
tt.style.position = 'absolute';
tt.style.display = 'none';
tt.id = 'lyrtooltip';
tt.innerHTML = tit;
document.body.appendChild (tt);
tt.style.zoom = 1;
//
document.onmousemove = function (evt)
{
tt.style.left = ( parseInt (mouseX(evt)) + 15 ) + 'px';
tt.style.top = ( parseInt (mouseY(evt)) - 5 ) + 'px';
tt.style.display = 'block';
}
}
function tooltipOutThis (obj)
{
document.getElementById(obj.id).title = window.tempObjTitle;
//
var tt = document.getElementById('lyrtooltip');
tt.style.display = 'none';
document.body.removeChild (tt);
document.onmousemove = null;
}
Código HTML:
<div title="El titulo con ID" id="este" onmouseover="tooltipOver(this);" onmouseout="tooltipOut(this);">Esto es un div con title y ID</div>