function JSCargarCentros(jsNom)
{
	jsS = f.BusqCentTx.length;
	for (jsI=0; jsI<jsS; jsI++) {
		f.BusqCentTx.options[0]=null;
	}
	f.BusqCentTx.options[0]=new Option("", "");
	if (jsNom=="") return false;
	jsK=0;
	jsP = jsComunidades.length;
	for (jsI=0; jsI<jsP; jsI++) {
		if (jsComunidades[jsI]==jsNom) {
			jsK = jsK + 1;
			f.BusqCentTx.options[jsK] = new Option(jsCentros[jsI], jsURLCentros[jsI]);
		}
	}
}
function JSRellenarCampos()
{
	if (jsCPInicio!="") {
		f.cpos.value = jsCPInicio;
	} else {
		jsS1 = f.Comunidad.length;
		for (jsI1=0; jsI1<jsS1; jsI1++) {
			if (f.Comunidad.options[jsI1].text==jsComunidadInicio) {
				f.Comunidad.selectedIndex = jsI1;
				JSCargarCentros(jsComunidadInicio);
				jsS2 = f.BusqCentTx.length;
				for (jsI2=0; jsI2<jsS2; jsI2++) {
					if (f.BusqCentTx.options[jsI2].text==jsCentroInicio) {
						f.BusqCentTx.selectedIndex = jsI2;
					}
				}
				break;
			}
		}	
	}
}
function JSValidarPA()
{
	retorno = true;
	var eleComunidad = f.Comunidad;
	var eleCentro = f.BusqCentTx;
	var eleNombre = f.BusqNombTx;
	var eleApel = f.BusqApelTx;
	var elePuesto = f.BusqPuestoTx;
	if (eleComunidad && eleCentro && elePuesto) {	
		if (Trim(eleNombre.value) =='' && Trim(eleApel.value) =='' && eleComunidad.selectedIndex==0  && eleCentro.selectedIndex==0 && elePuesto.selectedIndex==0) {	
			alert ("Debe introducir algún dato para la búsqueda")
			retorno = false;
		}else if (eleComunidad.selectedIndex!=0  && eleCentro.selectedIndex==0) {
			alert ("Si selecciona la comunidad, debe indicar el centro")
			retorno = false;	
		}
	}
	return retorno;
}

