
/**
Screen Static Class
*/
var screener = {
	visible : false,

	/**
	Shows the screen
	*/	
	show : function() {
		var elem = $e('screenMask');
		elem.style.height = this.getViewportHeight() + "px";
		elem.style.top = this.getScrollTop() + "px";
		elem.style.display = 'block';		
		this.visible = true;
	},
	
	/**
	Handles the scroll event for the window
	*/
	handleScroll : function(event) {
		if(screener.visible) {
		
			//alert("Q=" + this.getScrollTop());
		
			$e('screenMask').style.top = this.getScrollTop() + "px";
		}
	},
	
	/**
	Hides the screen
	*/	
	hide : function() {
		if(this.visible) {
			$e('screenMask').style.display = 'none';
			this.visible = false;
		}
	},	
	
	/**
	Gets the height of the window
	*/
	getViewportHeight : function () {
		if (window.innerHeight != window.undefined) return window.innerHeight;
		if (document.compatMode == 'CSS1Compat') return document.documentElement.clientHeight;
		if (document.body) return document.body.clientHeight; 
		return window.undefined; 
	},

	/**
	Gets the width of the window
	*/
	getViewportWidth : function () {
		if (window.innerWidth != window.undefined) return window.innerWidth; 
		if (document.compatMode == 'CSS1Compat') return document.documentElement.clientWidth; 
		if (document.body) return document.body.clientWidth; 
		return window.undefined; 
	},
	
	/**
	Gets the current scroll-top position (per browser)
	*/
	getScrollTop : function() {
		if( typeof( window.pageYOffset ) == 'number' ) {
			return window.pageYOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			return document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    return document.documentElement.scrollTop;
		}
		return 0;
	}

};