var bigpicWin = null;

function pic(url, picwidth, picheight, description)
{
  if (!bigpicWin || bigpicWin.closed)
  {
    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=yes,copyhistory=no,width="+winwidth+",height="+winheight+",";

    checkie = navigator.appName.indexOf("Microsoft");
    if (checkie == -1)
    {
      properties = properties+"screenX="+X+",screenY="+Y;
    }
    else
    {
      properties = properties+"left="+X+",top="+Y;
    }

    bigpicWin = window.open('','bigpicWin',properties);
    bigpicWin.document.open();
	bigpicWin.document.write('<HTML><HEAD>');
    bigpicWin.document.write('<TITLE>'+description+'</TITLE>');
    bigpicWin.document.write('<STYLE TYPE="text/css"> TD { background-repeat:no-repeat; }</STYLE>');
    bigpicWin.document.write('</HEAD>');
    bigpicWin.document.write('<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">');
    bigpicWin.document.write('<TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"');
    bigpicWin.document.write('<TR><TD BACKGROUND="'+url+'"><BR></TD></TR>');
    bigpicWin.document.write('</TABLE>');
//    bigpicWin.document.write('<A HREF="JavaScript:self.close()"><IMG SRC="'+url+'" WIDTH="'+origwidth+'" HEIGHT="'+origheight+'" HSPACE="0" VSPACE="0" BORDER="0"></A>');
    bigpicWin.document.write('</BODY></HTML>');
    bigpicWin.document.close()

    bigpicWin.focus();
  }
  else
  {
    bigpicWin.focus();
  }
}
