function run_onload(){

}

var overlay = {
	layer: null,
	screensize: null,
	color: '#000000',
	opacity: 40,
	display: 'block',
	position: 'absolute',
	left: '0px',
	top: '0px',
	index: 2,
	
	init: function(){
		if( !document.getElementById('overlay') ){
			this.layer = document.createElement('div');
			this.layer.id = 'overlay';
		}
			
		this.getScreen();	
		
		styling  = 'display:' 							+ this.display + ';';
		styling += 'position:' 							+ this.position + ';';
		styling += 'left:' 									+ this.left + ';';
		styling += 'top:' 									+ this.top + ';';
		styling += 'width:' 								+ this.screensize[0] + 'px;';
	  styling += 'height:' 								+ ( this.screensize[1] + 200) + 'px;';
	  styling += 'background: ' 					+ this.color + ';';
		styling += 'filter:alpha(opacity='  + this.opacity + ');';
		styling += '-moz-opacity:0.' 			  + this.opacity + ';';
		styling += 'opacity:0.' 						+ this.opacity + ';';
		styling += '-khtml-opacity:.' 			+ this.opacity + ';';
		styling += 'z-index: '							+ this.index + ';';
		
		this.layer.style.cssText = styling;
	},
	
	show: function(){
		document.body.appendChild(this.layer);
		window.onresize = overlay.resize;
	},
	
	hide: function(elem){
		document.body.removeChild(document.getElementById(elem));
		document.body.removeChild(this.layer);
	},
	
	resize: function(){
		if( document.getElementById('overlay') ){
			this.getScreen();				
			bl_layer.style.width = this.screensize[0] + 'px';
			bl_layer.style.height = this.screensize[1] + 'px';
		}	
	},
	
	getScreen: function(){
		screenSize = new Array(document.documentElement.clientWidth, document.documentElement.clientHeight);
	  scrollSize = new Array(document.body.scrollWidth, document.body.scrollHeight);
	
	  returnWidth  = ( scrollSize[0] > screenSize[0] ) ? scrollSize[0] : screenSize[0];
	  returnHeight = ( scrollSize[1] > screenSize[1] ) ? scrollSize[1] : screenSize[1];

	  this.screensize  = new Array(returnWidth, returnHeight);
	}
}

window.onload = run_onload;
