= frameDoc.onmousemove; frameDoc.onmousemove = avglsflyover.position; }, hide: function (event, force) { var div = document.getElementById("XPLSS_Flyover"); if ((div == null) || (div.style == null) || (div.style.visibility == "hidden")) return; var trans_div = document.getElementById("XPLSS_Trans"); if ((trans_div == null) || (trans_div.style == null) || (trans_div.style.visibility == "hidden")) return; if (!!force) return setFlyoverStyle(div, trans_div); if (!event) event = window.event; // establish target element and get its containing document object // in case verdict is inside a frame var eventTarget = event.srcElement || event.currentTarget; var frameDoc = eventTarget.ownerDocument; // restore onmousemove if (avglsflyover.orig_onmousemove != null) frameDoc.onmousemove = avglsflyover.orig_onmousemove; if (avglsflyover.poppedElement) avglsflyover.poppedElement.style.border = ""; var relatedElement = event.toElement; if (!relatedElement) { //this happens on mouseout when verdict and flyover are on different frames/docs window.top.document.detachEvent('onmouseout', avglsflyover.hide); window.top.document.attachEvent('onmouseout', avglsflyover.hide); return; } // make sure we aren't still over the popped image or our layer if (searchshield.containedIn(avglsflyover.poppedElement, relatedElement) || searchshield.containedIn(div, relatedElement) || searchshield.containedIn(trans_div, relatedElement)) { return; } setFlyoverStyle(); // hide and move somewhere off screen (negative offsets) function setFlyoverStyle() { div.style.visibility = "hidden"; div.style.left = "-2100px"; div.style.top = "-2100px"; trans_div.style.visibility = "hidden"; trans_div.style.left = "-2100px"; trans_div.style.top = "-2100px"; return true; } }, position: function () { if (!avglsflyover.poppedUp || (avglsflyover.poppedElement == null)) return; var flyover = document.getElementById("XPLSS_Flyover"); if (flyover == null) return; // relative position of flyover in relation to icon var locateX = 0; // 0=left, 1=right var locateY = 0; // 0=above, 1=below, 2=beside icon // get window sizes var winSize = searchshield.viewPortSize(); var windowX = winSize[0]; var windowY = winSize[1]; // get the exact size of the flyover var flyoverSize = searchshield.elementSize(flyover); var flyoverX = flyoverSize[0]; var flyoverY = flyoverSize[1]; var verdictWidth = 0; if (avglsflyover.poppedElement && avglsflyover.poppedElement.width) verdictWidth = avglsflyover.poppedElement.width; // get the bounding rect for image(s) var imgRect = searchshield.GetFullBoundingRect(avglsflyover.poppedElement); // half width/height of element bounding rect var halfX = (imgRect.right - imgRect.left) / 2; var halfY = (imgRect.bottom- imgRect.top) / 2; // element the mouse is over, get the center position var posX = searchshield.offsetLeft(avglsflyover.poppedElement) + halfX; var posY = searchshield.offsetTop(avglsflyover.poppedElement) + halfY; // if a verdict is inside a frame must get offsets for the frame element var docFrames = document.frames; if (docFrames) { for (var i=0; i < docFrames.length; i++) { try { var frameElem = docFrames[i].frameElement; if (frameElem.contentWindow.document.getElementById(avglsflyover.poppedElement.id)) { posX += searchshield.offsetLeft(frameElem); posY += searchshield.offsetTop(frameElem); break; } } catch(frmErr){} } } var transXOffset = 0; if (imgRect.mid == undefined) transXOffset = -1 * halfX; else transXOffset = ((imgRect.right + imgRect.left) / 2) - imgRect.mid; // normalize pos to 0 -- get amount of scrolling in browser window var scroll = searchshield.scrollSize(); var pageOffsetX = scroll[0]; var pageOffsetY = scroll[1]; posX -= pageOffsetX; posY -= pageOffsetY; // setup the offsets var offsetX = posX; var offsetY = posY; // calc where to display on page if ((windowX - posX) > posX) { // right offsetX += halfX; locateX = 1; } else { //left offsetX -= (flyoverX + halfX); } if ((windowY - posY) > posY) { // below if (posY < (windowY/4)) { offsetY -= halfY; locateY = 1; } else { offsetY -= (flyoverY / 2); locateY = 2; } }