function Form_enhance( form ) {    		
	     
    /* Aggiunte agli elementi */
    var elementi = form.elements;
    for (var index = 0; index < elementi.length; index++) {
    	var obj = elementi[ index ];
    	if( obj.type == 'text' || obj.type == 'select-one' || obj.type == 'textarea' || obj.type == 'password' ) {

  	   		obj.savedClassName = obj.className;
    	  	obj.savedOnBlur = obj.onblur;
    	  	obj.onblur = function() {
    			this.className = this.savedClassName;
    			if( this.savedOnBlur != undefined ) this.savedOnBlur();
	   		};	

    	   	obj.savedOnFocus = obj.onfocus;
    	   	obj.classNameOnFocus = (obj.savedClassName == '') ? 'focus' : obj.savedClassName + '-focus';
    	   	obj.onfocus = function() {
    	   		if( this.type == 'text' ) {
    	   			this.select(); 
    	   		}
    	   	
    	   		this.className = this.classNameOnFocus;
    	   		if( this.savedOnFocus != undefined ) this.savedOnFocus();
    		};
    	}
    		    		    		
    	if( obj.setValue == undefined ) {
	    		if( obj.type == 'text' || obj.type == 'textarea' ) {
	    			obj.setValue = function( value ) {
	    				this.value = value;
	    			};
	    		} else if( obj.type == 'select-one' ) {
	    			obj.setValue = function( value ) {
						options = this.options;
						for(var index = 0; index < options.length; index++) {
							if( options[index].text == value ) {
								options[index].selected = true;
								break;
							}
						}
	    			};
	    		} else if( obj.type == 'radio' ) {
	    			obj.setValue = function( value ) {
				 		list = document.getElementsByName( this.name );
	    				for(var index = 0; index < list.length; index++) {
	    					if( list[index].value == value ) {
	    						list[index].checked = true;
	    						break;
	    					}
	    				}
	    			};
	    		}else if ( obj.type == 'checkbox' ) {
	    			obj.setValue = function( value ) {
	    				this.checked = parseBool( value );
	    			};
	    		} else {
	    			obj.setValue = function( value ) {
	    			};
	    		}	
			}    				
    	}	    
}        
