   
      
      var v_parola ="";
      var link;
      
      /****************************************************************/
      
      //Verifica che sia una stringa vuota
      
      /****************************************************************/
      
      var whitespace = " \t\n\r";
      
      function isEmpty(s)
       {   
        return ((s == null) || (s.length == 0))
       }
      
      /****************************************************************/
      
      
      //Verifica che sia una stringa vuota o costituita solo di spazi bianchi
      
      /****************************************************************/
      
      function isWhitespace (s)
      
      {   var i;
      
      
          if (isEmpty(s)) return true;
      
      
          for (i = 0; i < s.length; i++)
          {   
      	var c = s.charAt(i);
      
      	if (whitespace.indexOf(c) == -1) return false;
          }
      
      
          return true;
      }
      
      
      /****************************************************************/
      
      // CanSubmit= ForceEntry(txtProva,"il campo Prova") --> Forza il riempimento del campo Prova
      
      /****************************************************************/
      
      function ForceEntry(objField, FieldName)
      {
      	var strField = new String(objField.value);
      
      	if (isWhitespace(strField)) {
      		alert("Introdurre i dati per " + FieldName);
      		objField.focus();
      		objField.select();
      		return false;
      
      	}
      
      
       return true;
      
      }
      		
      
      /****************************************************************/
      
      //mostra la stringa di errore e assegna il focus
      
      /****************************************************************/
      
      function PromptErrorMsg(Field,strError)
      {
      	alert("Immettere una data valida per  " + strError + ".");
      	Field.focus();
      }

    
    	/****************************************************************/
    
    	// CanSubmit= ForceLength(txtProva,"il campo Prova") --> 
    	  //  Forza il riempimento del campo Prova con un valore della lunghezza desiderata
    
    	/****************************************************************/
    
    	function ForceLength(objField, nLength, strWarning)
    	{
     		var strField = new String(objField.value);
     
     		if (strField.length > nLength) {
     		alert(strWarning);
     		return false;
       	} else
    		return true;
    	}	

      
      function disableForm(theform) {
      
        for (i = 0; i < theform.length; i++) {
        var tempobj = theform.elements[i];
        if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
        tempobj.disabled = true;
        }
      }

      function Form_Validator(theForm)
      {
        CanSubmit=true;
        
        if ( theForm.p_frase.value.length < 3) 
        {
           alert("Immettere nel campo Frase di ricerca una stringa di almeno 3 caratteri.")		 
    		   CanSubmit=false                   
        };
        
      	if (CanSubmit == true)
      	{
      	 	 CanSubmit=ForceLength(theForm.p_frase,50,"Il campo Frase di ricerca non puņ superare i 50 caratteri.");		 
        };
    
    		if (CanSubmit == true) disableForm(theForm);
        return CanSubmit;
      }