function validate(theForm) {
	if (theForm.destinatario.value == "") {
		alert("Por favor, ingrese el nombre del destinatario.");
		theForm.destinatario.focus();
		return false;
  	}
  else if (!isChar(theForm.destinatario.value)) {
		alert("El nombre del destinatario no es correcto. Por favor, ingreselo nuevamente.");
		theForm.destinatario.focus();
		theForm.boton_enviar.enabled=true;
		return false;
	}

	if (theForm.to.value == "") {
		alert("Por favor, ingrese el E-mail del destinatario.");
		theForm.to.focus();
		return false;
  } else if (!isCorreo(theForm.to.value)) {
		alert("El E-mail del destinatario no es correcto. Por favor, ingreselo nuevamente.");
		theForm.to.focus();
		theForm.boton_enviar.enabled=true;
		return false;
	}
	
	if (theForm.remitente.value == "") {
		alert("Por favor, ingrese el nombre del remitente.");
		theForm.remitente.focus();
		return false;
  } else if (!isChar(theForm.remitente.value)) {
		alert("El nombre del remitente no es correcto. Por favor, ingreselo nuevamente.");
		theForm.remitente.focus();
		theForm.boton_enviar.enabled=true;
		return false;
	}
	
	
	if (theForm.from.value == "") {
		alert("Por favor, ingrese el E-mail del remitente.");
		theForm.from.focus();
		return false;
  } else if (!isCorreo(theForm.from.value)) {
		alert("El E-mail del remitente no es correcto. Por favor, ingreselo nuevamente.");
		theForm.from.focus();
		return false;
	}
	theForm.submit();
  return true;
}

function isChar (Data)
{
	var patron = /^[áéíóúa-zA-Z ]+$/;
	if (patron.test(Data))
		return true;
	else
		return false;
}

function isCorreo(Data)
{
	var patron = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	if (patron.test(Data))
		return true;
	else
		return false;
}

