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

    // check user resolution to center the image popup
    if (screen.width > 800) {
        newWinParams = winParams + ',width=' + winWidth + ',height=' + winHeight + ',screenX=' + newX + ',screenY=' + newY;
    }
    else {
        if(winWidth < 800) {
            if(winHeight < 600) {
                newWinParams = winParams + ',width=' + winWidth + ',height=' + winHeight + ',screenX=' + newX + ',screenY=' + newY;
            }
            else {
                newWinParams = winParams + ',width=' + winWidth + ',height=' + winHeight + ',screenX=' + newX + ',screenY=0';
            }
        }
        else {
            newWinParams = winParams + ',width=' + winWidth + ',height=' + winHeight + ',screenX=0,screenY=0';
        }
    }

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