function WindowOpen(Adresse,Optionen) {
  //"width=300,height=400,left=100,top=200"
  Fenster1 = window.open(Adresse, "Galerie", Optionen);
  Fenster1.focus();
}

function chkFormular (felder,bezeich) {

var checkar=felder.split(";");
var bezeichar=bezeich.split(";");
var meldung="";
var stop=false;
        //alert(bezeichar.length);
        for (var i = 0; i < checkar.length; i++) {
                 //alert(bezeichar[i] + " ist " + checkar[i]);
                 if (document.getElementsByName(checkar[i])[0].value == "") {
                 meldung = meldung + "\n - " + bezeichar[i] + " darf nicht leer sein";
                 stop=true;
                 }
        }

if (stop == true) {
        Check = alert("Es sind folgende Fehler aufgetreten:\n" + meldung + "");
        return false;

} else {return true;}

return false;
}

function switchit(dd,id) {
         document.getElementById(id).innerHTML = dd;
}

function siteedit(dd,onoff) {
         if (onoff == "on") {
             dd.style.backgroundColor = "#DDDDDD";
         } else {
             dd.style.backgroundColor = "";
         }
}

function show_editwindow(site) {
        var ed = document.getElementById("editfr");
        ed.src = site
        if (document.getElementById("editfr")) {
           var ed = document.getElementById("editfr");
        } else {
           var ed = document.all.editfr;
        }
        ed.style.display = "block";
        //alert(ed.filters[0].opacity)
        //object.style.filter="Alpha(opacity=wert)"; // IE
        //object.style.MozOpacity="wert"; // Mozilla
        //alert(ed.style.MozOpacity)
        //ed.style.MozOpacity = "0.8"
        //document.all.Zittertext.filters[0].freq

        var posis = getPageSize();

        ed.style.top = "0px";
        ed.style.left = "0px";
        ed.style.width = posis[0]  + "px";
        ed.style.height = posis[1] + "px";
        document.body.style.overflow="hidden";
        //alert(screen.availHeight);
    }

    function hide_editwindow() {
        var ed = document.getElementById("editfr");
        if (document.getElementById("editfr")) {
           var ed = document.getElementById("editfr");
        } else {
           var ed = document.all.editfr;
        }
        ed.style.display = "none";
        document.body.style.overflow="";
    }


function getPageSize(){

        var xScroll, yScroll;

        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }

        var windowWidth, windowHeight;
        if (self.innerHeight) {        // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
        }

        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
                pageHeight = windowHeight;
        } else {
                pageHeight = yScroll;
        }

        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
                pageWidth = windowWidth;
        } else {
                pageWidth = xScroll;
        }

        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        alert(arrayPageSize);
        return arrayPageSize;
}


function teaserhover(dd,oo) {
    //alert(dd.getElementsByTagName("td")[0].firstChild.data);
    //alert(dd.getElementsByTagName("td").length)
    dd.style.cursor = "pointer";
    if (oo) {
        for(i=0;i<dd.getElementsByTagName("td").length;i++) {
            dd.getElementsByTagName("td")[i].style.backgroundColor="#C3CFD8";
        }

        for(i=0;i<dd.getElementsByTagName("h2").length;i++) {
            dd.getElementsByTagName("h2")[i].style.color="#AC0925";
        }
    } else {
        for(i=0;i<dd.getElementsByTagName("td").length;i++) {
            dd.getElementsByTagName("td")[i].style.backgroundColor="#E4E7EB";
        }

        for(i=0;i<dd.getElementsByTagName("h2").length;i++) {
            dd.getElementsByTagName("h2")[i].style.color="#475B68";
        }
    }
}

function IDhover(dd,oo) {
    //alert(dd.getElementsByTagName("td")[0].firstChild.data);
    //alert(dd.getElementsByTagName("td").length)
    dd.style.cursor = "pointer";
    if (oo) {
        dd.getElementsByTagName("td")[0].className="arrow_high";

        if (dd.getElementsByTagName("td")[1].className=="norm_kap") {
            dd.getElementsByTagName("td")[1].className="norm_high";
        } else {
            dd.getElementsByTagName("td")[1].className="red_head_high";
        }
        
    } else {
        dd.getElementsByTagName("td")[0].className="arrow";

        if (dd.getElementsByTagName("td")[1].className=="norm_high") {
            dd.getElementsByTagName("td")[1].className="norm_kap";
        } else {
            dd.getElementsByTagName("td")[1].className="red_head";
        }
    }
}