


<!-- Comprueba numero telefono es correcto -->
function comprobar_telf(n)
{
	if(n.value!="")
	{
		numero = parseInt(n.value);
		if(isNaN(numero))
		{
			alert("N&uacute; telefono incorrecto");
			n.select();
			n.focus();
			return false;
		}	
		else 
		{
			if(numero/100000000 < 1 || numero/100000000 >= 10  )
			{	
				alert("El tel@eacute;fono tiene que tener 9 cifras");
				n.select();
				n.focus();
				return false;
			}
			else
				return true;	
		}
	}	
}


<!-- Comprueba un email es correcto -->
function comprobar_mail(email)
{
	var ind1, ind2, ind3, valor;
	valor = email.value;	 
	ind1 = valor.indexOf('@');
	ind2 = valor.lastIndexOf('.');
	ind3 = valor.lastIndexOf('@');
	if ((ind1<=0) || (ind2<ind1) || (ind3 != ind1))
	{    
		alert("El mail es incorrecto");
		email.focus();
		email.select();
		return false;
	}	
	else
		return true;
}


