/**
 * input text value
 * CLASS name 'not-active' deactivate this function
 */
window.addEvent('domready', function() {
	var elInputText = $$('input.tip')	
	var arrDefVal = new Array();
	var arrDefId = new Array();
	elInputText.each(function(e){
		arrDefVal.push(e.getValue());
		arrDefId.push(e.getProperty('id')); 
	});	
	elInputText.addEvents({
		'focus': function(){
			this.addClass('focus');
			this.removeClass('tip');
			if(this.value == arrDefVal[arrDefId.indexOf(this.id)]){
				this.value = '';				
			}
		},
		'blur': function(){
			this.removeClass('focus');			
			if(this.value == ''){
				this.addClass('tip');
				this.value = arrDefVal[arrDefId.indexOf(this.id)];				
			}
		}
	});	
	elInputText.getParent('form').addEvent('submit', function(){
		elInputText.each(function(e){
			if(e.value == arrDefVal[arrDefId.indexOf(e.id)]){
				e.value = '';    				
			}
		});
	});
});
