/**
 * Console - For improved debugging
 *
 * @version		1.0
 *
 * @license		GNU Lesser General Public License
 * @author		Gerrit Böttcher <gerrit.boettcher [at] gmail.com>
 * @copyright	2007 fresh frames GmbH & Co. KG <http://www.freshframes.com>
 */
var Console = {};
Console.Base = new Class({
	options: {
		element: ''
	},
	initialize: function(options) {
		this.element = $(options.element);
		this.build();
	},
	build: function() {
		document.addEvent(window.ie ? 'keydown' : 'keypress', this.handleCommand.bindWithEvent(this));
		this.slide = new Fx.Slide(this.element);
		this.slide.hide();
		this.element.setStyle('display', 'block');
	},
	handleCommand: function(e) {
		if (e.code == 19) this.toggle();
	},
	toggle: function() {
		this.slide.toggle();
	},
	addMessage: function(msg) {
		this.element.innerHTML = this.element.innerHTML + '<span style="color: green">JAVASCRIPT</span> - ' + msg + "<br>\n";
	}
});

Console.Base.implement(new Events);
Console.Base.implement(new Options);

window.addEvent('domready',function() {
	var Console2 = new Console.Base({
		element: 'console'
	})
});

