

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "No has escrito un email.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Por favor escribe un email válido.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "El email contiene carácteres ilegales.\n";
       }
    }
return error;    
}


// non-empty textboxes

function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "No has escrito ningún nombre.\n"
  }
return error;	  
}

function isEmpty2(strng) {
var error = "";
  if (strng.length == 0) {
     error = "No has escrito ningún apellido.\n"
  }
return error;	  
}

function isEmpty3(strng) {
var error = "";
  if (strng.length == 0) {
     error = "No has escrito ningún mensaje o consulta.\n"
  }
return error;	  
}


// valid selector from dropdown list

function checkDropdown(choice) {
var error = "";
    if (choice == 0) {
    error = "Por favor elige un tratamiento de la lista.\n";
    }    
return error;
}  

