var bigpicWin  = null;
var imgUrl     = null;
var prevHeight = 0;
var prevWidth  = 0;

function winopC(url, picwidth, picheight, str_title, comment, b_fitPicture)
{
  if (!bigpicWin || bigpicWin.closed)
    imgUrl = null;
  else
    bigpicWin.focus();

  if (url != imgUrl)
  {
    usrwidth  = screen.width;
    usrheight = screen.height;
    winwidth  = picwidth;
    winheight = picheight;

    var X = (usrwidth - winwidth) / 2;
    var Y = (usrheight - winheight) / 2;

    properties="toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+(winwidth+8)+",height="+(winheight+30)+",";

    checkie = navigator.appName.indexOf("icrosoft");
    if (checkie == -1)
    {
      properties = properties+"screenX="+X+",screenY="+Y;
    }
    else
    {
      properties = properties+"left="+X+",top="+Y;
    }

    if (imgUrl == null)
    {
      bigpicWin = window.open('','bigpicWin',properties);
    }

    bigpicWin.document.open();
    bigpicWin.document.write('<html><head>');
    bigpicWin.document.write('<title>'+str_title+'</title>');
    bigpicWin.document.write('</head>');
    bigpicWin.document.write('<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bottommargin="0" bgColor="#ffffff" link="#000378" text="#000000" vLink="#464a42">');
    bigpicWin.document.write('<table width="100%" height="100%" cellpadding="0"><tr><td valign="center" align="center">');
    bigpicWin.document.write('<a href="javascript:self.close()"><img src="'+url+'" hspace="0" vspace="0" border="0" align="center" title="'+str_title+'" alt="'+str_title+'"');
    
    if (b_fitPicture)
    {
      bigpicWin.document.write(' height="'+picheight+'" width="'+picwidth+'"');
    }
    bigpicWin.document.write('></a>');

    bigpicWin.document.write('<br><img src="../../spacer.gif" width="1" height="2" hspace="0" vspace="0"><br>');
    bigpicWin.document.write('<font size="2">'+comment+'</font>');
    bigpicWin.document.write('</td></tr>');
    bigpicWin.document.write('  </table>');
    bigpicWin.document.write(' </body>');
    bigpicWin.document.write('</html>');
    bigpicWin.document.close()

    if (imgUrl != null)
    {
      document.recalc();
      bigpicWin.moveTo (X,Y);
      bigpicWin.resizeBy (picwidth - prevWidth, picheight - prevHeight);
    }
    prevWidth  = picwidth ;
    prevHeight = picheight;
    bigpicWin.focus();

    imgUrl = url;
  }
}

function winclose()
{
  if (bigpicWin && !bigpicWin.closed)
    bigpicWin.close();
}