var oWindow;

function openPopup(sUrl, nWidth, nHeight)
{
    // debugger;
    if (sUrl == null) return;
    nWidth = parseInt(nWidth);
    nHeight = parseInt(nHeight);
    if (isNaN(nWidth) == true) return;
    if (isNaN(nHeight) == true) return;

    if (oWindow != null && oWindow.closed != true)
    {
        oWindow.close();
    }

    oWindow = window.open(sUrl, "window_" + new Date().valueOf().toString(), "location=0,status=0,scrollbars=1,resizable=1,width=" + nWidth.toString() + ",height=" + nHeight.toString());
}