create a div to use for the flyover itself, hide for now var flyover_div = doc.createElement("DIV"); flyover_div.setAttribute("id", "XPLSS_Flyover"); flyover_div.style.position = "absolute"; flyover_div.style.zIndex = "10000"; doc.body.appendChild(flyover_div); // create a layer for the image var trans_div = doc.createElement("DIV"); trans_div.setAttribute("id", "XPLSS_Trans"); trans_div.style.position = "absolute"; trans_div.style.zIndex = "9999"; doc.body.appendChild(trans_div);};searchshield.ShowPopupAlert = function (doc, link, hash, search){ // build the content var popup_content = searchshield.avgCallFunc(doc, 'BuildPopupAlert', hash, search); if (popup_content == null || popup_content == "") return; // get the div var div = doc.getElementById("XPLSS_PopupAlert"); div.innerHTML = searchshield.CleanupHTML(popup_content); // set position, account for scrolling var zoom = searchshield.zoomLevel(); var pageOffsetX = Math.round(doc.documentElement.scrollLeft/zoom); var pageOffsetY = Math.round(doc.documentElement.scrollTop/zoom); div.style.left = 10 + pageOffsetX + "px"; div.style.top = 10 + pageOffsetY + "px"; // TODO: the event handler function doesn't exist so, is this even necessary? //div.attachEvent("onmouseout", HidePopupAlert); // set the link //var data = doc.getElementById("avgalertpopurl"); //if (data) // data.innerHTML = escape(link); // set visibility div.style.visibility = "visible"; //navigate to the link after timed delay // TODO: Bug 31707 - make this open a new tab/window setTimeout(function(){doc.location.assign(link)}, 3000);};searchshield.avgCallFunc = function (doc, name /*, param1..., paramN*/){ // get the data element var avg_ls_data = (typeof gAvgDataElement !== 'undefined') ? gAvgDataElement : doc.getElementById("avglsdata"); if ((avg_ls_data == null) || (name == null)) return; // save the data element gAvgDataElement = avg_ls_data; // for some reason you can't fire and event on an element with no parent node if (avg_ls_data.parentNode == null) return; // set the attributes avg_ls_data.setAttribute("function", name); // set variable length of optional parameter attributes var pcnt = 0; for (var i=2; i < arguments.length; i++) avg_ls_data.setAttribute("param"+(++pcnt), String(arguments[i])); avg_ls_data.fireEvent("onrowenter"); // get the result return avg_ls_data.getAttribute("result"); };// general use functions - begin// DOM Functionssearchshield.getAnchorNode = function (node, filterFunc){ // filterFunc should return a boolean if (!filterFunc || !filterFunc instanceof Function) return null; // go up the dom tree starting at node and look for anchor // before hitting a header, div or table element while ((node != null) && (node.tagName != null) && (node.tagName != "A")) { if (filterFunc(node)) { node = null; break; } node = node.parentNode; } return node;};searchshield.getDocuments = function (frame, frameArray){ // recursively get all embedded frames/docs frameArray.push(frame.document); var frames = frame.frames; for (var i = 0; i < frames.length; i++) { // recurse on each frame searchshield.getDocuments(frames[i], frameArray); } return frameArray;};searchshield.NextSiblingNode = function (element){ var TEXTNODE = 3; var ParentNode = element.parentNode; if (!ParentNode) return; var NextSibling = ParentNode.nextSibling; while (NextSibling) { if (NextSibling.nodeType != TEXTNODE) return NextSibling; NextSibling = NextSibling.nextSibling; } return;};searchshield.getParentNodeByAttribute = function (attrName, attrValue, node, maxDepth){ if (!node) return null; var maxLoop = maxDepth ? maxDepth : 1; var pNode = node.parentNode; if (!pNode) return null; for(; 0 < maxLoop; maxLoop--) { if ((pNode[attrName]) && (pNode[attrName].toLowerCase() === attrValue.toLowerCase())) { return pNode; } pNode = pNode.parentNode; if (!pNode) return null; } return null;};searchshield.getParentNodeByClassName = function (className, node, maxDepth) { return searchshield.getParentNodeByAttribute("className", className, node, maxDepth);};searchshield.getParentNodeById = function (id, node, maxDepth){ return searchshield.getParentNodeByAttribute("id", id, node, maxDepth);};searchshield.getParentNodeByTagName = function (tagName, node, attrName) { // find parent node by tag name and optional attribute name if (!tagName || !node || !node.parentNode) return null; tagName = tagName.toUpperCase(); while ((node != null) &&