function pop_up_flash (imageName,imageWidth,imageHeight,number,gallery,anzahl) {

         if (document.getElementById("gal_spec_box")) {
             var Knoten = document.getElementById("gal_spec_box");
             verschwunden = document.getElementsByTagName("body")[0].removeChild(Knoten);
             }

         var BlackBox = document.getElementById("backer");
         BlackBox.style.display = "block";

         var gal_spec_div = document.createElement("div");

         //var scrollings = wo_samma();
         gal_spec_div.id = "gal_spec_box";
         var innere_masse = welche_masse_pop_up_flash();
         var thumping = "yes";

         if (imageWidth>0.95*innere_masse[0]) {
             var new_imageWidth = Math.round(0.90*innere_masse[0]);
             var faktor_x = new_imageWidth/imageWidth;
             imageHeight = Math.round(faktor_x*imageHeight);
             imageWidth =  new_imageWidth;
             thumping = "no";
             }

         if (imageHeight>0.95*innere_masse[1]) {
             var new_imageHeight = Math.round(0.90*innere_masse[1]);
             var faktor_y = new_imageHeight/imageHeight;
             imageWidth = Math.round(faktor_y*imageWidth);
             imageHeight =  new_imageHeight;
             thumping = "no";
             }

         var posit_x = (Math.round(innere_masse[0]/2)) - (Math.round(imageWidth/2));
         if (posit_x<0) {posit_x = 0;}
         var posit_y = (Math.round(innere_masse[1]/2)) - (Math.round(imageHeight/2));
         if (posit_y<0) {posit_y = 0;}

         var Ausgabebereich = document.getElementsByTagName("body")[0];
         Ausgabebereich.appendChild(gal_spec_div);
         var Ansprechpartner = document.getElementById("gal_spec_box");
         Ansprechpartner.style.width = imageWidth+"px";
         Ansprechpartner.style.height = imageHeight+"px";
         Ansprechpartner.style.left =  posit_x + "px";
         Ansprechpartner.style.top =  posit_y + "px";
         var gal_spec_inner_div = document.createElement("div");
         gal_spec_inner_div.id = "gal_spec_inner_box";
         Ansprechpartner.appendChild(gal_spec_inner_div);
         var Ansprechpartner2 = document.getElementById("gal_spec_inner_box");
         if (thumping=="yes") {
             Ansprechpartner2.style.backgroundImage = "url("+imageName+")";
             }
         else {
             var url_x = imageName.replace(/\//g, ":");
             var thumping_url = "gal_img/thumper.php?id=";
             thumping_url = thumping_url + url_x;
             thumping_url = thumping_url + "&w=" + imageWidth;
             thumping_url = thumping_url + "&h=" + imageHeight;
             var str_pos = imageName.length-3;
             var typ = imageName.substring(str_pos);
             thumping_url = thumping_url + "&t=" + typ;
             Ansprechpartner2.style.backgroundImage = "url(" + thumping_url + ")";
             }

         var Anzahl_Bilder = anzahl;
         number_x = parseInt(number);
         if (number!=1) {
                         var div_links = document.createElement("div");
                         div_links.id = "gal_pfeil_links";
                         var button_links = document.createElement("a");
                         var number_links = number_x-1;
                         var link_links = "javascript:pop_up_flash('themes/gallery/"+gallery+number_links+".jpg',550,400,"+number_links+",'"+gallery+"',"+Anzahl_Bilder+");";
                         button_links.href = link_links;
                         div_links.appendChild(button_links);
                         Ansprechpartner2.appendChild(div_links);
                         }
         var max_number = Anzahl_Bilder;
         if (number!=max_number) {
                         var div_rechts = document.createElement("div");
                         div_rechts.id = "gal_pfeil_rechts";
                         var button_rechts = document.createElement("a");
                         var number_rechts = number_x+1;
                         var link_rechts = "javascript:pop_up_flash('themes/gallery/"+gallery+number_rechts+".jpg',550,400,"+number_rechts+",'"+gallery+"',"+Anzahl_Bilder+");";
                         button_rechts.href = link_rechts;
                         div_rechts.appendChild(button_rechts);
                         Ansprechpartner2.appendChild(div_rechts);
                         }
}

function pop_up_flash_close () {
         if (document.getElementById("gal_spec_box")) {
             var Knoten = document.getElementById("gal_spec_box");
             verschwunden = document.getElementsByTagName("body")[0].removeChild(Knoten);
             var BlackBox = document.getElementById("backer");
             BlackBox.style.display = "none";
             }
}
function welche_masse_pop_up_flash() {
     var myWidth = 0, myHeight = 0;
     if( typeof( window.innerWidth ) == 'number' ) {
         myWidth = window.innerWidth;
         myHeight = window.innerHeight;
     } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
         myWidth = document.documentElement.clientWidth;
         myHeight = document.documentElement.clientHeight;
     } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
         myWidth = document.body.clientWidth;
         myHeight = document.body.clientHeight;
     }
     return [ myWidth, myHeight ];
 }