var InputOnlinePreview = new Class({
	initialize: function(inputId) {
		this.input = $(inputId);
		this.inputPreview = $(inputId + "_preview");
		this.input.addEvent('keydown', this.onKeyPress.bindWithEvent(this));
		this.input.addEvent('keyup', this.onKeyPress.bindWithEvent(this));
		this.update();
	},

	onKeyPress: function(event) {
		event = new Event(event);
		if	(!event.control && !event.alt && !event.meta) this.update(false);
	},

	update: function(newline) {
		this.inputPreview.set('html', this.input.get('value'));
	}
});