

function LayersOSMessageBoard(referal, displayable){
	this._referal = referal;
	this._displayable = displayable;
	this._isEditing = false;
	
	var me = this;
	
	$('#layersOS_log_close').click(
		function(){
			me.LayerOSMessageBoardClick();
		}
	);
	
	$(document).keydown(function(e){
		if( (e.which == 27 || e.which == 13) && !me._isEditing ) { // ESC or return
			me.LayerOSMessageBoardClick();
		}
	});
	
}


LayersOSMessageBoard.prototype._referal;
LayersOSMessageBoard.prototype._displayable;
LayersOSMessageBoard.prototype._isEditing;


/*
 *
 */
LayersOSMessageBoard.prototype.show = function(message, aFunction){
	var tmp = "<li>" + message + "</li>";
	try{
	    
	    var me = this;
		this._displayable.html(tmp);
		this._displayable.parent().fadeIn();
		
		if(aFunction){
		    $(document).keydown(function(e){
        		if( (e.which == 27 || e.which == 13) && !me._isEditing ) { // ESC or return
        		    eval(aFunction());
        		}
        	}); 
		}
		
	}catch(e){
	}
	
}



/*
 *
 */
LayersOSMessageBoard.prototype.hide = function(){
	this._displayable.hide();
}


LayersOSMessageBoard.prototype.LayerOSMessageBoardClick = function(){
	this._displayable.parent().hide();
	os.getPopUpBoard().hide();
}
