/* (C) 2003 www.intermax.se Open Centered Popup Window Script - Explanation: The links are setup like this: Example: Javascript:; — The href="javascript:;" line tells the browser not to do anything, except run the attached script. If you put the page name here, it would open the page in the popup window, and open the page in your main browser window. PageName.html — This is the name of the page that you want to open inside the popup window. WindowName — This is a name that the browser used to identify the popup window. Each of your popups should have distinct names, unless you want them to open in the same window every time. Attributes — This determines what elements are displayed in your popup window. Just enter the attribute=yes for every element you want to display. The elemnts are toolbar (the back, forward, stop buttons, etc), location (the address bar), status (the bottom status bar), menubar (File, Edit, etc), scrollbars (the side scroll bars), resizable (makes the widow able to be resized). Width — Window width. Height — Window height. Centered — Enter true to have the window automatically centered. Enter false to open it in the default window location. */ var windowOpened; function tryClose() { if (windowOpened != null && !windowOpened.closed) { windowOpened.close(); } } function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0 if(window.screen)if(isCenter)if(isCenter=="true"){ var myLeft = (screen.width-myWidth)/2; var myTop = (screen.height-myHeight)/2; features+=(features!='')?',':''; features+=',left='+myLeft+',top='+myTop; } windowOpened = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight); }