/**
 * @author joeraygregory
 */


function input() {
			/* ######################################
				* Textfield Controller by author Joe Ray Gregory @ WebSeason GmbH
				* all rights by the author
				* Version 0.01 alpha
			###################################### */
				/*-------------------------------
				 -> Start Config
				 ------------------------------*/
				var borderOff = '1px solid #a2aab4';
				var borderOn = '1px solid #305aa7';
				var fieldClass = 'text';				
				$$('.'+fieldClass).each(function(el) {

					var input = el.value;	
					function border(wert) {
						var bla = el.setStyle('border', wert);
						return bla;
					}
					var c = 0; // Count var
					el.onfocus = function() {
						if(c==0) { 
							this.value = '';
							border(borderOn);
							c++;
						} else {
							border(borderOn);
						}
					}
					el.onblur = function() { 
						if(this.value=='') {
							this.value = input;
							c--;
						}
						border(borderOff);
					}
					if(el.getParent().getChildren().length > 2) {
						el.onfocus = function(){
							this.getPrevious().setStyle('display', 'none');
						}
					}
				});
}

var error = function() {
	$$('#login .error').each(function(el){
		el.setOpacity(0);
		el.effect('opacity').start(0,1);
	});
}
