var activo_old = "";
var completados = ";";
function abrePersiana_old(paraAbrir) {
/*	if (activo != "") 
	{
		if (activo != paraAbrir)
		{
			$(document.getElementById(activo)).animate({height:250}, 'slow');
		}
	}
*/	if (activo != paraAbrir)
	{
			var componente = document.getElementById(paraAbrir);
			var valorHeight = componente.scrollHeight;
			$(document.getElementById(paraAbrir)).animate({height:valorHeight}, 'slow');
			activo = paraAbrir;
	}

}
function cierraPersiana_old(paraCerrar) {
/*	if (activo == paraCerrar)
	{
*/		$(document.getElementById(paraCerrar)).animate({height:250}, 'slow');
//		activo = "";
//	}
}
function inicializaPersiana_old() {
	if (activo != "")
	{
		$(document.getElementById(activo)).animate({height:250}, 'slow');
	}
	activo = "";
}
var activo = new Array();
var listado = "";
iniciado = true;
function llamada(e){
	alert("as");
}
function abrePersiana(paraAbrir) {
/*	//ocultamos portada y mostramos cierre
	document.getElementById("cierre"+paraAbrir).display = "block";
	document.getElementById("portada"+paraAbrir).display = "none";
*/	if (listado.indexOf(paraAbrir)<0) {
//		reemplazaContenidoChico(paraAbrir);
		iniciado = false;
		var componente = document.getElementById(paraAbrir);
		var valorHeight = componente.scrollHeight;
		$(document.getElementById(paraAbrir)).animate({height:valorHeight}, 'slow');
		if (listado != "") {
			listado += ","+paraAbrir;
		} else 
			listado = paraAbrir;
		activo = listado.split(",");
	}

}
function posiciona(paraAbrir) {
	actualizaScroller();
	if (!iniciado) {
		posicionscroll(paraAbrir);
	}
}
function chequeo(paraAbrir) {
	if (tamano != document.getElementById("contenido").offsetHeight) {
		tamano = document.getElementById("contenido").offsetHeight;
		posiciona(paraAbrir);
		terminaChequeo();
	}
}
var intval="";
function empiezaChequeo(paraAbrir) {
	if (!iniciado) {
		posicionscroll(paraAbrir);
	}
	if(intval==""){
		intval=window.setInterval("chequeo('"+paraAbrir+"')",500);
	} else {
		terminaChequeo();
		intval=window.setInterval("chequeo('"+paraAbrir+"')",500);
	}
}
function terminaChequeo() {
	if(intval!=""){
		window.clearInterval(intval);
		intval="";
	}
}
function cierraPersiana(paraCerrar) {
	//ocultamos portada y mostramos cierre
/*	document.getElementById("cierre"+paraAbrir).display = "none";
	document.getElementById("portada"+paraAbrir).display = "block";
*/	if (listado.indexOf(paraCerrar)>=0) {
		$(document.getElementById(paraCerrar)).animate({height:250}, 'slow');
		if (listado.indexOf(paraCerrar) == 0) {
			listado = listado.substring(paraCerrar.length,listado.length);
			if (listado.indexOf(",") == 0) {
				listado = listado.substring(1,listado.length);
			}
		} else 
			listado = listado.substring(0,listado.indexOf(paraCerrar)-1)+listado.substring(listado.indexOf(paraCerrar)+paraCerrar.length,listado.length);
		activo = listado.split(",");
	}
}
function inicializaPersiana() {
	iniciado = true;
	if (listado != "")
	{
		for (var i = 0;i<activo.length;i++)
		{
			$(document.getElementById(activo[i])).animate({height:250}, 'slow');
		}
		listado = "";
		activo = new Array();
	}
}
function empiezaChequeoThis(objeto) {
	elemento = document.getElementById(objeto);
	empiezaChequeo(elemento.name);

}
function abrePersianaThis(objeto) {
	elemento = document.getElementById(objeto);
	abrePersiana(elemento.name);
}
/*function reemplazaContenidoChico(nombre) {
	elemento = document.getElementById("contenidoOculto"+nombre);
	encontrado = false;
	for (var i=0; i<datosChicos.length && !encontrado; i++) {
		if (datosChicos[i][3].indexOf("<div  border=\"1\" id=\""+nombre+"\"") > -1)
		{
			encontrado = true;
		}
	}
	i--;
	if (completados.indexOf(";"+i+";") == -1) {
		completados = completados+i+";";
		var html = datosChicos[i][3].substring(datosChicos[i][3].indexOf("<!-- DIV CONTENIDO OCULTO -->"), datosChicos[i][3].lastIndexOf("<!-- FIN DIV CONTENIDO OCULTO -->"));
		elemento.innerHTML = html;
		delay(3000);
	}
}
function delay(milisegundos) {
	for(i=0;i<=milisegundos;i++) {
		setTimeout('return 0',1);
	}
}
*/