var tf_Menu = 
{
	timeout: 500,
	closetimer: null,
	ddmenulink: null,
	ddmenuitem: null,
	focus: false,
	
	//open hidden layer
	mopen: function(linkObj, menuId)
	{	
		// cancel close timer
		this.mcancelclosetime();
		
		// close old layer
		if(this.ddmenuitem)
		{
			this.ddmenulink.className = '';
			this.ddmenuitem.style.visibility = 'hidden';
		}
		
		this.ddmenulink = linkObj;
		this.ddmenulink.className = 'hover';
		
		// get new layer and show it
		this.ddmenuitem = tf_DOM.$(menuId);
		//this.ddmenuitem.style.left = left + 'px';
		this.ddmenuitem.style.visibility = 'visible';
		
		this.focus = false;
	},
	
	// close showed layer
	mclose: function()
	{
		if(this.ddmenuitem)
		{
			this.ddmenulink.className = '';
			this.ddmenuitem.style.visibility = 'hidden';
		}
	},
	
	// go close timer
	mclosetime: function()
	{
		var obj = this;
		if(!this.focus)
			this.closetimer = setTimeout(function(){obj.mclose()}, this.timeout);
	},
	
	// cancel close timer
	mcancelclosetime: function()
	{
		if(this.closetimer)
		{
			clearTimeout(this.closetimer);
			this.closetimer = null;
		}
	}
	
};
