// <A href="BILD.jpg" onclick="return popup(this,450,350)"><img src="THUMB.jpg" alt="click" /></A>
// ODER
// <A href="BILD.jpg" onclick="return popup(this)"><img src="THUMB.jpg" alt="click" /></A>
//<!--
  var output = null;
  function popdown()
  {
    if (output && !output.closed) output.close();
  }


  function ViewFoto (img, pw,ph,name)
  {
    foto= new Image();
    foto.src=(img);
 
    // Automatische Bildgröße
    //pwidth =foto.width  +10;
    //pheight=foto.height +10;
	
	// Angegebene Bildgröße
    if ((pw!=undefined)&&(pw!=0)) {
      pwidth =pw +10;
      pheight=ph +10; 
	}
    else {
      pwidth =foto.width  +10;
      pheight=foto.height +10;
    }

    // Bildschirmposition
    pleft= (screen.availwidth-pwidth)/2;    //ptop =40;
    ptop = (screen.availheight-pheight)/2;  //pleft=40;

    // Vorheriges Fenster schliessen
    popdown();

    var image= "<a href='javascript:self.close()'><img src='"+img+"' border='0' alt='click to close'></a>";
    var body = "<body bgcolor=#ffffff TOPMARGIN=5 LEFTMARGIN=5><CENTER>";

    //window.open(href, windowname, 'width=400,height=150,toolbar=yes,scrollbars=yes');

	output=window.open("","output","left="+pleft+",top="+ptop+",width="+pwidth+",height="+pheight+",resizable=yes");
    output.document.write("<html><head><title>"+name+"</title></head>"+body+"" + image + "</CENTER></body></html>");
    output.document.close();

    //var args='width='+pwidth+',height='+pheight+',resizable=no';
    // output=window.open(img,'',args);

    output.focus();
  }

  window.onunload = popdown; window.onfocus = popdown;


  // NEU: KOMPATIBILITÄT
  function popup0 (img, pw,ph,name)
  {
    //var titel = "Quick & Step Tanzschuh-Lädchen";
	var titel = "TFF-Galerie";
	
    if ((name==undefined)||(name==0)) {
      ViewFoto(img,pw,ph,titel); }
      else {
      ViewFoto(img,pw,ph,name); }

    return (false);  //return (output) ? false : true;
  }


  // TFF: Übergabe als FILE oder ID
  function popup (img, pw,ph, id)
  {
      if ((img==undefined)||(img==0)) {
        // Übergabe ID
        foto= new Image();
        foto.src=document.getElementById(id).src;
      }
      else {
        // Übergabe FILE(URL)
        foto= new Image();
        foto.src=(img);
      }

      popup0 (foto.src, pw,ph, 'TFF-Galerie');
      return (false);  //return (output) ? false : true;
  }

  

  // BILD0: Bild und Text einblenden
  function BildOver (Bildname, Textname, BildURL)
  {
    // BILD (ID oder URL)
    if ((BildURL!=undefined)&&(BildURL!=0)) {
    document.images['bild0'].src=BildURL; }
    else {
    document.images['bild0'].src=document.images[Bildname].src; }
    document.getElementById("bild0").style.visibility="visible";

    // TEXT
    if ((Textname!=undefined)&&(Textname!=0)) {
    document.getElementById('text0').innerHTML=document.getElementById(Textname).innerHTML;
    document.getElementById("text0").style.visibility="visible";
    }
  }

  // BILD0: Bild und Text ausblenden
  function BildOut ()
  {
   document.getElementById("bild0").style.visibility="hidden";
   document.getElementById("text0").style.visibility="hidden";
  }

  

  // Bild dimmen
  function dimmen (image, schalter)
  {
    if (schalter==0)
      image.filters.alpha.opacity=50;
    else
      image.filters.alpha.opacity=100;
  }

  //-->
