// JavaScript Document - Enviar correo

function enviarCorreoEs()
{
	var errores = false;
	var texto_errores = "";
	var filtro  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	
	if (document.formulario_aldia.nom_aldia.value == "")
	{
			texto_errores = texto_errores + "\n- Introduzca su nombre";
			errores = true;
	}

	
	if (!filtro.test(document.formulario_aldia.mail_aldia.value))
	{
		texto_errores = texto_errores + "\n- Introduzca un E-mail válido (Ej:correo@correo.es) ";
		errores = true;
	}

	
	if (errores == true)
	{
		alert("Se han producido los siguientes errores:" + texto_errores);
	}
	else
	{
		document.formulario_aldia.submit();
	}
}


function enviarCorreo()
{
	var errores = false;
	var texto_errores = "";
	var filtro  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	
	if (document.formulario_aldia.nom_aldia.value == "")
	{
			texto_errores = texto_errores + "\n- Introdueixi el seu Nom";
			errores = true;
	}

	
	if (!filtro.test(document.formulario_aldia.mail_aldia.value))
	{
		texto_errores = texto_errores + "\n- Introdueixi un E-mail vālid (Ej:correo@correo.es) ";
		errores = true;
	}

	
	if (errores == true)
	{
		alert("S'han produīt els següents errors:" + texto_errores);
	}
	else
	{
		document.formulario_aldia.submit();
	}
}
