var TextboxFocusLabel = new Class({
	elId: '',
	elValue: '',
	blurColor: '#8a8a8a',
	activeColor: '#000',
    initialize: function (e) {
		this.elId = e;
		window.addEvent('domready', this.ready.bind(this));
	},
	ready: function() {
		this.elValue = $(this.elId).get('value');
		this.setBlurColor();
		$(this.elId).addEvent('focus', this.onFocus.bind(this));
		$(this.elId).addEvent('blur', this.offFocus.bind(this));
	},	
    onFocus: function() {
		if ($(this.elId).get('value') == this.elValue) {
			this.setActiveColor();
			$(this.elId).set('value', '');
		};
	},
	offFocus: function() {
		var currentValue = $(this.elId).get('value');
		if (currentValue == '') {
			this.setBlurColor();
			$(this.elId).set('value', this.elValue);
		};
	},
	setBlurColor: function() {
		$(this.elId).setStyle('color',this.blurColor);
	},
	setActiveColor: function() {
		$(this.elId).setStyle('color',this.activeColor);
	}
	
});

 


