var zIndexMenu = 1
var menuShow
var menuNow
var Pointer
var timer

function showMenu(Menu,Origem,corr)
{
	if (menuNow)
	{
		menuNow.style.display = 'none'
		Pointer = ''
	}
	
	clearTimeout(timer)
	Pointer = 'Pai';
	menuShow = document.getElementById('menu'+Menu);
	menuShow.style.zIndex = zIndexMenu+1;
	menuShow.style.top = (159);
	menuShow.style.left = ((getPageLeft(Origem)+10)-corr);
	menuShow.style.display = 'block';
	
}

function keepShowMenu()
{
	Pointer = 'Filho'
}

function timerHide()
{
	menuNow = menuShow
	Pointer = ''
	timer = setTimeout("hideMenu()",500);
}

function Hide()
{
	menuNow = menuShow
	Pointer = ''
	hideMenu()
}

function hideMenu()
{	
	clearTimeout(timer)
	
	if (Pointer == '')
	{
		menuNow.style.display = 'none'
	}
}

function getPageLeft(Bt) 
{
	var x;
	x = 0;
	while (Bt.offsetParent != null) 
	{
		x += Bt.offsetLeft;
		Bt = Bt.offsetParent;
	}
	x += Bt.offsetLeft;
	return x;
}

function getPageTop(Bt) 
{
	var y;
	y = 0;
	while (Bt.offsetParent != null) 
	{
		y += Bt.offsetTop;
		Bt = Bt.offsetParent;
	}
	y += Bt.offsetTop;
	return y;
}

function openWin( windowURL, windowName, windowFeatures )
{ 
	return window.open( windowURL, windowName, windowFeatures ) ; 
}