var OpaqueBox = new Class({
    initialize: function(){
        this.box = new Element('div', {'styles':{'backgroundColor': 'rgb(0, 0, 0)','display':'none','left':'0','height':'100%','position':'absolute','top': '0','width':'100%','xdisplay':'none','zIndex':'90','opacity':'0.5'}});
    },

    show: function() {
        this.box.inject($$('body')[0]);

        this.updateBoxHeight();
        this.box.set({'styles':{'display':'block'}});
    },

    hide: function() {
        this.box.destroy();
    },

    updateBoxHeight: function() {
        var scrollHeight = document.documentElement.scrollHeight;
        var clientHeight = document.documentElement.clientHeight;
        var height = scrollHeight > clientHeight ? scrollHeight : clientHeight;
		this.box.set({'styles':{'height': height + 'px'}});
    }
});

