var maxLev = 10, arrPila = Array(maxLev);
var intTimeoutShowID = 0, intTimeoutHideID = 0, intLapsoBuffer = 200, intLapsoOcult = 3000;
for(i = 0;i < maxLev;i++) arrPila[i] = 0;

function fnBuffer(){
	if(intTimeoutShowID) window.clearTimeout(intTimeoutShowID);
	var id = parseInt(arguments[0]), nivel = parseInt(arguments[1]);
	intTimeoutShowID = window.setTimeout("fnShowHideLy(" + id + "," + nivel + ");", intLapsoBuffer); }

function fnShowHideLy(){
	var id = arguments[0], i, nivel = arguments[1];
	if(isNaN(parseInt(nivel))) nivel = 0 ;
	for(i = nivel;i < maxLev;i++){
		if(arrPila[i]){
			var objLy = document.getElementById("Ly" + arrPila[i]);
			if(objLy.style.visibility != "hidden") objLy.style.visibility = "hidden"; } }
	arrPila[nivel] = id;
	if(arrPila[nivel]){
		var objLy = document.getElementById("Ly" + arrPila[nivel]);
		if(objLy.style.visibility != "visible") objLy.style.visibility = "visible"; }
	for(i = nivel + 1;i < maxLev;i++) arrPila[i] = 0; }
	
function fnOverMn(){
	fnCancelOcult();
	fnRoll(arguments[0], "url(/img/bot_base02.gif)", "#FFFFFF"); }

function fnOutMn(){
	fnOcult();
	fnRoll(arguments[0], "url(/img/bot_base01.gif)", "#F0F5F9"); }
	
function fnOcult(){
	intTimeoutHideID = window.setTimeout("fnShowHideLy(0, 0);", intLapsoOcult); }

function fnCancelOcult(){
	if(intTimeoutHideID) window.clearTimeout(intTimeoutHideID);	}

function fnRoll(){
	var objTDTemp = arguments[0], strImg = arguments[1], strColor = arguments[2];
	var strTempID = new String(objTDTemp.id), strID, objTD;
	var objRE = new RegExp("lbl|sub"), strID = strTempID.replace(objRE, "");
	try {
		objTD = document.getElementById("lbl" + strID);
		objTD.style.backgroundImage = strImg;
		objTD = document.getElementById("sub" + strID);
		objTD.style.backgroundColor = strColor;
		} 
	catch(err) {} }
