function openCenteredWindow(url,winName,winWidth,winHeight,winParams)	{
    // coords to center popup
    var newX, newY;
    newX = (screen.width - winWidth) / 2;
    newY = (screen.height - winHeight) / 2;

    // check user resolution to center the popup
    if (screen.width > winWidth) {
        if (screen.height > winHeight) {
            newWinParams = winParams + ',width=' + winWidth + ',height=' + winHeight + ',left=' + newX + ',top=' + newY;
        }
        else {
            newWinParams = winParams + ',width=' + winWidth + ',height=' + screen.height + ',left=' + newX + ',top=0,scrollbars=yes';
        }
    }
    else {
        if (screen.width <= winWidth) {
            if (screen.height <= winHeight) {
                newWinParams = winParams + ',width=' + screen.width + ',height=' + screen.height + ',left=0,top=0,scrollbars=yes';
            }
            else {
                newWinParams = winParams + ',width=' + screen.width + ',height=' + winHeight + ',left=0,top=' + newY + ',scrollbars=yes';
            }
        }
    }

    var ppWindow = window.open(url,winName,newWinParams);
	if (ppWindow) {
        ppWindow.focus();
    }
}
