function validateForm(f) {

	if (trim(f.nombre.value)=="") {		
		document.getElementById('lb_nombre').style.color="red";
		alert("El campo Nombre es obligatorio");
		f.elements['nombre'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_nombre').style.color="black";		
	}
	
	if (trim(f.ciudad.value)=="") {
		document.getElementById('lb_ciudad').style.color="red";
		alert("El campo Ciudad es obligatorio");		
		f.elements['ciudad'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_ciudad').style.color="black";
	}	

	if (trim(f.provincia.value)=="") {
		document.getElementById('lb_provincia').style.color="red";
		alert("El campo Provincia es obligatorio");
		f.elements['provincia'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_provincia').style.color="black";
	}
	
	if (trim(f.distancias.value)=="") {
		document.getElementById('lb_distancias').style.color="red";
		alert("El campo Distancias es obligatorio");
		f.elements['distancias'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_distancias').style.color="black";
	}	
	
	return true;
	
}

function validateFormOL(f) {

	if (trim(f.hora.value)=="") {		
		document.getElementById('lb_hora').style.color="red";
		alert("El campo Hora es obligatorio");
		f.elements['hora'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_hora').style.color="black";		
	}
	
	if (trim(f.texto.value)=="") {
		document.getElementById('lb_texto').style.color="red";
		alert("El campo Texto es obligatorio");		
		f.elements['texto'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_texto').style.color="black";
	}	
	
	return true;
	
}

function validateFormRE(f) {

	if (trim(f.nombre.value)=="") {		
		document.getElementById('lb_nombre').style.color="red";
		alert("El campo Nombre es obligatorio");
		f.elements['nombre'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_nombre').style.color="black";		
	}
	
	if (trim(f.fichero.value)=="") {
		document.getElementById('lb_fichero').style.color="red";
		alert("El campo Fichero es obligatorio");		
		f.elements['fichero'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_fichero').style.color="black";
	}	
	
	return true;
	
}

function confirmar(texto, accion) {

    if (confirm(texto)){
      window.location = accion;
    }else{
      return false;
    }
    
}
