
newWindow="";
function OpenNewWindow(Picture,Alttext,Beschreibung,Quelle,maxPic) {
xsize = 650;
ysize = 500;

picEnd = Picture.lastIndexOf(".");
picUrl = Picture.substr(0,picEnd - 2);
picNum = Picture.substr(picEnd - 2, 2);

picNumFirst = picNum.substr(0,1);
if (picNumFirst != 1 && picNumFirst != 2 && picNumFirst != 3 &&
	picNumFirst != 4 && picNumFirst != 5 && picNumFirst != 6 &&
	picNumFirst != 7 && picNumFirst != 8 && picNumFirst != 9) {
	picNum = picNum.substr(1, 1);
	picUrl = Picture.substr(0,picEnd - 1);
}
beforePicNum = picNum-1;
nextPicNum = beforePicNum+2;

if(picNum == 1) {
	beforePicNum = maxPic
}
if(picNum == maxPic) {
	nextPicNum = 1;
}

ScreenWidth = screen.width;
ScreenHeight = screen.height;

xpos = (ScreenWidth/2)-(xsize/2);
ypos = (ScreenHeight/2)-((ysize+50)/2);

if (!newWindow.closed && newWindow.location) {newWindow.close();}

html = ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"><head><title>'+Alttext+'</title><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /><style type="text/css">html, body, p, img, a {margin:0; padding:0; border: 0; font-family: Verdana,Geneva,Arial,sans-serif; color:#fff; text-align: center;} body {font-size:100.01%; background:#333;} p {font-size: 0.7em;}</style><script type="text/javascript" src="../popbild.js"></script></head><body onload="focus()"><table><tr width="860"><td width="81" height="402" valign="center"><a href="' + picUrl + beforePicNum + '.jpg" onclick="OpenNewWindow(this.href,\'\',\'\',\'\',\'' + maxPic + '\');return false;" onkeypress=""><img class="bild200" src="' + picUrl + beforePicNum + 'k.jpg" width="80" height="80" border="0" alt="" title="" /></a></td><td width="601" valign="center"><p><img src="'+Picture+'" alt="'+Alttext+'" height="300"/><br />'+Beschreibung+' <br />'+Quelle+' <br /> </td><td width="81" valign="center"> <a href="' + picUrl + nextPicNum + '.jpg" onclick="OpenNewWindow(this.href,\'\',\'\',\'\',\'' + maxPic + '\');return false;" onkeypress=""><img class="bild200" src="' + picUrl + nextPicNum + 'k.jpg" width="80" height="80" border="0" alt="" title="" /></a></td></tr><tr><td valign="center" colspan = 3><a href="javascript:self.close()">Fenster&nbsp;schlie&szlig;en</a></p></td></tr></table></body></html>');

newWindow=window.open("","Picture","height="+ysize+",width="+xsize+",resizable=yes,top="+ypos+",left="+xpos+"")

  newWindow.document.open("text/html", "replace")
  newWindow.document.write(html)
  newWindow.document.close()

  return false;
}


