Wiking.widgets.BlackScreen = new function()
{ 
    function Layer(){}
    Layer.prototype = new GControl();
    Layer.prototype.initialize = function(map){
        var opacity = Prototype.Browser.IE ? 'filter:alpha(opacity=50);' : 'opacity:0.5';
        div = document.createElement('div');
        div.style.cssText="z-index:100;height:"+Wiking.getMap().getSize().height+'px;width:100%;background:black;'+opacity;
        map.getContainer().appendChild(div);
        
        this.div_=div;
        return div;
    }
    Layer.prototype.getDefaultPosition = function(){
        return new GControlPosition(G_ANCHOR_TOP_LEFT);
    }
    Layer.prototype.selectable = function(){return false;}
    Layer.prototype.printable = function(){return true;}
    Layer.prototype.setZ = function(z){
        this.div_.style.zIndex=z;
    } 
    var object = false;
    this.draw = function(){
        if (!object) object = new Layer();
        var map = Wiking.getMap();
        map.disableScrollWheelZoom();
        map.addControl(object);
    };
    this.clear = function(){
        var map = Wiking.getMap();
        map.enableScrollWheelZoom();
        map.removeControl(object);
    };
    this.setZ = function(z){
        object.setZ(z);
    }
};
