var wndDisplayReg = null;
var wndDisplayOld = null;
function DisplayImage(szImage,szTitle,nWidth,nHeight)
{
    if (nWidth==null)
        nWidth="600";
    if (nHeight==null)
        nHeight="400";

    var bIsResizable = "no";
    if (screen.availWidth < nWidth)
        bIsResizable = "yes";
    if (screen.availHeight < nHeight)
        bIsResizable = "yes";

    var szBrowser       = navigator.appName
    var nBrowserVersion = parseInt(navigator.appVersion)
    if (((szBrowser == "Microsoft Internet Explorer") || (szBrowser == "Netscape")) && (nBrowserVersion < 4))
    {
        var nWidthAdjust  = eval(nWidth  + "+20");
        var nHeightAdjust = eval(nHeight + "+32");
        if ((wndDisplayOld != null) && (wndDisplayOld.closed == false))
            wndDisplayOld.close()
        wndDisplayOld = window.open(szImage, "DisplayOld", "resizable=" + bIsResizable + ",scrollbars=" + bIsResizable + ",status=no,width=" + nWidthAdjust + ",height=" + nHeightAdjust);
    }
    else
    {
        if (wndDisplayReg != null)
        {
            if (wndDisplayReg.closed == false)
            {
                wndDisplayReg.close();
            }
            wndDisplayReg = null;
        }
        wndDisplayReg = window.open("", "Display", "status=no,toolbar=no,menubar=no,location=no,scrollbars=" + bIsResizable + ",resizable=" + bIsResizable + ",width=" + nWidth + ",height=" + nHeight);
        wndDisplayReg.document.open();
        wndDisplayReg.document.write("<HTML>");
        wndDisplayReg.document.write("<TITLE>" + szTitle + "</TITLE>");
        wndDisplayReg.document.write("<STYLE TYPE='text/css'> BODY {margin:0pt} </STYLE>");
        wndDisplayReg.document.write("<BODY TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>");
        wndDisplayReg.document.write("<CENTER>");
        wndDisplayReg.document.write("<A HREF='javascript: void(null)' onClick='self.close()'><IMG SRC='" + szImage + "' ALIGN='CENTER' WIDTH='" + nWidth + "' HEIGHT='" + nHeight + "' BORDER='0' TITLE='Click photo to close window'></A>");
        wndDisplayReg.document.write("</CENTER>");
        wndDisplayReg.document.write("</BODY>");
        wndDisplayReg.document.write("</HTML>");
        wndDisplayReg.document.close();
        wndDisplayReg.focus();
    }
}

function CloseWin()
{
    if (wndDisplayReg != null)
    {
        if (wndDisplayReg.closed == false)
        {
            wndDisplayReg.close();
        }
        wndDisplayReg = null;
    }
    else if (wndDisplayOld != null)
    {
        if (wndDisplayOld.closed == false)
        {
            wndDisplayOld.close();
        }
        wndDisplayOld = null;
    }
}

function DisplayNotes(szRelPath)
{
    var szPath = szRelPath + "Shopping/PurchaseNotes.htm";
    window.open(szPath, "Notes", "statusbar=no,toolbar=no,menubar=no,locationbar=no,scrollbars=no,resizable=no,width=301,height=251,left=100,top=100");
}

