   function CheckForm(aForm) {

     var lNbErr = 0;
     var StrError = '';
     var FirstErrField;
     var strObb = "\n";
		 var strSep_01 = '--- ------------------------------------------------- ---';
		 var strSep_00 = '== ======================== ==';   
     function CheckField( aField, aFieldID, aLen, aStrErr ) {
       if (aField.value.length < aLen) {
         if (!lNbErr) FirstErrField = aField;
         lNbErr ++;
         return '[' + lNbErr + ']\t' + aStrErr }
       else {
         return ''
       }
     }
     
     with (aForm) {
         StrError += CheckField( txtNome		, 'txtNome', 			1, 'Nome' + strObb );
         StrError += CheckField( txtCognome		, 'txtCognome', 			1, 'Cognome' + strObb );
         StrError += CheckField( txtAzienda		, 'txtAzienda', 			1, 'Azienda' + strObb );
        // StrError += CheckField( txtQualifica		, 'txtQualifica', 			1, 'Qualifica' + strObb );
				 
//         StrError += CheckField( txtSettoreAttivita		, 'txtSettoreAttivita', 			1, 'Attivita Azienda' + strObb );

				 
         StrError += CheckField( txtIndirizzo		, 'txtIndirizzo', 			1, 'Indirizzo' + strObb );
         StrError += CheckField( txtCAP		, 'txtCAP', 			1, 'CAP' + strObb );
         StrError += CheckField( txtCitta		, 'txtCitta', 			1, 'Citta' + strObb );
         StrError += CheckField( txtProv		, 'txtProv', 			1, 'Provincia' + strObb );
         StrError += CheckField( txtTel		, 'txtTel', 			1, 'Telefono' + strObb );
				 
				 
				 StrError += CheckField( txtEMail		, 'txtEMail', 			1, 'e-Mail' + strObb );
				 
     }

     if (lNbErr) {
       var StrError1 = 'Data form INCOMPLETE!\n\nMissing field'
   
       if (lNbErr > 1) StrError1 += 's [' + lNbErr + ']';
       StrError1 += ': \n' + strSep_00 + '\n' + StrError + strSep_00;
       
       alert(StrError1);
       lNbErr = 0;
       FirstErrField.focus();
       return false }
     else
       return true;
   }
	 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}	 

   function CheckForm2(aForm) {

     var lNbErr = 0;
     var StrError = '';
     var FirstErrField;
     var strObb = "\n";
		 var strSep_01 = '--- ------------------------------------------------- ---';
		 var strSep_00 = '== ======================== ==';   
     function CheckField( aField, aFieldID, aLen, aStrErr ) {
       if (aField.value.length < aLen) {
         if (!lNbErr) FirstErrField = aField;
         lNbErr ++;
         return '[' + lNbErr + ']\t' + aStrErr }
       else {
         return ''
       }
     }
     
		 function CheckRadio( aField, aFieldID, aLen, aStrErr ) {
			for (x=0; x < aField.length; x++){
				if (aField[x].checked) { return ''; }
			}
      if (!lNbErr) FirstErrField = aField[1];
      lNbErr ++;
			return '[' + lNbErr + ']\t' + aStrErr;
     }
     
     with (aForm) {
         StrError += CheckField( txtNome2		, 'txtNome2', 			1, 'Nome' + strObb );
         StrError += CheckField( txtCognome2		, 'txtCognome2', 			1, 'Cognome' + strObb );
         StrError += CheckField( txtAzienda2		, 'txtAzienda2', 			1, 'Azienda' + strObb );
        // StrError += CheckField( txtQualifica		, 'txtQualifica', 			1, 'Qualifica' + strObb );
         StrError += CheckField( txtSettoreAttivita2		, 'txtSettoreAttivita2', 			1, 'Attivita Azienda' + strObb );

         StrError += CheckRadio( txtDimensioneAzienda		, 'txtDimensioneAzienda', 			1, 'Dimensione Azienda' + strObb );

         StrError += CheckRadio( txtFatturato		, 'txtFatturato', 			1, 'Fatturato' + strObb );	
				 			 
         StrError += CheckField( txtIndirizzo2		, 'txtIndirizzo2', 			1, 'Indirizzo' + strObb );
         StrError += CheckField( txtCAP2		, 'txtCAP2', 			1, 'CAP' + strObb );
         StrError += CheckField( txtCitta2		, 'txtCitta2', 			1, 'Citta' + strObb );
         StrError += CheckField( txtProv2		, 'txtProv2', 			1, 'Provincia' + strObb );
         StrError += CheckField( txtTel2		, 'txtTel2', 			1, 'Telefono' + strObb );
				 
				 
				 StrError += CheckField( txtEMail2		, 'txtEMail2', 			1, 'e-Mail' + strObb );
				 
     }

     if (lNbErr) {
       var StrError1 = 'Data form INCOMPLETE!\n\nMissing field'
   
       if (lNbErr > 1) StrError1 += 's [' + lNbErr + ']';
       StrError1 += ': \n' + strSep_00 + '\n' + StrError + strSep_00;
       
       alert(StrError1);
       lNbErr = 0;
       FirstErrField.focus();
       return false }
     else
       return true;
   }
	 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
