var JUHPCleartext = Class.create();
JUHPCleartext.prototype = {
	initialize : function(element, options) {
		this.id = element.identify();
		this.element = $(element);
		this.value = this.element.getValue();

		this.element.on('focus', this.onFocus.bind(this));
		this.element.on('blur', this.onBlur.bind(this));
	},
	onFocus : function() {
		if (this.element.getValue() == this.value) this.element.value = '';
	},
	onBlur : function() {
		if (this.element.getValue() == '') this.element.value = this.value;
	}
}
Element.addMethods('INPUT', { clearText : function(e) { return new JUHPCleartext(e); } });
Event.observe(window, 'load', function() { $$('input[type=text]').invoke('clearText'); });
