
  function revisaEmail(email) {
	var checkOK = "abcdefghijklmnopqrstuvwxyzABDCEFGHIJKLRMNOPQRSTUVWXYZ1234567890_-.@";
	var checkStr = email.value;
	var allValid = true;
	var numArroba = 0;
	var numPunto = 0;
	
	if (email.length<8) return (false);

	/******** Verifica caracteres ********/
	for (i = 0;  i < email.length;  i++) {
		ch = email.charAt(i);
		if ((ch=='@') && (i>0)) { numArroba++; continue; }
		if ((ch=='.') && (i>0)) { numPunto++; continue; }
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) break;
		}
		if (j == checkOK.length) { allValid = false;  break;  }
	}
	if ((numArroba!=1) || (numPunto<1)) return(false);
	if (!allValid) return (false);
	return (true);
  }	

function validaForm(theForm) {
  if (theForm.name.value == "")  {
	alert("Ingrese su nombre completo, por favor.");
	theForm.name.focus();
	return (false);
  }
  if (theForm.name.value.length <8) {
	alert("El nombre ingresado parece ser muy corto. Por favor, escriba su nombre y apellido.");
	theForm.name.focus();
	return (false);
  }
  if (revisaEmail(theForm.email.value)==false) {
	alert("Debe ingresar su dirección de correo electrónico correctamente.");
	theForm.email.focus();
	return (false);
  }
  if (theForm.pin.value.length!=4) {
	alert("Debe ingresar su PIN (número identificación) correctamente.\nSi no tiene uno, inscríbase para obtenerlo.");
	theForm.pin.focus();
	return (false);
  }
  if (theForm.subject.length > 50) {
	alert("El Asunto o Tema ingresado es muy largo. Por favor, sea más preciso.");
	theForm.subject.focus();
	return (false);
  }
  if (theForm.body.value.length==0) {
	alert("Por favor, ingrese un texto en el cuerpo del mensaje.");
	theForm.body.focus();
	return (false);
  }
/*  if (!theForm.checkCondiciones.checked) {
	alert("Ud. debe haber leído y aceptado las condiciones.\nRevise por favor.");
	theForm.checkCondiciones.focus();
	return (false);
  } */
  return (true);
}

	

