var idIntVal = 0;
var myBotonera;

function botonera_abrir()
{
	if (!myBotonera) myBotonera = botonera_get();
	myBotonera.height_end = 220;
	if (myBotonera.height != myBotonera.height_end) {
		if (idIntVal) clearInterval(idIntVal);
		$('div_botonera').style.top = "224px";
		idIntVal = setInterval("botonera_move()", 50);
	}
}



function botonera_cerrar()
{
	if (!myBotonera) myBotonera = botonera_get();
	myBotonera.height_end = 46;
	if (myBotonera.height != myBotonera.height_end) {
		$('div_botonera').style.top = "142px";
		if (idIntVal) clearInterval(idIntVal);
		idIntVal = setInterval("botonera_move()", 50);
	}
}



function botonera_move()
{
	myBotonera.height -= (myBotonera.height - myBotonera.height_end)/2;
	
	if (Math.round(Math.abs(myBotonera.height - myBotonera.height_end)) <= 1) {
		myBotonera.height = myBotonera.height_end;
		clearInterval(idIntVal);
		idIntVal = 0;
		myBotonera.TGotoFrame("js_controller_mc", 1);
	}// else document.getElementById('msg').innerHTML += (Math.round(Math.abs(myBotonera.height - myBotonera.height_end)))+"<BR>";
}



function botonera_get()
{
	var ret;
	if (document.all) {
		ret = document.getElementById("botonera_swf");
	}else{
		ret = window.document.botonera_swf;
	}
	return ret;
}