function addEvent(elem, type, eventHandle) {
    if (elem == null || elem == undefined) return;
    if ( elem.addEventListener ) {
        elem.addEventListener( type, eventHandle, false );
    } else if ( elem.attachEvent ) {
        elem.attachEvent( "on" + type, eventHandle );
    }
};

function getDocHeight() {
    return Math.max(orgDocHeight, $(window).height());
}

function getDocWidth() {
    return Math.max(orgDocWidth, $(window).width());
}

function prepareBg(){
    $('#global_body').width(getDocWidth());
    $('#admin_strip_wrapper').width(getDocWidth());
    $('#global_body').height(getDocHeight() - $('#admin_strip_wrapper').height());
    
    addEvent(window, "resize", function() { 
        $('#global_body').width(getDocWidth());
        $('#admin_strip_wrapper').width(getDocWidth());
        $('#global_body').height(getDocHeight() - $('#admin_strip_wrapper').height());
    });
}

