var WindowObjectReferenceOfRequestedPopup, WindowObjectReferenceOfIntermediaryPopup; function OpenRequestedPopup(strUrl, strTarget) { var windowWidth, windowHeight, windowLeft, windowTop; if(typeof window.screenX == "number" && typeof window.innerWidth == "number") { windowWidth = window.innerWidth * .68; windowHeight = window.innerHeight * .68; windowLeft = window.screenX + window.innerWidth * .16; windowTop = window.screenY + window.innerHeight * .16; } else if(typeof window.screenTop == "number" && typeof document.documentElement.offsetHeight == "number") { windowWidth = document.documentElement.offsetWidth * .68; windowHeight = document.documentElement.offsetHeight * .68; windowLeft = window.screenLeft + document.documentElement.offsetWidth * .16; windowTop = window.screenTop - 50; } else { windowWidth = 500; windowHeight = 250; windowLeft = 60; windowTop = 40; }; /* The above code is just to define reasonable sizes and initial positions to the popup to be. */ if (WindowObjectReferenceOfRequestedPopup == null || WindowObjectReferenceOfRequestedPopup.closed) { WindowObjectReferenceOfRequestedPopup = window.open(strUrl, strTarget, "top=40" + ",left=40" + ",width=930,height=650" + ",menubar='no',toolbar='no',location='no',resizable='no',scrollbars='no',status='no',location='no',directories='no'"); } else { WindowObjectReferenceOfRequestedPopup.location = strUrl; if(WindowObjectReferenceOfRequestedPopup.focus) { WindowObjectReferenceOfRequestedPopup.focus(); }; }; /* The above 9 lines of code creates the popup; if the popup is already opened, then it is only brought on top. This feature is possible only if the user allows it via the setting Edit/Preferences.../category:Advanced/Scripts & Plugins/Allow webpages to:/Raise or lower windows */ }