﻿var profileIsVisible = false;
function ToggleProfile(regUser) {
    obj = window.parent.document.getElementById('divProfileDetail');
    if (obj != null) {
        if (obj.style.visibility == 'hidden') {
            ShowProfile(regUser);
        }
        else {
            HideProfile(regUser);
        }
    }
    //ControlBodyToggle(
}

function ShowProfile(regUser) {

    if (window.parent != null) {
        var obj = window.parent.document.getElementById('divRegisterDetail');
        if (obj != null) {
            if (regUser == true) {
                obj.style.visibility = 'hidden';
                obj.style.height = '0px';
            }
            else {
                obj.style.visibility = '';
                obj.style.height = '';
                //ControlBodyShow('divProfileBody', 120);
            }
        }
        obj = window.parent.document.getElementById('divProfileDetail');
        if (obj != null) {
            if (regUser == true) {
                obj.style.visibility = '';
                obj.style.height = '';
                //ControlBodyShow('divProfileBody', 120);
            }
            else {
                obj.style.visibility = 'hidden';
                obj.style.height = '0px';
            }
        }
    }
}

function HideProfile(regUser) {

    if (window.parent != null) {
        var obj = window.parent.document.getElementById('divRegisterDetail');
        if (obj != null) {
            if (regUser == true) {
                obj.style.visibility = '';
                obj.style.height = '';
            }
            else {
                obj.style.visibility = 'hidden';
                obj.style.height = '0px';
            }
        }
        obj = window.parent.document.getElementById('divProfileDetail');
        if (obj != null) {
            if (regUser == true) {
                obj.style.visibility = 'hidden';
                obj.style.height = '0px';
                //ControlBodyShow('divProfileBody', 120);
            }
            else {
                obj.style.visibility = '';
                obj.style.height = '';
            }
        }
    }
}

//function ShowDetail(url) {
//    if (window.parent != null) {
//        var obj = window.parent.document.getElementById('fraDetail');
//        if (obj != null) {
//            obj.src = url;
//        }
//        obj = window.parent.document.getElementById('divGwbResultList');
//        if (obj != null) {
//            obj.style.visibility = 'hidden';
//            obj.style.height = '0px';
//        }
//        obj = window.parent.document.getElementById('divGwbResultDetail');
//        if (obj != null) {
//            obj.style.visibility = '';
//            obj.style.height = '';
//            obj.style.width = '';
//        }
//        obj = window.parent.document.getElementById('tdGwbResultDetail');
//        if (obj != null) {
//            obj.style.width = '100%';
//        }
//    }
//}

function ShowDetail(url, key) {

    fenster = window.open(url, "window" + key, "width=720,height=600,status=yes,scrollbars=yes,resizable=yes");
    if (fenster == null) {
        alert('Popups werden von Ihrem Browser möglicherweise geblockt,\ndeaktivieren Sie den Popup-Blocker oder klicken Sie direkt auf die Bezeichnung oder das Vorschaubild.');
    }
    else {
        fenster.focus();
    }
    
}

function HideDetail() {
    if (window.parent != null) {
        var obj = window.parent.document.getElementById('divGwbResultDetail');
        if (obj != null) {
            obj.style.visibility = 'hidden';
            obj.style.height = '0px';
            obj.style.width = '0px';
        }
        obj = window.parent.document.getElementById('tdGwbResultDetail');
        if (obj != null) {
            obj.style.width = '0px';
        }
        obj = window.parent.document.getElementById('divGwbResultList');
        if (obj != null) {
            obj.style.visibility = '';
            obj.style.height = '';
        }
    }
}

function ControlBodyToggle(id, height) {
    var obj = document.getElementById(id);
    var objContent = document.getElementById(id + "Content");

    if (obj != null) {
        if (obj.style.visibility == '') {
            obj.style.visibility = 'hidden';
            if (objContent != null) {
                obj.style.height = '0px';
            }
        }
        else {
            obj.style.visibility = '';
            if (objContent != null) {
                obj.style.height = objContent.offsetHeight + 'px';
            }
        }
    }
    ResizeFrame();
}

function ControlBodyShowTimeout(id, height) {
    setTimeout("ControlBodyShow('" + id + "', " + height + ");", 0);
}

function ControlBodyShow(id, height) {
    var obj = document.getElementById(id);
    var objContent = document.getElementById(id + "Content");

    if (obj != null) {
        obj.style.visibility = '';
        if (objContent != null) {
            obj.style.height = height + 'px';
        }
    }
    ResizeFrame();
}
