
/**
Prompter Container
*/
var prompter = {
	visible : false,
	width : 0,
	height : 0,
	screened : false,
	
	/**
	Gets the matching interface element
	*/
 	getElem : function() {
		return $e('prompter');
	},
	
	/**
	Sets the content
	*/
	setContent : function(width, height) {
		this.width = width;
		this.height = height;
		//this.getElem().innerHTML = content;
	},	

	/**
	Shows the screen
	*/	
	show : function() {
		if(prompter.visible == false) {
			var selectH = $e('select_container');
			if(selectH) {
				selectH.style.visibility = 'hidden';
			}
		}
		
		
		
	
		var elem = this.getElem();
		elem.style.width = this.width + "px";
		elem.style.height = this.height + "px";
		elem.style.left = this.getLeft() + "px";
		elem.style.top = (this.getTop() + screener.getScrollTop()) + "px";
		elem.style.display = 'block';
		prompter.visible = true;
	},
	
	/**
	Gets the top value
	*/
	getTop : function() {
		var t = (screener.getViewportHeight() - this.height) / 2;
		if(t < 0) { t = 0; }		
		return t;
	},
	
	/**
	Gets the left value
	*/
	getLeft : function() {
		var l = (screener.getViewportWidth() - this.width) / 2;
		if(l < 0) { l = 0; }
		return l;
	},
	
	/**
	Handles the scroll event for the window
	*/
	handleScroll : function(event) {
		if(this.visible) {
			this.getElem().style.top = (this.getTop() + screener.getScrollTop()) + "px";
			
			if(this.screened) {
				$e('prompterMask').style.top = (this.getTop() + screener.getScrollTop()) + "px";	
			}
		}
	},
	
	/**
	Hides the screen
	*/	
	hide : function() {
		if(this.visible) {
			var elem = this.getElem();
			elem.style.display = 'none';
			
			var selectH = $e('select_container');
			if(selectH) {
				selectH.style.visibility = 'visible';
			}				
			this.visible = false;			
		}
		this.hideScreen();
	},
	
	/**
	Screens the prompter 
	*/
	showScreen : function() {
		this.screened = true;
		var pr = this.getElem();
		
		var elem = $e('prompterMask');
		elem.style.height = pr.style.height;
		elem.style.top = pr.style.top;
		elem.style.left = pr.style.left;
		elem.style.width = pr.style.width;
		elem.style.display = 'block';
		
	},
	
	
	/**
	Hides the screen effect
	*/
	hideScreen : function() {
		if(this.screened) {
			$e('prompterMask').style.display = 'none';
		}
	}	
};
