function ScreenCover() {
  ScreenCover.prototype.ids++;
  this.coverId ='screen-cover-'+ScreenCover.prototype.ids;
  make_el('DIV',{className:'screen-cover',
			     id:this.coverId,
			     style:{display:'none'}},document.body);
  var me = this;
  addEvent(window,'resize',function(){me.sizeCover();},false);
};
ScreenCover.prototype.ids = 0;

ScreenCover.prototype.addCover = function() {
  this.isAdded = true;
  var div = get_by_id(this.coverId);
  className.add(get_by_tag('html')[0],'grayedout');
  div.style.display = 'block';
  set_opacity(div,50);
  this.sizeCover();

};

ScreenCover.prototype.sizeCover = function(div) {
  if(this.isAdded) {
    if(!div) div = get_by_id(this.coverId);
    var html = get_by_tag('html')[0];
    className.add(html, 'sizing');
    var docXY = doc_size();
    div.style.width = docXY.x+'px';
    div.style.height = docXY.y+'px';
    setTimeout(function(){
	className.kill(html, 'sizing'); html = null;}, 10);
  }
};
ScreenCover.prototype.hideCover = function(div) {
  if(!div) div = get_by_id(this.coverId);
  div.style.display = 'none';
};
ScreenCover.prototype.fadeCover = function() {
  var div = get_by_id(this.coverId);
  this.hideCover(div);
  //Fade.Out(div,this.hideCover,0);
  this.isAdded = false;
  className.kill(get_by_tag('html')[0],'grayedout');
};
