function documentOverlay(opacity, color) {
	if(opacity != undefined)
		this.opacity = opacity
	else
		this.opacity = 0.7;
		
	if(color)
		this.color = color;
	else
		this.color = '#d0bf71';
		
	this.zindex = 1000;
	this.overlay = null;
	
	this.show = function() {
		var o = document.getElementById('doc_overlay');
    if(!o) {
			var o = document.createElement('div');
			o.id = "doc_overlay";
			document.getElementsByTagName('body')[0].appendChild(o);
		}
		this.overlay = o;
		this.style(o, {
			position: 'absolute',
			top: '0px',
			left: '0px',
			width: '100%',
			//height: this.getDocHeight()+'px',
			height: '100%',
			background: this.color,
			zIndex: this.zindex,
			filter: 'alpha(opacity=' + this.opacity * 100 + ')',
			opacity: this.opacity
		});
			
		/*	
		} else {
			this.style(o,{background:color||'#000',display:'block'});
		}
		*/
	}

	this.hide = function() {
		var o = document.getElementById('doc_overlay');
		o.style.display = 'none';
	}

	this.style = function(obj,s) {
		for ( var i in s ) {
			obj.style[i] = s[i];
		}
	}
	
	this.getDocHeight =  function() {
		var Y,YT;
		
		if( self.innerHeight ) {
			Y = self.innerHeight;
		}	else if (document.documentElement && document.documentElement.clientHeight) {
			Y = document.documentElement.clientHeight;
		} else if (document.body && document.body.clientHeight) {
			Y = document.body.clientHeight;
		}
		if( document.body ) {
			YT = document.body.clientHeight;
		}
		if(YT > Y) {
			Y = YT;
		}
		return Y;
	}
}

