function CheckAll() {
  var errors = "";
  var reply   = "";
  var i = 0;


//alert ("start-->" + document.body.document.rform.name.value + "<--end");
//return false
//return true

  for (i; i < document.body.document.rform.reply.length; i++) {
    if ( document.body.document.rform.reply[i].checked ) {
      reply = document.body.document.rform.reply[i].value;
    }
  }


  if ( reply == "email" ) {
   var emailsplitted;
   var emailval = document.body.document.rform.email.value;

   if ( emailval.length <= 0 || emailval.length > 40 ) {
     errors += emailmandatory;
   }else if ( emailval.length <= 5 ) {
     errors += emailshort;
   }else{
     emailsplitted = emailval.split("@");
     if ( emailsplitted.length < 2 || emailsplitted.length > 2 ) {
       errors += emailinvalid;
     }
     if ( emailsplitted.length == 2 ) {
       if ( emailsplitted[0].length == 0 || emailsplitted[1].length == 0 ) {
         errors += emailinvalid;
       }
     }
     emailsplitted = emailval.split(".");
     if ( emailsplitted.length <= 1 ) {
       errors += emailnodot;
     }
   }
  }else if ( reply == "tel" ) {
   if ( document.body.document.rform.telefono.value.length <= 0 || document.body.document.rform.telefono.value.length > 15 ) {
     errors += phonemandatory;
   }
  }else if ( reply == "fax" ) {
   if ( document.body.document.rform.fax.value.length <= 0 || document.body.document.rform.fax.value.length > 15 ) {
     errors += faxmandatory;
   }
  }else if ( reply == "ptt" ) {
   if ( document.body.document.rform.name.value.length <= 0 || document.body.document.rform.lastname.value.length <= 0 || document.body.document.rform.indirizzo.value.length <= 0 ) {
     errors += addressmandat;
   }
  }else{
    alert("wrong reply by field");
  }
  if ( document.body.document.rform.msg.value.length < 10 || document.body.document.rform.msg.value.length > 3000 ) {
    errors += badmsg;
  }


  if ( errors.length > 1 ) {
    alert(errorilabel + errors);
    return false;  // FORM NOT submitted
  }else{
    return true;
  }
}
