var offsetx = -200; var offsety = 8; var overx = 0; var overy = 0; var divtomove = null; var delayid = null; var overlapObjects = null; function OpenOver(div, text, e) { browser.setInnerHTML($(div), text); $(div).style.left = (browser.getCursorX(e)+offsetx)+'px'; $(div).style.top = (browser.getCursorY(e)+offsety)+'px'; $(div).style.visibility = 'visible'; divtomove = div; delayid = setTimeout("movethedivision()", 1); } function CloseOver(div) { $(div).style.visibility = 'hidden'; OverShowControl(); if (delayid != null) clearTimeout(delayid) delayid = null; divtomove = null; } function mouseMove(e) { overx = browser.getCursorX(e); overy = browser.getCursorY(e); } function movethedivision() { $(divtomove).style.left = (overx+offsetx)+'px'; $(divtomove).style.top = (overy+offsety)+'px'; if (!overlapObjects) { overlapObjects = new Array(); OverHideControl ("IFRAME", divtomove); OverHideControl ("SELECT", divtomove); OverHideControl ("OBJECT", divtomove); } delayid = setTimeout("movethedivision();", 100); } document.onmousemove = mouseMove; function OverHideControl (tagName, div) { if (!browser.isIE()) return; var x = document.all[div].offsetLeft; var y = document.all[div].offsetTop; var w = document.all[div].offsetWidth; var h = document.all[div].offsetHeight; var i; for (i = 0; i < document.all.tags(tagName).length; ++i) { var obj = document.all.tags(tagName)[i]; if (!obj || !obj.offsetParent) continue; if(obj.style.visibility == "hidden") continue; // check if the object and the div overlap var ox = OverGetX (obj); var oy = OverGetY (obj); var ow = obj.offsetWidth; var oh = obj.offsetHeight; // 150 pixels of security for X (links) if (ox > (x + w + 150) || (ox + ow + 150) < x) continue; // 20 pixels of security for Y (lines and gifs) if (oy > (y + h + 20) || (oy + oh + 20) < y) continue; overlapObjects[overlapObjects.length] = obj; obj.style.visibility = "hidden"; } } function OverShowControl () { if (overlapObjects) { var i; for (i = 0; i < overlapObjects.length; ++i) overlapObjects[i].style.visibility = ""; } overlapObjects = null; } function OverGetX(obj) { var x = 0; do { x += obj.offsetLeft; obj = obj.offsetParent; } while (obj); return x; } function OverGetY(obj) { var y = 0; do { y += obj.offsetTop; obj = obj.offsetParent; } while (obj); return y; }