/* 
var x_final=630;
var y_finalFicha=60;
var mitad_ancho_mapa=498;
var mitad_alto_mapa=410; //+top
*/
var anchoFicha=550;
var posFichaX=78;
var posFichaY=64;
function cierraFicha()
{
	var ficha=document.getElementById("ficha");
	altoIni=ficha.scrollHeight;
	anchoIni=ficha.scrollWidth;
	ficha.style.display='none';
	var contenidoFicha=document.getElementById("contenidoFicha");
	contenidoFicha.style.display='none';
	var bocata=document.getElementById("bocata");
	var efectoFicha=document.getElementById("efectoFicha");

	efectoFicha.style.display='none';
	efectoFicha.style.width=anchoIni+'px';
	efectoFicha.style.height=altoIni+'px';
	efectoFicha.style.display='block';

	var anchoFin=bocata.scrollWidth;
	var altoFin=bocata.scrollHeight;
	
  	myEffectsCierre = new Fx.Styles(efectoFicha, {duration: 1000,transition: Fx.Transitions.Back.easeInOut,onComplete: completaTransacionCierreFicha});
	 
	myEffectsCierre.start({
		left: [posFichaX, x_final],
		width: [anchoIni,anchoFin],
		height:[altoIni,altoFin],
		opacity: [1,0.2]
	});	
}
function completaTransacionCierreFicha()
{
	var efectoFicha=document.getElementById("efectoFicha");
	efectoFicha.style.display='none';
}
function completaTransacionFicha()
{
	var ficha=document.getElementById("ficha");
	ficha.style.left=posFichaX+"px";
	ficha.style.width=anchoFicha+"px";
	ficha.style.display='block';
	var efectoFicha=document.getElementById("efectoFicha");
	efectoFicha.style.display='none';
}

function efectoFicha(punto,codigoHTML)
{
		var contenidoFicha=document.getElementById("contenidoFicha");
		contenidoFicha.style.display='block';
		var ficha=document.getElementById("ficha");
		ficha.style.top=posFichaY+"px";
		ficha.style.left=posFichaX+"px";
		contenidoFicha.innerHTML=codigoHTML;
			
		var bocata=document.getElementById("bocata");
		var alto=bocata.scrollHeight;
		
		var efectoFicha=document.getElementById("efectoFicha");
		efectoFicha.style.left=x_final+"px";
		efectoFicha.style.top=y_final+"px";
		efectoFicha.style.display='block';
		efectoFicha.style.height=alto+'px';
		efectoFicha.style.width='0px';
		myEffectsFicha = new Fx.Styles(efectoFicha, {duration: 750,transition: Fx.Transitions.Back.easeInOut,onComplete: completaTransacionFicha});
	 
		myEffectsFicha.start({
		left: [x_final,posFichaX],
		width: [0,anchoFicha],
		opacity: [0.2,1]
		});	
}


