var fensterid = null;

function picture (bildurl, bildbreite, bildhoehe, bildname)
{
  screenbreite = screen.width;
  screenhoehe = screen.height;

  bildbreite = bildbreite + 200;
  bildhoehe = bildhoehe + 100;

  if (fensterid)
  {
    fensterid.close ();
  }

  if (screenbreite<bildbreite || screenhoehe<bildhoehe)
  {
    fensterid = window.open ('about:blank', 'pic', "dependent=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + (screenbreite-100) + ",height=" + (screenhoehe -100) + ",left=0,top=0");
  }
  else
  {
    xoffset = (screenbreite - bildbreite) / 2;
    yoffset = (screenhoehe - bildhoehe) / 2;
    fensterid = window.open ('about:blank', 'pic', "dependent=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=" + bildbreite + ",height=" + bildhoehe + "," + "left=" + xoffset + ",top=" + yoffset);
  }

  fensterid.document.open ();
  fensterid.document.write ('<html><head><link rel="stylesheet" href="css/pics.css" type="text/css"><title>' + bildname + '</title></head>');
  fensterid.document.write ('<body class=showpic><a href="javascript:self.close()"><img src="' + bildurl + '" style="border-style:none" alt="' + bildname + '" title="' + bildname + '"></a><p><font class=showpic>' + bildname + '</font><p><font class=showpic-min>Zum Schlie&szlig;en bitte in das Bild klicken</font></body></html>');
  fensterid.document.close();

  fensterid.focus();
}

