I have the following code that positions a popup under an element. This works properly only if the Fx window is maximized. What do I add to account for window's position relative to the screen, so it works for a window in Normal mode as well?
var elm = document.getElementById("back-forward-dropmarker");
var x = elm.boxObject.x;
var y = elm.boxObject.y + elm.boxObject.height + 19;
document.getElementById("backForwardMenu").showPopup(elm, x, y, "popup", null, null);