// FUNCIONES PARA EL BUSCADOR AJAX DE GESTORAS
function retrieveURL(url) {
  alert (url);
  if (url != "") {  
   if (window.XMLHttpRequest) { // Non-IE browsers   
     req = new XMLHttpRequest();   
 
     req.onreadystatechange = processStateChange;   
         try {
	        req.open("GET", url, true);	        	         
	     } catch (e) {
	      alert(e);
	     }	    
     req.send(null);      
   } else if (window.ActiveXObject) { // IE     
            req = new ActiveXObject("Microsoft.XMLHTTP");           
            if (req) {                       
                  req.onreadystatechange = processStateChange;                 
                  req.open("GET", url, true);                              
                  req.send();
                }
   }
  }
}
 
function processStateChange() {
 
   if (req.readyState == 4) { // Complete     
     if (req.status == 200) { // OK response
          // We're going to get a list of all tags in the returned XML with the
          // names title, link and description.  Everything else is ignored.
          // For each that we find, we'll constuct a simple bit of HTML for
          // it and build up the HTML to display.  When we hit a title,
          // link or description element that isn't there, we're done.
      	
      	 alert ("OK->"+req.status);    	 
      	 //Leemos lo que trae el JSON       
      	xml = req.responseText;      
      	//Ahora hay que tratarlo para poder mostrarlo   	
      	
      	
      	
      	      	
        alert ("Resultado->"+ xml);
     } else {            
             alert("Problem: " + req.statusText);
            }
  }
}


// FUNCIONES DE LA JSP ACERCA DE INVERCO
function mostrarAI(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarAI();
		capa.style.display = "block";
	} else {
		ocultarAI();
	}
}
			
function ocultarAI(){

	/* NIVEL 1->QUE */
	var que = document.getElementById('que')
	if (que == "none")
    	que.style.display = "block";
    else
    	que.style.display = "none";
    
    /* NIVEL 1->INTRODUCCIÓN */
	var fines = document.getElementById('fines')
	if (fines == "none")
    	fines.style.display = "block";
    else
    	fines.style.display = "none";
			    	
    /* NIVEL 1->CRITERIOS */
	var actividades = document.getElementById('actividades')
	if (actividades == "none")
    	actividades.style.display = "block";
    else
    	actividades.style.display = "none";
		
    /* NIVEL 1->REQUISITOS */
	var info = document.getElementById('info')
	if (info == "none")
    	info.style.display = "block";
    else
    	info.style.display = "none";
			    
}

// FUNCIONES DE LA JSP ANEXO DEL CÓDIGO DE CONDUCTA PUBLICITARIA
function mostrarAnexo(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarAnexo();
		capa.style.display = "block";
	} else {
		ocultarAnexo();
	}
}
			
function ocultarAnexo(){

	/* NIVEL 1->NORMAS GENERALES */
	var normasGenerales = document.getElementById('normasGenerales')
	if (normasGenerales == "none")
    	normasGenerales.style.display = "block";
    else
    	normasGenerales.style.display = "none";
    
    /* NIVEL 1->CONTENIDOS */
	var normasEspecificasMedios = document.getElementById('normasEspecificasMedios')
	if (normasEspecificasMedios == "none")
    	normasEspecificasMedios.style.display = "block";
    else
    	normasEspecificasMedios.style.display = "none";
			    	
    /* NIVEL 1->PUBLICIDAD */
	var normasEspecificasInstituciones = document.getElementById('normasEspecificasInstituciones')
	if (normasEspecificasInstituciones == "none")
    	normasEspecificasInstituciones.style.display = "block";
    else
    	normasEspecificasInstituciones.style.display = "none";
		
}

// FUNCIONES DE LA JSP ASOCIACIONES
function mostrarFI(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarFI(idCapa);
		capa.style.display = "block";
	} else {
		ocultarFI(idCapa);
	}

	resaltarContinente(idCapa);
	
}


function resaltarContinente(idCapa){

	continentes = new Array("america","europa","asia","oceania","africa");
	var elemento;
	for(i=0;i < continentes.length;i++){
	
		elemento = document.getElementById(continentes[i]+"_li");
		elemento.style.color="#053e7c";
	
	}

	var elemento2 = document.getElementById(idCapa + "_li");
	elemento2.style.color="#e98600";


}

function ocultarFI(idCapa){

	var capa = document.getElementById(idCapa);
	
	if (idCapa=='america') {
	
	    /* NIVEL 1->EUROPA */
		var europa = document.getElementById('europa')
		if (europa == "none")
	    	europa.style.display = "block";
	    else
	    	europa.style.display = "none";
				    	
	    /* NIVEL 1->ASIA */
		var asia = document.getElementById('asia')
		if (asia == "none")
	    	asia.style.display = "block";
	    else
	    	asia.style.display = "none";
			
	    /* NIVEL 1->AFRICA */
		var africa = document.getElementById('africa')
		if (africa == "none")
	    	africa.style.display = "block";
	    else
	    	africa.style.display = "none";
	
	    /* NIVEL 1->OCEANIA */
		var oceania = document.getElementById('oceania')
		if (oceania == "none")
	    	oceania.style.display = "block";
	    else
	    	oceania.style.display = "none";
	    	
	}
	
	if (idCapa=='europa') {
	
		/* NIVEL 1->AMERICA */
		var america = document.getElementById('america')
		if (america == "none")
	    	america.style.display = "block";
	    else
	    	america.style.display = "none";
	    	
	    /* NIVEL 1->ASIA */
		var asia = document.getElementById('asia')
		if (asia == "none")
	    	asia.style.display = "block";
	    else
	    	asia.style.display = "none";
			
	    /* NIVEL 1->AFRICA */
		var africa = document.getElementById('africa')
		if (africa == "none")
	    	africa.style.display = "block";
	    else
	    	africa.style.display = "none";
	
	    /* NIVEL 1->OCEANIA */
		var oceania = document.getElementById('oceania')
		if (oceania == "none")
	    	oceania.style.display = "block";
	    else
	    	oceania.style.display = "none";
	    	
	}
	
	if (idCapa=='asia') {

		/* NIVEL 1->AMERICA */
		var america = document.getElementById('america')
		if (america == "none")
	    	america.style.display = "block";
	    else
	    	america.style.display = "none";
	    
	    /* NIVEL 1->EUROPA */
		var europa = document.getElementById('europa')
		if (europa == "none")
	    	europa.style.display = "block";
	    else
	    	europa.style.display = "none";
				    	
	    /* NIVEL 1->AFRICA */
		var africa = document.getElementById('africa')
		if (africa == "none")
	    	africa.style.display = "block";
	    else
	    	africa.style.display = "none";
	
	    /* NIVEL 1->OCEANIA */
		var oceania = document.getElementById('oceania')
		if (oceania == "none")
	    	oceania.style.display = "block";
	    else
	    	oceania.style.display = "none";

	}
	
	if (idCapa=='africa') {

		/* NIVEL 1->AMERICA */
		var america = document.getElementById('america')
		if (america == "none")
	    	america.style.display = "block";
	    else
	    	america.style.display = "none";
	    
	    /* NIVEL 1->EUROPA */
		var europa = document.getElementById('europa')
		if (europa == "none")
	    	europa.style.display = "block";
	    else
	    	europa.style.display = "none";
				    	
	    /* NIVEL 1->ASIA */
		var asia = document.getElementById('asia')
		if (asia == "none")
	    	asia.style.display = "block";
	    else
	    	asia.style.display = "none";
			
	    /* NIVEL 1->OCEANIA */
		var oceania = document.getElementById('oceania')
		if (oceania == "none")
	    	oceania.style.display = "block";
	    else
	    	oceania.style.display = "none";

	}
	
	if (idCapa=='oceania') {

		/* NIVEL 1->AMERICA */
		var america = document.getElementById('america')
		if (america == "none")
	    	america.style.display = "block";
	    else
	    	america.style.display = "none";
	    
	    /* NIVEL 1->EUROPA */
		var europa = document.getElementById('europa')
		if (europa == "none")
	    	europa.style.display = "block";
	    else
	    	europa.style.display = "none";
				    	
	    /* NIVEL 1->ASIA */
		var asia = document.getElementById('asia')
		if (asia == "none")
	    	asia.style.display = "block";
	    else
	    	asia.style.display = "none";
			
	    /* NIVEL 1->AFRICA */
		var africa = document.getElementById('africa')
		if (africa == "none")
	    	africa.style.display = "block";
	    else
	    	africa.style.display = "none";
	
	}

}

// FUNCIONES DE LA JSP DEL BUSCADOR
function bmostrarSubnivel3(idCapaS3) {
	var capaS3 = document.getElementById(idCapaS3);
	if (capaS3.style.display=="none") {
		bocultarSubniveles3();
		capaS3.style.display = "block";
	} else {
		bocultarSubniveles3();
	}	
}

function bmostrarSubnivel2(idCapaS2) {
	var capaS2 = document.getElementById(idCapaS2);
	if (capaS2.style.display=="none") {
		bocultarSubniveles2();
		bocultarSubniveles3();
		capaS2.style.display = "block";
	} else {
		bocultarSubniveles2();
		bocultarSubniveles3();
	}	
}

function bmostrarSubnivel(idCapaS) {
	var capaS = document.getElementById(idCapaS);
	if (capaS.style.display=="none") {
		bocultarSubniveles();
		bocultarSubniveles2();
		bocultarSubniveles3();
		capaS.style.display = "block";
	} else {
		bocultarSubniveles();
		bocultarSubniveles2();
		bocultarSubniveles3();
	}	
}
			
function bmostrar(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		bocultarMensaje();
		bocultar();
		bocultarSubniveles();
		bocultarSubniveles2();
		bocultarSubniveles3();
		capa.style.display = "block";
	} else {
		bocultar();
		bocultarSubniveles();
		bocultarSubniveles2();
		bocultarSubniveles3();
	}
}

function bocultarMensaje () {
	var mensaje = document.getElementById('mensaje')
	if(mensaje==null) {
	} else {
		if (mensaje == "none")
	    	mensaje.style.display = "block";
	    else
	    	mensaje.style.display = "none";
    }
}

function bocultarSubniveles3 () {

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var fdomesticos = document.getElementById('fdomesticos')
		if (fdomesticos == "none")
	    	fdomesticos.style.display = "block";
	    else
	    	fdomesticos.style.display = "none";

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var fgarantizados = document.getElementById('fgarantizados')
		if (fgarantizados == "none")
	    	fgarantizados.style.display = "block";
	    else
	    	fgarantizados.style.display = "none";

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var ilibre = document.getElementById('ilibre')
		if (ilibre == "none")
	    	ilibre.style.display = "block";
	    else
	    	ilibre.style.display = "none";

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var finternacionales = document.getElementById('finternacionales')
		if (finternacionales == "none")
	    	finternacionales.style.display = "block";
	    else
	    	finternacionales.style.display = "none";

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var finmobiliarios = document.getElementById('finmobiliarios')
		if (finmobiliarios == "none")
	    	finmobiliarios.style.display = "block";
	    else
	    	finmobiliarios.style.display = "none";

	    /* NIVEL 4->FONDOS DOMÉSTICOS EN ESTADÍSTICAS */
		var iexcel = document.getElementById('iexcel')
		if (iexcel == "none")
	    	iexcel.style.display = "block";
	    else
	    	iexcel.style.display = "none";

	    /* NIVEL 4->FONDOS MENSUALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEEMensuales = document.getElementById('bEEMensuales')
		if (bEEMensuales == "none")
	    	bEEMensuales.style.display = "block";
	    else
	    	bEEMensuales.style.display = "none";

	    /* NIVEL 4->FONDOS TRIMESTRALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEETrimestrales = document.getElementById('bEETrimestrales')
		if (bEETrimestrales == "none")
	    	bEETrimestrales.style.display = "block";
	    else
	    	bEETrimestrales.style.display = "none";
	    	
}

function bocultarSubniveles2 () {

	    /* NIVEL 3->MENSUALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bMensuales = document.getElementById('bMensuales')
		if (bMensuales == "none")
	    	bMensuales.style.display = "block";
	    else
	    	bMensuales.style.display = "none";

	    /* NIVEL 3->TRIMESTRALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bTrimestrales = document.getElementById('bTrimestrales')
		if (bTrimestrales == "none")
	    	bTrimestrales.style.display = "block";
	    else
	    	bTrimestrales.style.display = "none";

	    /* NIVEL 3->INFORMACIÓN GENERAL EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var igeneral = document.getElementById('igeneral')
		if (igeneral == "none")
	    	igeneral.style.display = "block";
	    else
	    	igeneral.style.display = "none";

	    /* NIVEL 3->CATEGORÍAS DE FONDOS EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var cfondos = document.getElementById('cfondos')
		if (cfondos == "none")
	    	cfondos.style.display = "block";
	    else
	    	cfondos.style.display = "none";

	    /* NIVEL 3->ESPAÑA EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEEspana = document.getElementById('bEEspana')
		if (bEEspana == "none")
	    	bEEspana.style.display = "block";
	    else
	    	bEEspana.style.display = "none";

	    /* NIVEL 3->MUNDO EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEMundo = document.getElementById('bEMundo')
		if (bEMundo == "none")
	    	bEMundo.style.display = "block";
	    else
	    	bEMundo.style.display = "none";

	    /* NIVEL 4->FONDOS MENSUALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEEMensuales = document.getElementById('bEEMensuales')
		if (bEEMensuales == "none")
	    	bEEMensuales.style.display = "block";
	    else
	    	bEEMensuales.style.display = "none";

	    /* NIVEL 4->FONDOS TRIMESTRALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEETrimestrales = document.getElementById('bEETrimestrales')
		if (bEETrimestrales == "none")
	    	bEETrimestrales.style.display = "block";
	    else
	    	bEETrimestrales.style.display = "none";

}

function bocultarSubniveles() {

    /* NIVEL 2->FONDOS DE INVERSIÓN EN NOTAS DE PRENSA */
	var bNpFondosInversion = document.getElementById('bNpFondosInversion')
	if (bNpFondosInversion == "none")
    	bNpFondosInversion.style.display = "block";
    else
    	bNpFondosInversion.style.display = "none";
    	
    /* NIVEL 2->FONDOS DE PENSIONES EN NOTAS DE PRENSA */
	var bNpFondosPensiones = document.getElementById('bNpFondosPensiones')
	if (bNpFondosPensiones == "none")
    	bNpFondosPensiones.style.display = "block";
    else
    	bNpFondosPensiones.style.display = "none";

	    /* NIVEL 3->MENSUALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bMensuales = document.getElementById('bMensuales')
		if (bMensuales == "none")
	    	bMensuales.style.display = "block";
	    else
	    	bMensuales.style.display = "none";

	    /* NIVEL 3->TRIMESTRALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bTrimestrales = document.getElementById('bTrimestrales')
		if (bTrimestrales == "none")
	    	bTrimestrales.style.display = "block";
	    else
	    	bTrimestrales.style.display = "none";

	    /* NIVEL 2->FONDOS DE INVERSION EN ESTADISTICAS */
		var bEFondosInversion = document.getElementById('bEFondosInversion')
		if (bEFondosInversion == "none")
	    	bEFondosInversion.style.display = "block";
	    else
	    	bEFondosInversion.style.display = "none";

	    /* NIVEL 3->INFORMACIÓN GENERAL EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var igeneral = document.getElementById('igeneral')
		if (igeneral == "none")
	    	igeneral.style.display = "block";
	    else
	    	igeneral.style.display = "none";

	    /* NIVEL 3->CATEGORÍAS DE FONDOS EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var cfondos = document.getElementById('cfondos')
		if (cfondos == "none")
	    	cfondos.style.display = "block";
	    else
	    	cfondos.style.display = "none";

	    /* NIVEL 2->FONDOS DE PENSIONES EN ESTADISTICAS */
		var bEFondosPensiones = document.getElementById('bEFondosPensiones')
		if (bEFondosPensiones == "none")
	    	bEFondosPensiones.style.display = "block";
	    else
	    	bEFondosPensiones.style.display = "none";

	    /* NIVEL 3->ESPAÑA EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEEspana = document.getElementById('bEEspana')
		if (bEEspana == "none")
	    	bEEspana.style.display = "block";
	    else
	    	bEEspana.style.display = "none";

	    /* NIVEL 3->MUNDO EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEMundo = document.getElementById('bEMundo')
		if (bEMundo == "none")
	    	bEMundo.style.display = "block";
	    else
	    	bEMundo.style.display = "none";

	    /* NIVEL 4->FONDOS MENSUALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEEMensuales = document.getElementById('bEEMensuales')
		if (bEEMensuales == "none")
	    	bEEMensuales.style.display = "block";
	    else
	    	bEEMensuales.style.display = "none";

	    /* NIVEL 4->FONDOS TRIMESTRALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEETrimestrales = document.getElementById('bEETrimestrales')
		if (bEETrimestrales == "none")
	    	bEETrimestrales.style.display = "block";
	    else
	    	bEETrimestrales.style.display = "none";

}
			
function bocultar(){

	/* NIVEL 1->NOTAS DE PRENSA */
	var bNotasPrensa = document.getElementById('bNotasPrensa')
	if (bNotasPrensa == "none")
    	bNotasPrensa.style.display = "block";
    else
    	bNotasPrensa.style.display = "none";
    
	    /* NIVEL 2->FONDOS DE INVERSION EN NOTAS DE PRENSA */
		var bNpFondosInversion = document.getElementById('bNpFondosInversion')
		if (bNpFondosInversion == "none")
	    	bNpFondosInversion.style.display = "block";
	    else
	    	bNpFondosInversion.style.display = "none";
	    	
	    /* NIVEL 2->FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bNpFondosPensiones = document.getElementById('bNpFondosPensiones')
		if (bNpFondosPensiones == "none")
	    	bNpFondosPensiones.style.display = "block";
	    else
	    	bNpFondosPensiones.style.display = "none";

	    /* NIVEL 3->MENSUALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bMensuales = document.getElementById('bMensuales')
		if (bMensuales == "none")
	    	bMensuales.style.display = "block";
	    else
	    	bMensuales.style.display = "none";

	    /* NIVEL 3->TRIMESTRALES EN FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var bTrimestrales = document.getElementById('bTrimestrales')
		if (bTrimestrales == "none")
	    	bTrimestrales.style.display = "block";
	    else
	    	bTrimestrales.style.display = "none";

    /* NIVEL 1->ESTADISTICAS */
	var bEstadisticas = document.getElementById('bEstadisticas')
	if (bEstadisticas == "none")
    	bEstadisticas.style.display = "block";
    else
    	bEstadisticas.style.display = "none";
    	
	    /* NIVEL 2->FONDOS DE INVERSION EN ESTADISTICAS */
		var bEFondosInversion = document.getElementById('bEFondosInversion')
		if (bEFondosInversion == "none")
	    	bEFondosInversion.style.display = "block";
	    else
	    	bEFondosInversion.style.display = "none";

	    /* NIVEL 3->INFORMACIÓN GENERAL EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var igeneral = document.getElementById('igeneral')
		if (igeneral == "none")
	    	igeneral.style.display = "block";
	    else
	    	igeneral.style.display = "none";

	    /* NIVEL 3->CATEGORÍAS DE FONDOS EN FONDOS DE INVERSIÓN EN ESTADÍSTICAS */
		var cfondos = document.getElementById('cfondos')
		if (cfondos == "none")
	    	cfondos.style.display = "block";
	    else
	    	cfondos.style.display = "none";

	    /* NIVEL 2->FONDOS DE PENSIONES EN ESTADISTICAS */
		var bEFondosPensiones = document.getElementById('bEFondosPensiones')
		if (bEFondosPensiones == "none")
	    	bEFondosPensiones.style.display = "block";
	    else
	    	bEFondosPensiones.style.display = "none";

	    /* NIVEL 3->ESPAÑA EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEEspana = document.getElementById('bEEspana')
		if (bEEspana == "none")
	    	bEEspana.style.display = "block";
	    else
	    	bEEspana.style.display = "none";

	    /* NIVEL 3->MUNDO EN FONDOS DE PENSIONES EN ESTADÍSTICAS */
		var bEMundo = document.getElementById('bEMundo')
		if (bEMundo == "none")
	    	bEMundo.style.display = "block";
	    else
	    	bEMundo.style.display = "none";

	    /* NIVEL 4->FONDOS MENSUALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEEMensuales = document.getElementById('bEEMensuales')
		if (bEEMensuales == "none")
	    	bEEMensuales.style.display = "block";
	    else
	    	bEEMensuales.style.display = "none";

	    /* NIVEL 4->FONDOS TRIMESTRALES EN PLANES DE PENSIONES EN ESTADÍSTICAS */
		var bEETrimestrales = document.getElementById('bEETrimestrales')
		if (bEETrimestrales == "none")
	    	bEETrimestrales.style.display = "block";
	    else
	    	bEETrimestrales.style.display = "none";

}

// FUNCIONES DE LA JSP CÓDIGO DE CONDUCTA PUBLICITARIA
function mostrarCCP(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarCCP();
		capa.style.display = "block";
	} else {
		ocultarCCP();
	}
}
			
function ocultarCCP(){

	/* NIVEL 1->PRINCIPIOS */
	var principios = document.getElementById('principios')
	if (principios == "none")
    	principios.style.display = "block";
    else
    	principios.style.display = "none";
    
    /* NIVEL 1->CONTENIDOS */
	var contenidos = document.getElementById('contenidos')
	if (contenidos == "none")
    	contenidos.style.display = "block";
    else
    	contenidos.style.display = "none";
			    	
    /* NIVEL 1->PUBLICIDAD */
	var publicidad = document.getElementById('publicidad')
	if (publicidad == "none")
    	publicidad.style.display = "block";
    else
    	publicidad.style.display = "none";
		
    /* NIVEL 1->VARIOS */
	var varios = document.getElementById('varios')
	if (varios == "none")
    	varios.style.display = "block";
    else
    	varios.style.display = "none";
    	
}

// FUNCIONES DE LA JSP COMISIÓN ÉTICA
function mostrarCEI(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarCEI();
		capa.style.display = "block";
	} else {
		ocultarCEI();
	}
}
			
function ocultarCEI(){

	/* NIVEL 1->CONSIDERACIONES */
	var consideraciones = document.getElementById('consideraciones')
	if (consideraciones == "none")
    	consideraciones.style.display = "block";
    else
    	consideraciones.style.display = "none";
    
    /* NIVEL 1->INTRODUCCIÓN */
	var introduccion = document.getElementById('introduccion')
	if (introduccion == "none")
    	introduccion.style.display = "block";
    else
    	introduccion.style.display = "none";
			    	
    /* NIVEL 1->CRITERIOS */
	var criterios = document.getElementById('criterios')
	if (criterios == "none")
    	criterios.style.display = "block";
    else
    	criterios.style.display = "none";
		
    /* NIVEL 1->REQUISITOS */
	var requisitos = document.getElementById('requisitos')
	if (requisitos == "none")
    	requisitos.style.display = "block";
    else
    	requisitos.style.display = "none";
			    
}

// FUNCIONES DE LA JSP DE ESTADÍSTICAS
function abrirdoc(url,doc,mensaje) {
	if (doc == 'null')
		alert(mensaje);
	else
		window.open(url+doc,'','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600');
}

function abrirurl(url,uri,mensaje) {
	if (uri == 'null')
		alert(mensaje);		
	else	
		window.top.location.href = url+uri;		
}

// FUNCIONES DE LAS JSP DE LA ZONA DE MANTENIMIENTO
function borrarAsociacion(idasociacion){

	if(confirm("¿Desea borrar la asociación seleccionada?")){
		window.location="borrarAsociacion.do?idasociacion="+idasociacion;
	}

}

function borrarFederacion(idfederacion){

	if(confirm("¿Desea borrar la federación seleccionada?")){
		window.location="borrarFederacion.do?idfederacion="+idfederacion;
	}

}

function borrarGestora(idgestora){

	if(confirm("¿Desea borrar la gestora seleccionada?")){
		window.location="borrarGestora.do?idgestora="+idgestora;
	}

}

function borrarUsuario(idusuario){

	if(confirm("¿Desea borrar el usuario seleccionado?")){
		window.location="borrarUsuario.do?idusuario="+idusuario;
	}

}

// FUNCIONES DE LA JSP DEL MENÚ PRINCIPAL
function estado(idCapa) {
	if (idCapa=="") {
	} else {
		var capa = document.getElementById(idCapa);
		if (capa.style.display=="none") {
			ocultar();
			ocultarSubniveles();
			capa.style.display = "block";
		} else {
			ocultarSubniveles();
			ocultar();
		}
		if (idCapa=="npFondosPensiones") {
			mostrar("notasPrensa");
			mostrarSubnivel(idCapa);
		}
		if (idCapa=="eFondosPensiones") {
			mostrar("estadisticas");
			mostrarSubnivel(idCapa);
		}
		if (idCapa=="pCategoriasFondos") {
			mostrar("publicaciones");
			mostrarSubnivel(idCapa);
		}
		if (idCapa=="pLegislacion") {
			mostrar("publicaciones");
			mostrarSubnivel(idCapa);
		}
	}
}

function mostrarSubnivel(idCapaS) {
	var capaS = document.getElementById(idCapaS);
	if (capaS.style.display=="none") {
		ocultarSubniveles();
		capaS.style.display = "block";
	} else {
		ocultarSubniveles();
	}	
}
			
function mostrar(idCapa) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultar();
		ocultarSubniveles();
		capa.style.display = "block";
	} else {
		ocultarSubniveles();
		ocultar();
	}
}
			
function ocultarSubniveles() {

    /* NIVEL 2->FONDOS DE PENSIONES EN NOTAS DE PRENSA */
	var npFondosPensiones = document.getElementById('npFondosPensiones')
	if (npFondosPensiones == "none")
    	npFondosPensiones.style.display = "block";
    else
    	npFondosPensiones.style.display = "none";
				    	
    /* NIVEL 2->FONDOS DE PENSIONES EN ESTADISTICAS */
	var eFondosPensiones = document.getElementById('eFondosPensiones')
	if (eFondosPensiones == "none")
    	eFondosPensiones.style.display = "block";
    else
    	eFondosPensiones.style.display = "none";
				    	
    /* NIVEL 2->CATEGORIAS DE FONDOS EN PUBLICACIONES */
	var pCategoriasFondos = document.getElementById('pCategoriasFondos')
	if (pCategoriasFondos == "none")
    	pCategoriasFondos.style.display = "block";
    else
    	pCategoriasFondos.style.display = "none";
		
    /* NIVEL 2->LEGISLACION EN PUBLICACIONES */
	var pLegislacion = document.getElementById('pLegislacion')
	if (pLegislacion == "none")
    	pLegislacion.style.display = "block";
    else
    	pLegislacion.style.display = "none";
    	
}
			
function ocultar(){

	/* NIVEL 1->NOTAS DE PRENSA */
	var notasPrensa = document.getElementById('notasPrensa')
	if (notasPrensa == "none")
    	notasPrensa.style.display = "block";
    else
    	notasPrensa.style.display = "none";
    
	    /* NIVEL 2->FONDOS DE PENSIONES EN NOTAS DE PRENSA */
		var npFondosPensiones = document.getElementById('npFondosPensiones')
		if (npFondosPensiones == "none")
	    	npFondosPensiones.style.display = "block";
	    else
	    	npFondosPensiones.style.display = "none";
			    
    /* NIVEL 1->ESTADISTICAS */
	var estadisticas = document.getElementById('estadisticas')
	if (estadisticas == "none")
    	estadisticas.style.display = "block";
    else
    	estadisticas.style.display = "none";
			    	
	    /* NIVEL 2->FONDOS DE PENSIONES EN ESTADISTICAS */
		var eFondosPensiones = document.getElementById('eFondosPensiones')
		if (eFondosPensiones == "none")
	    	eFondosPensiones.style.display = "block";
	    else
	    	eFondosPensiones.style.display = "none";
		    
    /* NIVEL 1->PUBLICACIONES */
	var publicaciones = document.getElementById('publicaciones')
	if (publicaciones == "none")
    	publicaciones.style.display = "block";
    else
    	publicaciones.style.display = "none";
		
	    /* NIVEL 2->CATEGORIAS DE FONDOS EN PUBLICACIONES */
		var pCategoriasFondos = document.getElementById('pCategoriasFondos')
		if (pCategoriasFondos == "none")
	    	pCategoriasFondos.style.display = "block";
	    else
	    	pCategoriasFondos.style.display = "none";

	    /* NIVEL 2->LEGISLACION EN PUBLICACIONES */
		var pLegislacion = document.getElementById('pLegislacion')
		if (pLegislacion == "none")
	    	pLegislacion.style.display = "block";
	    else
	    	pLegislacion.style.display = "none";
    
    /* NIVEL 1->ENLACES A GESTORAS */
	var enlacesGestoras = document.getElementById('enlacesGestoras')
	if (enlacesGestoras == "none")
    	enlacesGestoras.style.display = "block";
    else
    	enlacesGestoras.style.display = "none";
			    
    /* NIVEL 1->ASOCIACIONES INTERNACIONALES */
	var asociacionesInternacionales = document.getElementById('asociacionesInternacionales')
	if (asociacionesInternacionales == "none")
    	asociacionesInternacionales.style.display = "block";
    else
    	asociacionesInternacionales.style.display = "none";
			    
    /* NIVEL 1->INFORMACIÓN DE ASOCIADOS */
	var informacionAsociados = document.getElementById('informacionAsociados')
	if (informacionAsociados == "none")
    	informacionAsociados.style.display = "block";
    else
    	informacionAsociados.style.display = "none";
}

// FUNCIONES DE LA JSP DE CONFERENCIAS Y SEMINARIOS EN INFORMACIÓN ASOCIADOS
function mostrarFicherosN1(idCapa, contador) {
	var capa = document.getElementById(idCapa);
	if (capa.style.display=="none") {
		ocultarFicherosN1(contador);
		capa.style.display = "block";
	} else {
		ocultarFicherosN1(contador);
	}
}

function mostrarFicherosN2(idCapa2, contador1, contador2) {
	var capa2 = document.getElementById(idCapa2);
	if (capa2.style.display=="none") {
		ocultarFicherosN2(contador1, contador2);
		capa2.style.display = "block";
	} else {
		ocultarFicherosN2(contador1, contador2);
	}
}
			
function ocultarFicherosN1(contador) {

	for (i=1;i<contador+1;i++) {
		var capa = document.getElementById(i);
		if (capa == "none")
			capa.style.display = "block";
		else
			capa.style.display = "none";
	}

}

function ocultarFicherosN2(contador1, contador2) {

	for (i=1;i<contador1+1;i++) {
		for (j=1;j<contador2+1;j++) {
			var capa2 = document.getElementById(i+"a"+j);
			if (capa2 == "none") {
				capa2.style.display = "block";
			} else if (capa2 == null) {
			} else {
				capa2.style.display = "none";
			}
		}
	}

}