
if (document.images)
{
  var onLoadBeforeImage = null;
  if (window.onload)
  {
    onLoadBeforeImage = window.onload;
  }
  window.onload = BildOeffnenInit;
}

function BildOeffnenInit()
{
  if (onLoadBeforeImage)
  {
    onLoadBeforeImage();
  }
  for (var i=0; i < document.links.length; i++)
  {
    var HREF = document.links[i].href.toLowerCase().split('.');
    if (HREF[HREF.length - 1] == 'jpg' || HREF[HREF.length - 1] == 'gif' || HREF[HREF.length - 1] == 'png')
    {
      document.links[i].onclick = OeffneBild;
    }
  }
}

function OeffneBild()
{
  var BildName = this.href.split('.');
  var BildGroesse = BildName[BildName.length - 2].split('x');
  var ModX=0, ModY=0, Dat=this.href.split('/'); Dat=Dat[Dat.length - 1];
  if (!document.layers && !document.all)
  {
    ModX = 20;
    ModY = 30;
  }
  var Param = 'width=' + (parseInt(BildGroesse[0]) + ModX) + ',height=' + (parseInt(BildGroesse[1]) + ModY) + ',directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0';
  if (document.layers)
  {
    Param += ',screenX=' + (screen.width / 2 - BildGroesse[0] / 2) + ',screenY=' + (screen.height/2 - BildGroesse[1] / 2);
  }
  else if (document.all)
  {
    Param += ',left=' + (screen.width / 2 - BildGroesse[0] / 2) + ',top=' + (screen.height / 2 - BildGroesse[1] / 2);
  }
  var neuwin = window.open('', '', Param);
  with (neuwin.document)
  {
    open();
    write('<html>\n<head>\n<title>Zoom Picture</title></head>\n');
    write('<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>\n');
    write('<a href="javascript:window.close();"><img border=0 src="' + this.href + '" width=' + BildGroesse[0] + ' height=' + BildGroesse[1] + ' alt="image &quot;' + Dat + '&quot; \n\nclick to close ..."></a>\n');
    write('</body>\n</html>\n');
    close();
  }
  return false;
}


