function realizaRespuesta(myconceep){

	if (Trim($("aTexto").value) == ''){
		$("aTexto").style.border='1px solid red';
		Element.removeClassName('eTexto','cOculta');	
		Element.show('eTexto');	
		valido=0;
	}else{
		$("aTexto").style.border='1px solid #4AA7FF';
		Element.hide("eTexto");
		guardaRespuesta(myconceep);
	}
	
}

function mostrarBoton(){
	Element.show('botonResponder');
	try{
		Nifty("div.marcoBoton","small");							
	}catch(e){}
	
}

function validaCorreo(correo)
{
	var filter=/^[A-Za-z.][A-Za-z0-9._]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;

	if (filter.test(correo)){
		return true;
	}
	else{
		return false;
	}
		
}

function enviaPregunta(codPregunta){

	if (validaCorreo(document.getElementById("tCorreo").value)){
	
			bloqueaPagina("pagina");  //anula enlaces.
       		Cargando(true,"Enviando correo"); // muestra la ventana con el texto.
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

			strPost = "tCodPregunta=" + codPregunta + "&tCorreo=" + document.getElementById("tCorreo").value;
			if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
					Cargando(false); //Oculta la ventana.
					var a = oXML.responseText;					
      					    		
      				if (a.indexOf("Error")==-1){	
	      				document.getElementById("contenidoConfirmacion").innerHTML= "El envio se ha realizado correctamente";
	      				new Effect.Grow('confirmacion', {direction: 'center'});
	      			}else{
	      				document.getElementById("contenidoConfirmacion").innerHTML= a;
	      				a="";
	      				new Effect.Grow('confirmacion', {direction: 'center'});	      			
	      			}
	      			try{
		      			Element.hide("eTexto");
    	  				document.getElementById("fRespuesta").innerHTML = oXML.responseText;
    	  			}catch(e){}
	      	};
	      	oConn.connect("servlet/EnvioPregunta", "POST", strPost , fnWhenDone);	
	}
	else{
		alert('El correo introducido es incorrecto');
	}			   
}

function guardaRespuesta(myconceep){	

			bloqueaPagina("pagina");  //anula enlaces.
       		Cargando(true,"Guardando respuesta"); // muestra la ventana con el texto.
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

			strPost = "tCodPregunta=" + $F("tCodPregunta") + "&aTexto=" + encodeURIComponent($F("aTexto"))
			if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
					Cargando(false); //Oculta la ventana.
					var a = oXML.responseText;					
      					      			
      				if (a.indexOf("La respuesta")==-1){
	      				document.getElementById("contenidoConfirmacion").innerHTML= "La respuesta se ha realizado correctamente";
	      				new Effect.Grow('confirmacion', {direction: 'center'});
      				} else{
      					document.getElementById("contenidoConfirmacion").innerHTML= "La respuesta no se ha podido realizar";
	      				new Effect.Grow('confirmacion', {direction: 'center'});
      				}    				
	      	};
	      	oConn.connect("servlet/SaveRespuesta", "POST", strPost , fnWhenDone);	
	      	
	      	if (myconceep != 1){
		      	if (	$("botonResponder") != null){		   
					$("botonResponder").style.visibility="visible";
					try{			
						Nifty("div.marcoBoton","small");												
		  			}catch(e){}
				}
				masDetallePrincipal($F("tCodPregunta")); 
			}else{
				Element.remove($("fRespuesta"));
			}			
}

function guardaRespuestaMyXcio(){

			bloqueaPagina("pagina");  //anula enlaces.
       		Cargando(true,"Guardando respuesta"); // muestra la ventana con el texto.
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

			strPost = "tCodPregunta=" + $F("tCodPregunta") + "&aTexto=" + ($F("aTexto"))
			if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
					Cargando(false); //Oculta la ventana.
					var a = oXML.responseText;					
      					      			
      				if (a.indexOf("DATOS PERSONALES")==-1){
	      				document.getElementById("contenidoConfirmacion").innerHTML= "La respuesta se ha realizado correctamente";
	      				new Effect.Grow('confirmacion', {direction: 'center'});
//	      				Element.hide("eTexto");
      				}      				
//      				document.getElementById("fRespuesta").innerHTML = oXML.responseText;
	      	};
	      	oConn.connect("servlet/SaveRespuesta", "POST", strPost , fnWhenDone);	
	      	
			Element.removeItem("fRespuesta");
			
}

function preguntasCerrar(codPregunta) {
		bloqueaPagina("pagina");  //anula enlaces.
   		Cargando(true,"Cerrando pregunta"); // muestra la ventana con el texto.
        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;

      	strPost = "codPregunta=" + codPregunta;
      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{
				Cargando(false); //Oculta la ventana.				
  				document.getElementById("panelControlDerecho").innerHTML = oXML.responseText;
  				cargaDatosMenu();
	  			activaPagina("pagina");
      	};
      	oConn.connect("jsp/privado/panelPreguntas.jsp", "POST", strPost , fnWhenDone);       

  }

  function cargaDatosMenu(){
       		
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

	      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
					var a = oXML.responseText;

      				document.getElementById("panelControlIzquierdo").innerHTML = oXML.responseText;
      				document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
	      	};
	      	oConn.connect("jsp/privado/datosContacto.jsp", "POST", strPost , fnWhenDone);    
	      	
  }
  
function ocultaConfirmacion(){
			activaPagina("pagina");
    		Element.hide("confirmacion");						
}   

function panelMostrarPregunta(codPregunta) {
		bloqueaPagina("pagina");  //anula enlaces.
   		Cargando(true,"Cargando pregunta"); // muestra la ventana con el texto.
        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;

      	strPost = "codPregunta=" + codPregunta;
      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{
				Cargando(false); //Oculta la ventana.				
  				document.getElementById("panelControlCentral").innerHTML = oXML.responseText;
	  			activaPagina("pagina");
	  			document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
      	};
      	oConn.connect("jsp/privado/panelPrincipal.jsp", "POST", strPost , fnWhenDone);       
  }

function cargaCambioPass(codUsuario){
        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;
		
      	strPost = "";
		if ($("tPassNew") != null && $("tPassNew").value != ""){
			strPost = "codUsuario=" + codUsuario + "&tPassNew=" + $("tPassNew").value;
		}
		else{
			strPost = "codUsuario=" + codUsuario;
		}

		document.getElementById("posPass").innerHTML = "";
      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{
				document.getElementById("posPass").innerHTML = oXML.responseText;
				try{
					document.getElementById("tPassNew").focus();
					Nifty("div#tAceptarCambioPass","small");  								
					
				}catch(e){}
				document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
      	};
      	oConn.connect("jsp/privado/pass.jsp", "POST", strPost , fnWhenDone);  

}

function cargaCambioBlog(codUsuario){
        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;
		
      	strPost = "";
		if ($("tBlog") != null && $("tBlog").value != ""){
			strPost = "codUsuario=" + codUsuario + "&tBlog=" + $("tBlog").value;
		}
		else{
			strPost = "codUsuario=" + codUsuario;
		}

		document.getElementById("posBlog").innerHTML = "";

      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{
				document.getElementById("posBlog").innerHTML = oXML.responseText;
				try{
					document.getElementById("tBlog").focus();
  					Nifty("div#tAceptarblog","small");  								
				}catch(e){}
				document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
      	};
      	oConn.connect("jsp/privado/blogManual.jsp", "POST", strPost , fnWhenDone);  
}    
      
function cerrarCambioPass(codUsuario){
	$("posPass").innerHTML = "";
	$("posPass").innerHTML = "<label class='negrita'><a href='#' onclick='cargaCambioPass(" + codUsuario + ");'>Cambiar tu password</a></label>";
}

function cerrarCambioBlog(codUsuario){
	$("posBlog").innerHTML = "";
	$("posBlog").innerHTML = "<div id='posBlog'><label class='negrita'><a href='#' onclick='cargaCambioBlog(" + codUsuario  + ")>Cambiar tu mensaje</a></label></div></p>";
}

function cambiaPassword(){
	var i = true;

	if ($("tPassNew").value != $("tPassNewR").value){
		i = false;
		$("passError").innerHTML = "* Los password son diferentes<br/>"
		
		$("tPassNew").style.border='1px solid red';
		$("tPassNewR").style.border='1px solid red';
	}
	
	if ($("tPassNew").value.length < 4){
		i = false;
		$("passError").innerHTML = $("passError").innerHTML + "* Debe de tener mas de 4 caracteres</br>"
		$("tPassNew").style.border='1px solid red';
	}
	
	if (i){
		cargaCambioPass();
	}
}

function encuestaOn(nombreContenedor, nombreOption,codigo, codEncuesta, textoPregunta, textoRespuesta1, textoRespuesta2, textoRespuesta3, numResp){
	
	    oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;
		bloqueaPagina("pagina");  //anula enlaces.
   		Cargando(true,"Guardando encuesta"); // muestra la ventana con el texto.
		
		var option1 = nombreOption+codigo+"1";
		var option2 = nombreOption+codigo+"2";
		
		var contenedor = nombreContenedor+codigo;
		var intRad;
		if (document.getElementById(option1).checked){
			intRad = 1;
		}else{
			if (document.getElementById(option2).checked){
				intRad = 2;
			}else{
				intRad = 3;
			}
		}
		
		strPost = "codEncuesta=" + (codEncuesta) + "&textoPregunta=" + textoPregunta + "&textoRespuesta1=" + textoRespuesta1 + "&textoRespuesta2=" + textoRespuesta2+ "&textoRespuesta3=" + textoRespuesta3 + "&cRes=" + intRad+ "&numResp=" + numResp;
      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{
				Cargando(false); //Oculta la ventana.				
				document.getElementById(contenedor).innerHTML = oXML.responseText;
	  			activaPagina("pagina");
				document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
      	};
      	oConn.connect("jsp/encuestaRes.jsp", "POST", strPost , fnWhenDone);
      	
}


//Carga del perfil
function cargaPerfil(codUsuario, inicial) {
	if (inicial==undefined){
			guardaDirec(lastCall);
			lastCall="cargaPerfil("+codUsuario+")";
	}
	bloqueaPagina("pagina");  //anula enlaces.
	Cargando(true,"Obteniendo el perfil"); // muestra la ventana con el texto.
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

  	strPost = "codUsuario="+codUsuario;
   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
  				document.getElementById("principal").innerHTML = oXML.responseText;    	
  				Cargando(false);
	  			activaPagina("pagina");
	  			if (historico.length>0){
			      			document.getElementById("volver").style.visibility="visible"; 
					    }
				if (inicial!=undefined){
	  				try{
			        		Nifty("div.marcoBotonErrores","small");
			        		Nifty("div#container1","top");
						    Nifty("div#header1","small top");
			        		Nifty("div#container2","top");
						    Nifty("div#header2","small top");
			        		Nifty("div#container3","top");
						    Nifty("div#header3","small top");
						    if (historico.length>0){
				      			document.getElementById("volver").style.visibility="visible"; 
						    }else{
				      			document.getElementById("volver").style.visibility="hidden"; 
						    }
						    $("principal").style.visibility="";
						}catch(e){}
						try{
							Nifty("div.bienvenido","small");
						}catch(e){}
  				 document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";     				
				}			     				
    	};
    	oConn.connect("jsp/perfil.jsp", "POST", strPost , fnWhenDone);       
}

//Carga del perfil
function cargaPerfilGrupo(codGrupo) {
	bloqueaPagina("pagina");  //anula enlaces.
	Cargando(true,"Obteniendo el perfil del grupo"); // muestra la ventana con el texto.
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

  	strPost = "codGrupo="+codGrupo;
   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
  				document.getElementById("principal").innerHTML = oXML.responseText;    	
  				Cargando(false);
	  			activaPagina("pagina");				     				
	  			document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
    	};
    	oConn.connect("jsp/perfilGrupo.jsp", "POST", strPost , fnWhenDone);       
}
       
function establecerPuntuacion(codPregunta, puntuacion){

        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;

		strPost = "codPregunta=" + codPregunta + "&puntuacion=" + puntuacion
		if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{				
      			document.getElementById("puntuacion" + codPregunta).innerHTML = "Puntuación dada: " + puntuacion;
      	};
      	oConn.connect("servlet/EstablecerPuntuacion", "POST", strPost , fnWhenDone);	
			
}

function MarcarBorrado(codRespuesta){

        oConn = new XHConn();
        oConn.reconectarSi['timeout']=0;
        oConn.tiempoTimeout=300;
        oConn.reconectarSi['404']=0;

		document.getElementById("dBorrado" + codRespuesta).innerHTML = "<b class='negrita'>S. Eliminación</b>";
      			
		strPost = "codRespuesta=" + codRespuesta
		if (!oConn) alert("FALLO LA LLAMADA A AJAX");
      		var fnWhenDone = function (oXML)
      			{				
			
      	};
      	oConn.connect("servlet/MarcarBorrado", "POST", strPost , fnWhenDone);	
}

function expandirCategoria(div, total){
	
	if (div.style.display!='block'){
	
		var divNom;
		for (i=1;i<=total;i++){
			divNom = 'cat' + i; 
			document.getElementById(divNom).style.display='none';
		}
	
		div.style.display='block'
	
	}else{
		div.style.display='none'
	}
	
}

function expandir(div){

	if (document.getElementById(div).style.display=='block'){
		document.getElementById(div).style.display='none';
	}else{
		document.getElementById(div).style.display='block'	
	}

}

function cargaParteComunidad() {
	guardaDirec(lastCall);
	lastCall="cargaParteComunidad()";
	bloqueaPagina("pagina");  //anula enlaces.
	Cargando(true,"Comunidad conceep"); // muestra la ventana con el texto.
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
  				document.getElementById("principal").innerHTML = oXML.responseText;    	
	  			cargaParteCategorias();			     				
    	};
    	oConn.connect("jsp/parteComunidad.jsp", "POST", strPost , fnWhenDone);       
}

function cargaParteCategorias() {
	bloqueaPagina("pagina");  //anula enlaces.
	Cargando(true,"Comunidad conceep"); // muestra la ventana con el texto.
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
  				document.getElementById("divCategorias").innerHTML = oXML.responseText;    	
  				$("tituloCategoriasMejores").innerHTML="LOS MEJORES EN CADA CATEGORIA";
  				$("textoCategoriasMejores").style.display="none";      				
  				cargaEncuestaOng();				     				
    	};
    	oConn.connect("jsp/categorias_mejores.jsp", "POST", strPost , fnWhenDone);       
}

function cargaParteExplorar() {
	guardaDirec(lastCall);
	lastCall="cargaParteExplorar()";
	bloqueaPagina("pagina");  //anula enlaces.
	Cargando(true,"Explora conceep"); // muestra la ventana con el texto.
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
			document.getElementById("principal").innerHTML = oXML.responseText;  
			cargaCategoriasMejor();  	
    	};
    	oConn.connect("jsp/parteExplorar.jsp", "POST", strPost , fnWhenDone);       
}
function cargaCategoriasMejor() {
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

	      	strPost = "";
	      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
      				document.getElementById("divCategorias").innerHTML = oXML.responseText;
	        		cargaTopPreguntas();
	      	};
	      	oConn.connect("jsp/categorias_mejores.jsp", "POST", strPost , fnWhenDone);       
}


function cargaTopPreguntas() {
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

	      	strPost = "";
	      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
      				document.getElementById("fUltimasPreguntas").innerHTML = oXML.responseText;
      				Element.removeClassName("tituloLastPreguntas",'tituloUltimasPreguntas');
      				Element.addClassName("tituloLastPreguntas",'tituloGris');
	        		cargaTags();
	      	};
	      	oConn.connect("jsp/cuadro_pregunta2.jsp", "POST", strPost , fnWhenDone);       
      }

function cargaTags() {
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

	      	strPost = "";
	      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
      				document.getElementById("fTags").innerHTML = oXML.responseText;
					cargaConsejo() 	        		
	      	};
	      	oConn.connect("jsp/tags.jsp", "POST", strPost , fnWhenDone);       
      }
function cargaConsejo() {
	        oConn = new XHConn();
	        oConn.reconectarSi['timeout']=0;
	        oConn.tiempoTimeout=300;
	        oConn.reconectarSi['404']=0;

	      	strPost = "";
	      	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
	      		var fnWhenDone = function (oXML)
	      			{
      				document.getElementById("fTags").innerHTML = document.getElementById("fTags").innerHTML + oXML.responseText;
	  				Cargando(false);
	  				document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";
					activaPagina("pagina");	
				    if (historico.length>0){
			      			document.getElementById("volver").style.visibility="visible"; 
					    }
					 try{
						 scroll = new NewsScroller('marquesina',5000);
					 }catch(e) {}
	        		
	      	};
	      	oConn.connect("jsp/consejo_semana.jsp", "POST", strPost , fnWhenDone);       
      }
            
function cargaEncuestaOng() {
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
	  			
  				document.getElementById("fEncuestaOng").innerHTML = oXML.responseText;    	
  				cargaEncuesta()
    	};
    	oConn.connect("jsp/encuestaOng.jsp", "POST", strPost , fnWhenDone);       
}
            
function cargaEncuesta() {
	 
    oConn = new XHConn();
    oConn.reconectarSi['timeout']=0;
    oConn.tiempoTimeout=300;
    oConn.reconectarSi['404']=0;

   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
	  			
  				document.getElementById("fMEncuesta").innerHTML = oXML.responseText;    	

				try{  				
		  			Nifty("div.marcoBotonErrores","small");     				
	  			}catch(e){}
	  			document.getElementById("divCategorias").style.visibility="visible";
      			document.getElementById("divRetribucion").style.visibility="visible";
      			document.getElementById("divElMejor").style.visibility="visible"; 
      			document.getElementById("divTablon").style.visibility="visible"; 
      			document.getElementById("fMEncuesta").style.visibility="visible"; 
      			document.getElementById("divMasVistas").style.visibility="visible"; 
      			document.getElementById("divDinero").style.visibility="visible"; 
      			document.getElementById("divConsejo").style.visibility="visible"; 

   			  	Cargando(false);  	
   			  	document.title = "Conceep.- Conocimiento compartido y útil para mejorar el mundo.";	
      			if (historico.length>0){
	      			document.getElementById("volver").style.visibility="visible"; 
				}
	  			activaPagina('pagina');activaPagina('pagina');
    	};
    	oConn.connect("jsp/encuesta.jsp", "POST", strPost , fnWhenDone);       
}

function moverResAbajo(divRes){
	litResNone = 'Res' + divRes;
	litResNBlock = 'Res' + (divRes - 1);	
	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverResArriba(divRes){
	litResNone = 'Res' + divRes;
	litResNBlock = 'Res' + (divRes + 1);	

	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverRPreguntaAAbajo(divRes){
	litResNone = 'pA' + divRes;
	litResNBlock = 'pA' + (divRes + 1);	
	
	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverRPreguntaAArriba(divRes){
	litResNone = 'pA' + divRes;
	litResNBlock = 'pA' + (divRes - 1);	

	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverRPreguntaCAbajo(divRes){
	litResNone = 'pC' + divRes;
	litResNBlock = 'pC' + (divRes + 1);	
	
	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverRPreguntaCArriba(divRes){
	litResNone = 'pC' + divRes;
	litResNBlock = 'pC' + (divRes - 1);	

	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverPendienteAbajo(divRes){
	litResNone = 'pP' + divRes;
	litResNBlock = 'pP' + (divRes + 1);	
	
	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function moverPendienteArriba(divRes){
	litResNone = 'pP' + divRes;
	litResNBlock = 'pP' + (divRes - 1);	

	document.getElementById(litResNone).style.display = 'none';
	document.getElementById(litResNBlock).style.display = 'block';
}

function abrirVentana(url){
	window.open(url , "Blog" , "scrollbars=NO");
}

 function verEnFrame(url){
 	document.getElementById('panelControlCentral1').style.display='none';
  	document.getElementById('panelControlCentral2').style.display='none';
   	document.getElementById('panelControlCentral3').style.display='block';
   	document.getElementById('ifPerfil').src=url;
	document.getElementById('dVolHistorial').innerHTML = "<a id='aVol' name='aVol' href='javascript:volHistorial()'>Volver al historial</a>";
 }

 function volHistorial(){
 	document.getElementById('panelControlCentral1').style.display='block';
  	document.getElementById('panelControlCentral2').style.display='block';
   	document.getElementById('panelControlCentral3').style.display='none';
   	document.getElementById('dVolHistorial').innerHTML = "&nbsp;";
 }
    
function cargaDetRespuesta(usuario) {
	bloqueaPagina("pagina");  //anula enlaces.
      	Cargando(true,"Buscando respuestas"); // muestra la ventana con el texto.

       oConn = new XHConn();
       oConn.reconectarSi['timeout']=0;
       oConn.tiempoTimeout=300;
       oConn.reconectarSi['404']=0;

     	strPost = "";
     	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
     		var fnWhenDone = function (oXML)
     			{
    				document.getElementById("principal").innerHTML = oXML.responseText;
 					cargaRespuestaCentral(usuario);
     	};
     	oConn.connect("jsp/responde.jsp", "POST", strPost , fnWhenDone);       
    }

 function cargaRespuestaCentral(usuario) {
	oConn = new XHConn();
 	oConn.reconectarSi['timeout']=0;
 	oConn.tiempoTimeout=300;
 	oConn.reconectarSi['404']=0;
   	strPost = "codUsuario="+usuario;
   	if (!oConn) alert("FALLO LA LLAMADA A AJAX");
   		var fnWhenDone = function (oXML)
   			{
  				document.getElementById("preguntasResponde").innerHTML = oXML.responseText;
  				cargaRespondeIzquierdaCateg();
   	};
   	oConn.connect("jsp/detRespuesta.jsp", "POST", strPost , fnWhenDone);       
 }
 function modImagenLogging(codLogging){
 	document.getElementById("iFrameImagen").src="servlet/makeImagen?codLogging="+ codLogging +"&mod=1";
 }
      