function CheckAll() {
  var NE = (document.layers)? true : false ;
  var IE = (document.all)? true : false ;
  var errors = "";
  var reply   = "";
  var i = 0;

  if ( NE ) { 
    ref = document.bdy0;
  }else if ( IE ) {
    ref = this; 
  }else{
    ref = this; 
  }

   var emailsplitted;
   var emailval = ref.document.rform.email.value;

  if ( ref.document.rform.name.value.length == 0 ) {
    errors += namemandatory;
  }
  if ( ref.document.rform.lastname.value.length == 0 ) {
    errors += lastnamemandatory;
  }


   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;
     }
   }

  if ( ref.document.rform.subj.value.length == 0 ) {
    errors += subjmandatory;
  }

  if ( ref.document.rform.body.value.length < 10 || ref.document.rform.body.value.length > 3000 ) {
    errors += badmsg;
  }


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