var popupWindow = null function OpenPopupWindow(URL, windowFeatures) { popupWindow = window.open(URL,"PopupWindow",windowFeatures); } function ClosePopupWindow() { if (popupWindow != null) { if (!popupWindow.closed) { popupWindow.close() } } } function DisplayCloseButton() { if (window.opener != null) { document.write('
') } }