function inf(h) {
    tag = document.getElementsByTagName('select');
    for (i = tag.length - 1; i >= 0; i--) {
        if (tag[i].style.visibility)
            tag[i].style.visibility = h;
    }
    tag = document.getElementsByTagName('iframe');
    for (i = tag.length - 1; i >= 0; i--)
        tag[i].style.visibility = h;

    tag = document.getElementsByTagName('object');
    for (i = tag.length - 1; i >= 0; i--)
        tag[i].style.visibility = h;
}

function ShowModal(obj) {
    inf('hidden');

    
    var obj = document.getElementById(obj);

    obj.style.width = pageWidth();
    obj.style.height = pageHeight();

    obj.style.display = 'block';
    document.body.style.overflow = 'auto';
    document.documentElement.style.overflow = 'auto';
    document.body.appendChild(obj);
    
    
    

    return false;
}

function HideModal(obj) {
    var obj = document.getElementsByName('IsOK');
    var isOK = false;
    var value; 
    for (var i = 0; i < obj.length; i++) {
        if (obj[i].checked) {
            value = obj[i].value;
            isOK = true;
        }
    }

    if (isOK) {
        //document.getElementById(obj).style.display = 'none';
        inf('display');

        var temp = document.location.href;

        if (document.location.href.indexOf('?') >= 0)
            temp = document.location.href.substring(0, document.location.href.indexOf('?'));
        document.location.href = temp + '?a=' + value;
    }
    else
        alert('Du skal v\u00E6lge ja eller nej!');
}


function pageWidth() {
    return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

function pageHeight() {
    //return window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
    if (document.body.clientHeight)
        return document.body.clientHeight;
    else
        return 2500;
}


function ShowModalOnload(ID) {
    var t = setTimeout("ShowModal('" + ID + "')", 1000)

}
 
 
 function ShowCal(id) {
    
        document.getElementById(id).style.display = 'block';
        document.getElementById(id).style.position = 'absolute';
        }
