//script

    // Controllo che il campo non sia vuoto
	function isNull( field, fieldName) 
	{

  		selected = 0;
  		fieldIsNull = 0;
   		if ( field.value == "" )
   		{
            alert(fieldName +": "+ "non puo' essere vuoto");
       		field.focus();
         	return false;        
        }
        return true;
    }
    
    // Controllo che il campo sia un intero compreso tra un valore min e max    
	function isNumberInteger(theElement, theElementName, lenElement)
	{
		var s = theElement.value;
		var filter=/^[0-9]{1,}$/;
		
        if (filter.test(s))
        {
            if (theElement.value.length==lenElement)  
	    	    return true;
            else
            {
                alert(theElementName + ": "+ "la lunghezza del campo deve essere pari a: " + lenElement);
    	        theElement.focus(); 
	            return false;
            }
        }    
	  	else  
        {
            alert(theElementName + ": "+ "il valore inserito deve essere numerico");
        }    
	    theElement.focus(); 
	    return false;
	}
   