document.documentElement.onmouseout = function() {
var e = document.createElement('div');
e.style.cssText = 'position: fixed; left: 5px; top: 5px; padding: 2px; background: #fff; border: 1px solid #000;'
var hideTm, hide = function() { document.body.removeChild(e); hideTm = 0; };
return function(ev) {
var rt = ev ? ev.relatedTarget : event.toElement;
e.innerHTML = 'related target: ' + (rt && rt.tagName);
document.body.appendChild(e);
if (hideTm) window.clearTimeout(hideTm);
hideTm = window.setTimeout(hide, 2000);
}
}();