
/*   
     b i l d f e n s t e r . j s 
     (C) Michael Obach, 6.6.2001
         Version 2.0 am 12.07.2002
     Erzeuge ein eigenes Fenster für Grafiken und Fotos
     History:
     07.07.2002: Anpassung
     06.10.2002: setTimeout kürzer gesetzt
     Wenn Breite und Höhe gegeben sind, wird das Fenster gemaess diesen Angaben erstellt, sonst wird automatisch gemessen	
*/

var ImageWindow
var width,height
var image,ext
var cond1,cond2,vscroll
  function Bild_zeigen(dateiname,width,height)
  {
        if (width==0) cond1=" "
                else cond1="width="+(width+20)+"";
        if (height==0) {cond2=" "
                        vscroll="yes"}
                else {cond2="height="+(height+80)+""
                      vscroll="no"};

        var s1 ="<TITLE>"+dateiname+"</TITLE><BODY BGCOLOR=#000000 leftmargin=0 topmargin=0>"
        var s2 ="<CENTER><IMG SRC='"+dateiname+"' BORDER=0 name=\"GrossBild\"><p>"
        var s3 ="<FORM><INPUT TYPE='BUTTON' VALUE='Fenster schliessen'"+
                " onClick='self.close()'>"
        var s4 ="</FORM></CENTER></BODY>"

        ImageWindow=window.open("", "newwin"+width,
"resizable=1,toolbar=no,scrollbars="+vscroll+",menubar=no,"+cond1+","+cond2);
        ImageWindow.document.write(s1+s2+s3+s4);
/*        ImageWindow.document.write(ImageWindow.document.GrossBild.width); */
        ImageWindow.resizeTo(ImageWindow.document.GrossBild.width+20,ImageWindow.document.GrossBild.height+80);
        ImageWindow.document.close()


  }

/* ------------------------------------------------------------------------- */

   function Auto_Bild_zeigen(dateiname)
   {
      loadImage( dateiname );   
   }

   txtImage=null; popUpImage=null; 
myImage=null;

   function closeWindow(windowName){ eval('if (('+windowName+'!=null) && !'+windowName+'.closed){'+windowName+'.close()};');
      } 

   function loadImage( imageName ) 
   {
/*      
      closeWindow('txtImage'); 
      txtImage = window.open( "", "txtImage", "resizable=1,toolbar=0,scrollbars=0,width=250,height=80,left=1,top=1"); 
      txtImage.document.write( '<HTML><HEAD><TITLE>Please Wait</TITLE></HEAD><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"><CENTER><H1>Loading Image...</H1></CENTER></BODY></HTML>'); 
      txtImage.document.close();
*/

myImage=null; 
      myImage = new Image(); 
      myImage.src = imageName; 
      if (document.all) 
      { 
         if (eval('window.myImage.width')){openWindow();} 
         else {myImage.onLoad = openWindow1();} 
      } 
      else 
      { 
         myImage.onLoad = openWindow1(); 
      } 
   } 

   function openWindow1() 
   { 
      if (!myImage.complete) {setTimeout("openWindow1()",10);} 
      else 
      {
         setTimeout("openWindow()",10);
     /*    setTimeout("5,openWindow()"); */
      } 
   } 

   function openWindow() 
   { 
      closeWindow('popUpImage'); 
      popUpImage = window.open( "", "popupImage", "resizable=1,toolbar=0,scrollbars=0,width=" + (myImage.width) + ",height=" + (myImage.height)+'left=1,top=1');
      popUpImage.document.write( '<HTML><HEAD><TITLE>'+ myImage.src+ '</TITLE></HEAD><body BGCOLOR=#000000 leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"><CENTER><a href="javascript:self.close()"><IMG SRC="'+myImage.src+'" border=0 ALT="Mausklick (links) schließt das Fenster" WIDTH="' + myImage.width+'" HEIGHT="' + myImage.height + '"></a></CENTER></BODY></HTML>' ); 
      popUpImage.document.close(); 
   /*   setTimeout("500,closeWindow('txtImage')");  */
      } 

