function validaTelf() {
	
	var valor = document.getElementById('tel').value;
	//alert('valor: '+valor);
	if ((valor == null)||(valor == "")||(/^\s+$/.test(valor))) {
		alert("Debes rellenar el campo de telefono.");
		document.getElementById('tel').focus();
		return false;
	}
	if(isNaN(valor)) {
		alert("El campo telefono debe ser numerico.");
		return false;
	}
	if(validaNumeroTelefono(valor)) {
		document.getElementById('searchform').submit();
	} else {
		alert("La longitud minima del numero de telefono debe ser 9.");
	}
	return false;
}

function validaNumeroTelefono(telefono) {
	if ((telefono == null)||(telefono == "")||(/^\s+$/.test(telefono))) { 
		return false;
	} 
	if( !(/^\d{9}$/.test(telefono)) ) {
	  return false;
	} else {
		return true;
	}
}

function validaFullForm() {
	
	var valor = document.getElementById('dia').value;
	if ((valor == null)||(valor == "")) {
		alert("Debes escojer una fecha.");		
		return false;
	}
	
	valor = document.getElementById('nom').value;
	if ((valor == null)||(valor == "")) {
		alert("Introduce tu nombre.");		
		return false;
	}	
	
	valor = document.getElementById('telf').value;
	if (validaNumeroTelefono(valor)) {
		alert("Introduce un telefono correcto.");		
		return false;
	}	
	
	valor = document.getElementById('ciu').value;
	if ((valor == null)||(valor == "")) {
		alert("Introduce la ciudad.");		
		return false;
	}	
	
	valor = document.getElementById('dir').value;
	if ((valor == null)||(valor == "")) {
		alert("Introduce tu direccion.");		
		return false;
	}	
	document.getElementById('fullform').submit();
	return true;
}
