function mostrarCapa(id){
	document.getElementById(id).style.display='block';
}

function ocultarCapa(id){
	document.getElementById(id).style.display='none';
}

function responder(codComentario){
	document.getElementById('codPadre').value=codComentario;
	mostrarCapa('div-insertar-comentario');
}

function cambiarPagina(pag,cuantos,total){
	indice=0;	
	qstr = 'pag='+pag+'&cuantos='+cuantos+'&total='+total+'&';  // NOTE: no '?' before querystring		
	//updateContenidoPorId('<center>'+document.getElementById('imgCargando').innerHTML+'</center>','alternar_lista_loading');
	respuesta=xmlhttpPost(qstr,".",1);
}

function xmlhttpPost(parametros,Url,paso) {
	var xmlHttpReq = false;
	var self = this;
	var strURL = Url;
	var opt=paso;
	if (window.XMLHttpRequest) {
		xmlHttpReq = new XMLHttpRequest();
	}
	// IE
	else if (window.ActiveXObject) {
		xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlHttpReq.open('POST', strURL, true);
	xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	xmlHttpReq.onreadystatechange = function() {
		if (xmlHttpReq.readyState == 4) {
			if (opt==1) updateContenidoPorId(xmlHttpReq.responseText,'div-comentarios');			
		}
	}
	xmlHttpReq.send(parametros);
}

function updateContenidoPorId(str,id,modoEscritura){
	capa=document.getElementById(id);
	if (!capa) capa=document.getElementById('contentcolumn4');
	if (modoEscritura==1) capa.innerHTML += str;
	else capa.innerHTML = str;
}

function CambiarSexo(sexo){
	document.getElementById('sexo').value=sexo;
	document.getElementById('frmSexo').submit();
}

function popEnviar(codFoto){
	window.open("/enviarFoto/index.phtml?codFoto="+codFoto,"EnviarFoto","width=780,height=680,resizable=no,scrollbars=no,status=0");
}
