function Menu(llave, cantidad) {
	//este es el constructor
	this.llave		= llave;
	this.cantidad	= cantidad;
	this.autoClose	= true;
	this.closeAll	= true;

	var iDelay = 3000 ;
	var sDisplayTimer = null;
	var oLastItem = true;
	var iNSWidth = 100;
 
	//this.id			= id;
	var entrada		= new Array();
	var content		= new Array();
	
	isOPERA = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
	isIE    = (document.all && !isOPERA)? true : false;
	isDOM   = (document.getElementById && !isIE && !isOPERA)? true : false;
	
	this.initArray = function() {
		for (x=0; x < this.cantidad; x++) {
			entrada [this.llave + "_" + x] = true;
		}
	}
	
	this.make_menu = function(id){
		if(this.closeAll) {
			this.hide_all();
		}
		if (entrada[this.llave + "_" + id]) {
			this.show (id, 'table-row');
			for (x=0; x < this.cantidad; x++){
				entrada [this.llave + "_" + x] = true;
			}
			if(this.autoClose) {
				entrada[this.llave + "_" + id] = false;
			}
		}else{
			if(this.autoClose) {
				this.hide(llave + "_" + id);
			}
			entrada[this.llave + "_" + id]=true;
		} 
	}	
	
	this.hide_all = function() {
		for (i=0; i<this.cantidad;i++){
			this.hide(this.llave + "_" + i);
		}
	}
	
	this.hide = function(id){
		if (isDOM) {
			document.getElementById(id).style.display = "none";
		} else if (isIE) {
			document.all[id].style.display = "none";
		}	
	}
	
	
	this.show = function(id, displayValue){
		if (isDOM) {
			document.getElementById(this.llave +  "_" + id).style.display = (displayValue)? displayValue: "block";
		} else if (isIE) {
			document.all[this.llave + "_" + id].style.display = "block";
		}
	}

	this.stopTimer = function () {
		clearTimeout(sDisplayTimer)
	}

	this.startTimer = function () {
	  this.stopTimer()
	  objMenu = this;
	  sDisplayTimer = setTimeout('callHideItem()',iDelay)
	}

	this.hideItem = function () {
		if (oLastItem) {
			this.hide_all();
		}
	}
}
var objMenu;
function callHideItem() {
	objMenu.hideItem();
}