


var adBar = 
{
	menuEl : null,
	
	show : function (el)
	{
		
		if (el.id.search('sub') == 0)
		{
			el = adBar.gE(el.id.replace(/sub/g, ''));
		}
		
		adBar.menuEl = adBar.gE('sub' + el.id);
		
		if (typeof(adBar.menuEl) == 'object')
		{
			adBar.menuEl.style.display = 'block';
			adBar.menuEl.style.left = parseInt(adBar.__leftPosition(el) + 15) + 'px';
		}
		
	},
	
	
	hide : function (el)
	{
		
		if (el.id.search('sub') == 0)
		{
			el = adBar.gE(el.id.replace(/sub/g, ''));
		}
		
		adBar.menuEl = adBar.gE('sub' + el.id);
		
		if (typeof(adBar.menuEl) == 'object')
		{
			adBar.menuEl.style.display = 'none';
		}
		
	},

	gE : function(id)
	{
			return document.getElementById(id);
	},
	
	__leftPosition : function (el)
	{
		
		var left = 0;

		if (el.parentNode.previousSibling.nodeName == 'LI')
		{
			el = el.parentNode.previousSibling;
		}
		else if (el.parentNode.previousSibling.previousSibling.nodeName == 'LI')
		{
			el = el.parentNode.previousSibling.previousSibling;
		}
		
		while (el)
		{
			if (el.nodeName == 'LI')
			{
				left += el.offsetWidth;
			}
			el = el.previousSibling;
			if (typeof(el) != 'object')
			{
				break;
			}
		}
		return (left);
	}

}