function setPageInactive() {
    var availHeight;
    var pageHeight;
    var dialogBgHeight;
    
    if (self.innerHeight) { // all except Explorer
        availHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        // Explorer 6 Strict Mode
        availHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        availHeight = document.body.clientHeight;
    }
    
    var test1 = document.body.scrollHeight;
    var test2 = document.body.offsetHeight
    if (test1 > test2) { // all but Explorer Mac
        pageHeight = document.body.scrollHeight;
    } else {
        // Explorer Mac;
        //would also work in Explorer 6 Strict, Mozilla and Safari
        pageHeight = document.body.offsetHeight;
    }
    
    if (availHeight > pageHeight) {
        dialogBgHeight = availHeight;
    } else {
        dialogBgHeight = pageHeight;
    }
    
    document.getElementById("hideWindowedControlsBg").style.height = dialogBgHeight + "px";
    document.getElementById("hideWindowedControls").style.height = dialogBgHeight + "px";
    
    document.getElementById("hideWindowedControlsBg").style.display = "block";
    document.getElementById("hideWindowedControls").style.display = "block";
    
    window.onresize = resizePage;
}

function setPageActive() {
    document.getElementById("hideWindowedControlsBg").style.display = "none";
    document.getElementById("hideWindowedControls").style.display = "none";
    
    window.onresize = null;
}

function resizePage() {
	if (document.getElementById("hideWindowedControlsBg").style.display == "block") {
		setPageInactive();
	}
}

/* @TODO: alle aufrufe der anwendung umbiegen auf forms.js */
function toggleDisplay(id) {
    element = document.getElementById(id);
    if (element.style.display == 'none') {
        element.style.display = 'block';
    } else {
        element.style.display = 'none';
    }
}

function toggleVisibility(id) {
    var element = document.getElementById(id);
    if (element.style.visibility == 'visible') {
        element.style.visibility = 'hidden';
    } else {
        element.style.visibility = 'visible';
    }
}

function popup(url) {
    myWindow = window.open(url, "popup", "width=687,height=550,scrollbars=yes,resizable=yes,location=no,menubar=no,toolbar=no,status=no");
    myWindow.focus();
}