var Observer = new Class({
	Implements: [Events, Options],
	
	options: {
		events: [				
			'copy',			'cut',			'paste',		'blur',	
			'change', 		'click', 		'dblclick', 	'focus', 	
			'keydown', 		'keypress', 	'keyup', 		'mousedown',
			'mouseup',		'textInput'
		],
		attach: true
	},
	
	initialize: function(element, event) {
		this.element = $(element);
		this.addEvent('fired', event);
		this.bound = this.fire.bind(this);
		if (this.options.attach) this.attach();
	},
	
	attach: function() {
		this.events = this.options.events;
		 
		this.value = this.element.get('value');
		 
		 this.events.each((function(event) {
		 	this.element.addEvent(event, this.bound);
		 }).bind(this));
	},
	
	detach: function() {
		 this.events.each(function(event) {
		 	alert(event);
		 	this.element.removeEvent(event, this.bound);
		 });
	},
	
	fire: function() {
		var value = this.element.get('value');
		if (this.value == value) return;
		this.value = value;
		this.fireEvent('fired', [this.element, value]);
	}
});