// JavaScript Document
var WinId = new Array();
CurrentWin = 0;

function closeAll() {
    for (i=0;i<WinId.length;i++) {
        if (WinId[i] && !WinId[i].closed) WinId[i].close();
    }
}

var popupWindow = null;
function centeredPopup(url,winName,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
WinId[CurrentWin++] = popupWindow = window.open(url,winName,settings)
if (window.focus) {popupWindow.focus()}
}