function ShowSysNotices(){
    SetTransDivPosition();
    transpBG = document.getElementById('transparentBG');
    sys_notice_frame = document.getElementById('sys_notice_layer');

    doc_width = document.body.clientWidth;
    window_height = document.body.clientHeight;
    transpBG.style.height = window_height;
    transpBG.style.width = doc_width;

    iframe_top = window_height/2 - 300;
    if (iframe_top < 0){
        iframe_top = 0;
    }
    iframe_left = doc_width/2 - 305;
    if (iframe_left < 0){
        iframe_left = 0;
    }

    sys_notice_frame.style.top = iframe_top;
    sys_notice_frame.style.left = iframe_left;

    transpBG.style.visibility = 'visible';
    sys_notice_frame.style.visibility = 'visible';
}

function HideSysNotices(){
    transpBG = document.getElementById('transparentBG');
    sys_notice_frame = document.getElementById('sys_notice_layer');

    transpBG.style.visibility = 'hidden';
    sys_notice_frame.style.visibility = 'hidden';

    sys_notice_frame.style.top = 0;
    sys_notice_frame.style.left = 0;
    transpBG.style.top = 0;
    transpBG.style.left = 0;
}

        var xMin = 0;
        var yMin = 0;
        var xMax = 0;
        var yMax = 0;

        function refreshClientDimentions(){
            xMin = document.body.scrollLeft;
            yMin = document.body.scrollTop;

            xMax = document.body.clientWidth;
            yMax = document.body.clientHeight;
        }

function getElementPositionEx(objElement){
    var nXPos = objElement.offsetLeft;
    var nYPos = objElement.offsetTop;
    var objParent = objElement.offsetParent;

    while (objParent.tagName != "BODY") {
        nXPos += objParent.offsetLeft;
        nYPos += objParent.offsetTop;

        objParent = objParent.offsetParent;
    }

    return {_x:nXPos, _y:nYPos};
}
function SetTransDivPosition(){
    refreshClientDimentions();
    trans_div = document.getElementById("transparentBG");
    sys_notice_frame = document.getElementById("sys_notice_layer");
    main_tbl = document.getElementById("main_table");
    var oPos = getElementPositionEx(main_tbl);

    if (trans_div && trans_div.style.visibility == 'visible'){
                doc_width = document.body.clientWidth;
                window_height = document.body.clientHeight;

                var yPos = yMin + oPos._y;
                trans_div.style.top = yPos;
                //sys_notice_frame.style.top = yPos + 50;

                iframe_left = doc_width/2 - 305;
                if (iframe_left < 0){
                    iframe_left = 0;
                }
                iframe_top = window_height/2 - 300 + yPos;
                if (iframe_top < 0){
                    iframe_top = 0;
                }

                sys_notice_frame.style.top = iframe_top;
                sys_notice_frame.style.left = iframe_left;

                trans_div.style.height = window_height;
                trans_div.style.width = doc_width;
    }
}

window.onresize = SetTransDivPosition;
window.onscroll = SetTransDivPosition;

