for (var i=0; i < rules.length; i++) { var bgImg = rules[i].style.backgroundImage; var selText = rules[i].selectorText.toLowerCase(); if (bgImg) { var bgImgStyle = bgImg.replace(/:\/\/([a-z]+)_/i, '://default_'); rules[i].style.backgroundImage = bgImgStyle; } if (((selText == ".avgilfo") || (selText == ".avgilfo_head") || (selText == ".avgilfo_foot div")) && (rules[i].style.width)) { rules[i].style.width = "0px"; } } } } }, position: function (imageElem) { var flyover = document.getElementById('XPLSS_InlineFlyover'); 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]; // Must know if there is a horizontal scroll bar for Firefox // for proper flyover positioning near bottom edge var scrollYWidth = winSize[2]; var scrollBarX = winSize[2] > 0 ? true : false; // get the exact size of the flyover var flyoverSize = searchshield.elementSize(flyover); var flyoverX = flyoverSize[0]; var flyoverY = flyoverSize[1]; flyover.style.width = flyoverX + "px"; // get the bounding rect for image(s) var imgRect = imageElem.getBoundingClientRect(); // half width/height (center) 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(imageElem) + halfX; var posY = searchshield.offsetTop(imageElem) + halfY; var pageOffsetX = 0; var pageOffsetY = 0; var hasParentFrame = false; // normalize pos to 0 -- get amount of scrolling in browser window var scroll = searchshield.scrollSize(imageElem); pageOffsetX = scroll[0]; pageOffsetY = scroll[1]; hasParentFrame = scroll[2]; posX -= pageOffsetX; posY -= pageOffsetY; //compensate for Firefox 3 if (posX < imgRect.left) posX = imgRect.left+halfX; // setup the offsets var offsetX = posX; var offsetY = posY; // calc where to display on page if ((windowX - posX) > posX) { // right //offsetX += halfX; offsetX = imgRect.right + 3; locateX = 1; } else { //left //offsetX -= (flyoverX + halfX); offsetX = imgRect.left - flyoverX - 3; } if ((windowY - posY) > posY) { // below if (posY < (windowY/4)) { offsetY -= halfY; locateY = 1; } else { offsetY -= (flyoverY / 2) - halfY; locateY = 2; } } else { // above if ((windowY - posY) < (windowY/4)) { offsetY -= (flyoverY - halfY); } else { offsetY -= (flyoverY / 2) + halfY; locateY = 2; } } // make sure we aren't off the screen if (offsetY < 0) offsetY = 0; if ((offsetY + flyoverY) > windowY) { offsetY = windowY - flyoverY; } else if (scrollBarX && ((windowY - (posY + halfY)) < scrollYWidth)) { //verdict overlaps the horizontal scrollbar offsetY = windowY - (flyoverY + scrollYWidth); } // add page offsets back - if not in frame if (!hasParentFrame) { offsetX += pageOffsetX; offsetY += pageOffsetY; } //posX += pageOffsetX; //posY += pageOffsetY; //var paddedOffsetX = 0; //provide space between icon and flyover //var padX = 3; //if (locateX == 0) // paddedOffsetX = offsetX - padX; //else // paddedOffsetX = offsetX + padX; // set where to