<!--
//Funktion newpop startet ein neues Popup-Fenster und zeigt ggf. ein Bild und ein Text an, zentriet das
//Fenster, generiert ein Titel und legt die Größe selbst entsprechend des Inhaltes fest, bei Klick wird
//das Fenster geschlossen.
//Parameter:
// img_url        Bildname
// img_width      Bildbreite
// img_height     Bildhöhe
// titel          Titel
// backcolor      Hintergrundfarbe
// content        Textinhalt

function new_popup (img_url, img_width, img_height, titel, backcolor, content) {

var monitor_height=screen.availHeight;  // verfügbare Bildschirmhöhe
var monitor_width=screen.availWidth;    // verfügbare Bildschirmbreite

var window_height=200;                  // Fensterhöhe
var window_width=300;                   // Fensterbreite
var window_title_height=20;             // berücksichtigte Fenstertitelzeilenhöhe
var window_scroll_width=20;             // berücksichtigte Fensterscollleistenbreite
var toleranz=1.15;                      // Toleranzwert von 25%
var um_faktor=0;                        // Umrechnungsfaktor für Anzeigegrößen
var min_width=200;                      // Mindestbreite des Fensters
var left_pos;                           // linke Fensterecke
var top_pos;                            // obere Fensterecke


if (img_url == "") {                    // keine Bilddarstellung
   img_width=0;
   img_height=0;
   }

if (monitor_height <= img_height) {     // Test ob Bild größer als Anzeigebereich ist, wenn ja reduziere Bildgröße
   um_faktor=img_height/monitor_height*toleranz;
   img_height=img_height/um_faktor;
   img_width=img_width/um_faktor;
   }

if (monitor_width <= img_width) {       // Test ob Bild größer als Anzeigebereich ist, wenn ja reduziere Bildgröße
   um_faktor=img_width/monitor_width*toleranz;
   img_width=img_width/um_faktor;
   img_height=img_height/um_faktor;
   }

if (img_width <= min_width) {           // Mindestbreite setzen, sonst nach Bildgröße richten
   window_width=min_width;
 } else {
   window_width=parseInt((img_width+window_scroll_width+30)*toleranz);     //die 30 steht für Text, da die variable Größe im Moment nicht berechnet wird
   window_height=parseInt((img_height+window_title_height)*toleranz);
   if (window_width > monitor_width) window_width=monitor_width;
   if (window_height > monitor_height) window_height=monitor_height;
   }

left_pos=parseInt((monitor_width-window_width) /2);
top_pos=parseInt((monitor_height-window_height) /2);

//Fenster erzeugen
var parameter="resizable=yes,scrollbars=yes, width="+window_width+",height="+window_height+",left="+left_pos+",top="+top_pos;
//alert(parameter);
neu_win = window.open("","wet",parameter);
neu_win.document.open();
//neu_win.document.write('<html><title>'+titel+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+backcolor+' onblur="self.close()" onclick="self.close()" ondblclick="self.close()">');
neu_win.document.write('<html><title>'+titel+'</title><body style="margin:0px; text-align:center; backgroundcolor='+backcolor+'" >');
neu_win.document.write('<table width=100% id="wet" name="wet" border=0 height='+img_height+' align="center" ><tr><td width=100% align=center>');
neu_win.document.write('<img src="'+img_url+'" width="'+img_width+'" height="'+img_height+'" border="0" alt="-Fenster beenden durch Klicken-" ><br>');
neu_win.document.write(content+'</td></tr></table>');
//neu_win.document.write('<script language="JavaScript">window.outerHeight=document.getElementById("wet").style.height'+window_title_height+';window.resizeTo(window.outerWidth, window.outerHeight);</script>');
//neu_win.document.write('<script language="JavaScript">alert("H:"+document.getElementsByTagName("table")[0].height);</script>');
neu_win.document.write('</body>');
neu_win.document.close();
neu_win.focus();
}
-->