function checkForm (frm)
{

	sMensaje = "Algunos de los siguientes datos no han sido rellenados o son incorrectos:\n\n"

	//Esta variable me indica si todo es correcto.
	sCheckOk = "-1"

	if ((frm.nombre.value.length <= 0) || (frm.nombre.value == 'Nombre y apellidos'))
	{

		sMensaje = sMensaje + " ++ Nombre y apellidos\n"
		if (sCheckOk=="-1")
		{
			sCheckOk = "nombre"
		}
	}
	
	if ((frm.telefono.value.length <= 0) || (frm.telefono.value == 'Número de teléfono'))
	{

		sMensaje = sMensaje + " ++ Número de teléfono\n"
		if (sCheckOk=="-1")
		{
			sCheckOk = "telefono"
		}
	}


	if ((frm.email.value.length > 0) || (frm.email.value == 'Dirección de correo electrónico'))
	{
		if (!isMail(frm.email.value))
		{
			sMensaje = sMensaje + " ++ Dirección de correo electrónico\n"
			if (sCheckOk=="-1")
			{
				sCheckOk = "email"
			}

		}
	}

	if (sCheckOk=="-1")
	{

		//frm.action = "#"
		frm.action = "../php/submit.php"
		frm.submit();

	}
	else
	{
		eval("frm."+sCheckOk+".focus()")
		alert(sMensaje);

	}
}

function isMail (sCadena)
{

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(sCadena))
		return (true)
	return (false)

}
