function validate_email(field)
{
	with (field)
	{
		apos = value.indexOf("@");
		dotpos = value.lastIndexOf(".");
		if (apos < 1 || dotpos - apos < 2)
		{
			alert("Por favor, ingrese un email válido.");
			return false;
		}
		else 
		{
			return true;
		}
	}
}

function validate_form(thisform)
{
	with (thisform)
	{
		if(nombre.value.length < 1 || telefono.value.length < 1 || email.value.length < 1 || consulta.value.length < 1)
		{
			alert("Por favor, complete todos los datos."); 
			return false;
		}

		if (validate_email(email)==false)
		{
			email.focus();
			return false;
		}
	}
}