function iFrameFixCatalogo(){
	/*
	var iFix = $('divfixIframe');
	if (iFix != null){
		new Rico.Effect.Size( parent.document.getElementsByTagName("IFRAME")[0], null, findPixY(iFix) + 20, 1, 1);

			//alert (findPixY(iFix) + 20);
	}
	*/

}


function findPixY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function openCloseMenu(id){

	var div = $(id);
	
	if (div.style.display=="none"){
		div.style.display="block";
	}else{
		div.style.display="none";
	}
	//iFrameFix();
	iFrameFixCatalogo();

}

function carga(id, catalogo, nivel){

	catalogoEcat.listaRama(id, catalogo, nivel, listaRama_callback);

}

function listaRama_callback(response)
{
	if (response.error != null){
		alert(response.error.Message);
		return;
	}			
	var resp = response.value;
	if (resp!='')			
	{		
		$("contRama").innerHTML = resp;
		//iFrameFix();
		//iFrameFixCatalogo();
	}
}

function cargaLibro(id, catalogo, rama, nivel){
	//alert (rama)
	catalogoEcat.fichaLibro(id, catalogo,rama, nivel, listaRama_callback);

}

function cargaBio(id){
	//Rosa 28/05
	//alert (id)
	catalogoEcat.getBio(id, getBio_callback);
	
}

function getBio_callback(response)
{	
	if (response.error != null){
		//Rosa 28/05
		//alert("getBio");
		alert(response.error.Type);
		alert(response.error.Message);
		return;
	}			
	var resp = response.value;
	if (resp!='')			
	{	
		//alert (resp)
		document.getElementById("contBio").style.visibility = "visible";
		
		
		document.getElementById("contBio").innerHTML=resp;
		document.getElementById("contBio").style.backgroundColor="#ffffff";
		//document.getElementById("contBio").style.display = "block";
		//document.getElementById("contBio").style.display = "none";		
		
		//alert ("visible");		
		
		//Rosa 28/05
		
		//$("contBio").innerHTML = resp;
		//$("contBio").style.visibility = "visible";
		//$("contBio").style.backgroundColor="#ffffff";
		
		//iFrameFixCatalogo();
	}

}

function reload(){
	window.location.reload();
	iFrameFixCatalogo();
}

function ocultarCapa(obj){

$(obj).style.display = "none";

//iFrameFixCatalogo();
}
function ocultarCapa_1(obj){

//$(obj).style.visibility = "hidden";
document.getElementById("contBio").style.visibility = "hidden";
//document.getElementById("contBio").style.display = "block";
//document.getElementById("contBio").style.display = "none";
//$(obj).style.display = "none";

//iFrameFixCatalogo();
}
