﻿

function EnableUI(backgroundDiv, state) {

  /*_backgroundElement = backgroundDiv;

    if (!state) {
        _backgroundElement.style.display = '';
        _backgroundElement.style.position = 'absolute';
        _backgroundElement.style.left = '0px';
        _backgroundElement.style.top = '0px';

        var clientBounds = this._getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
        _backgroundElement.style.width =
                   Math.max(Math.max(document.documentElement.scrollWidth,
                   document.body.scrollWidth), clientWidth) + 'px';
        _backgroundElement.style.height =
                   Math.max(Math.max(document.documentElement.scrollHeight,
                   document.body.scrollHeight), clientHeight) + 'px';
        //_backgroundElement.style.zIndex = 499;
        _backgroundElement.className = "popupBackground";
    }
    else {
        _backgroundElement.style.display = 'none';
    }*/
}

function _getClientBounds() {
    var clientWidth;
    var clientHeight;
    switch (Sys.Browser.agent) {
        case Sys.Browser.InternetExplorer:
            clientWidth = document.documentElement.clientWidth;
            clientHeight = document.documentElement.clientHeight;
            break;
        case Sys.Browser.Safari:
            clientWidth = window.innerWidth;
            clientHeight = window.innerHeight;
            break;
        case Sys.Browser.Opera:
            clientWidth = Math.min(window.innerWidth,
                                  document.body.clientWidth);
            clientHeight = Math.min(window.innerHeight,
                                   document.body.clientHeight);
            break;
        default:  // Sys.Browser.Firefox, etc.
            clientWidth = Math.min(window.innerWidth,
                                  document.documentElement.clientWidth);
            clientHeight = Math.min(window.innerHeight,
                                   document.documentElement.clientHeight);
            break;
    }
    return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
}


