/*
 * This is a basic example for ObjectiveDegradation
 * a Message is displayed on a screen...
 */

var Message = Class.create();

Message.prototype = {
	initialize: function() {
		;
	},
	
	display: function() {
		this.screen.draw(this)
	},
	string: '',
	test: false,
	screen: null
};

var Screen = Class.create();

Screen.prototype = {
	initialize: function() {
		;
	},

	draw: function(message) {
		var html = message.string;
		if(message.test) {html = '<span style="color:red">'+html+'</html>'}
		this._element.innerHTML = html;
	}
};

var BigScreen = Class.create();

BigScreen.prototype = {
	draw: function(message) {
		var html = message.string;
		if(message.test) {html = '<strong style="color:red">'+html+'</strong>'}
		this._element.innerHTML = 	this._element.innerHTML+html;
	}
};

var Toggleable = Class.create();

Toggleable.prototype = {
	toggle: function() {
		Element.toggle(this._element);
	}
};

var ToolBox = Class.create();

ToolBox.prototype = {
	target: null,
	toggle: function() {
		this.target.toggle();
	}
};

new ObjectiveDegradation({
		'Message': Message,
			'Screen': Screen,
			'BigScreen': BigScreen,
			'Toggleable': Toggleable,
			'ToolBox': ToolBox
			});