var bc=0; //globaler Bilder pro zeile zähler
function pix(bild,text)
//bildergallerie innerhalb html-seite mit automatischem zeilenumbruch
{
scrwidth=window.innerWidth - 30; //Bildbreite mit knautschzone
if (isNaN(scrwidth))
 scrwidth=800; //fix da ie nix checkt
pixwidth=150; //bildbreite und pfade entsprechend anpassen
bpz=Math.floor(scrwidth / pixwidth);
document.writeln('<td valign="top" width="'+pixwidth+'"><a href="javascript:showpix(\'../'+bild+'\',\''+text+'\')">');
document.writeln('<img src="../th/'+bild+'"></a><br>'+text+'</td>');
bc++;
if (bc % bpz == 0)
 document.writeln('</tr><tr>');
};

//erzeugt eine Ausgabe in einem neuen Fenster

function showpix(myPicture,text)
{
   var pic=new Image();
   pic.src=myPicture;
   var iWidth=pic.width;
   var iHeight=pic.height;
   if (iWidth*iHeight==0)
   {
     iWidth=500;
     iHeight=400;
   }
    else
   {
     iWidth=iWidth+20;
     iHeight=iHeight+50;
   };
   var y0=(screen.height-iHeight)/2;
   var oPopup=window.open('', 'Preview','resizable=yes,width='+iWidth+',height='+iHeight);
   oPopup.document.open();
   oPopup.document.writeln("<HTML><HEAD>");
   oPopup.document.writeln("<TITLE>"+myPicture+" - Zum Schliessen ins Bild klicken</TITLE>");
   oPopup.document.writeln("</HEAD>");
   oPopup.document.writeln('<body  bgcolor="cyan" onBlur="Javascript:self.close()">');
   oPopup.document.writeln(' <center>'+text+'<br><A HREF="JavaScript:self.close();">');
   oPopup.document.writeln('<IMG SRC="' + myPicture + '" ALT="click here for exit" BORDER=0></A>');
   oPopup.document.writeln('</center></BODY></HTML>');
   oPopup.document.close();
   oPopup.focus();
   };

function popup(url)
{
var sw=window.open(url,"SubWin","scrollbars=yes,width=320,height=240,resizable=yes");
sw.focus();
};

function subwin(url)
{
var sw=window.open(url,"SubWin","scrollbars=yes,menubar=yes,width=500,height=400,resizable=yes");
sw.focus();
};
function iv()
{alert('...ist erst in Vorbereitung\nund im Moment noch nicht verfügbar!');
};

