

function exibir_aux(parent, child)
{
	var p = document.getElementById(parent);
	var c = document.getElementById(child);		

	c.style.visibility = 'visible';		
	c.style.left = p.offsetLeft + "px";
	c.style.width = p.offsetWidth + "px";

	if (p["tempo_esconder"] != undefined)
	{
		clearTimeout(p["tempo_esconder"]);
	}
	if (c.offsetTop < (p.offsetTop + p.offsetHeight))
	{
		c.style.top = (c.offsetTop + 5) + "px";
		p["tempo_exibir"] = setTimeout("exibir_aux(\'"+parent+"\',\'"+child+"\')", 1);
	}
	else
	{
		c.style.top = (p.offsetTop + p.offsetHeight) + "px";
	}		
}

function exibir()
{
	exibir_aux(this["at_parent"], this["at_child"]);
}

function esconder_aux(parent, child)
{
	var p = document.getElementById(parent);
	var c = document.getElementById(child);

	if (p["tempo_exibir"] != undefined)
	{
		clearTimeout(p["tempo_exibir"]);
	}
	if (c.offsetTop > (p.offsetTop - c.offsetHeight))
	{
		c.style.top = (c.offsetTop - 5) + "px";
		p["tempo_esconder"] = setTimeout("esconder_aux(\'"+parent+"\',\'"+child+"\')", 1);
	}
	else
	{
		c.style.visibility = 'hidden';
	}
}

function esconder()
{
	esconder_aux(this["at_parent"], this["at_child"]);
}

function definir_layers(parent, child, cursor)
{
	var p = document.getElementById(parent);
	var c = document.getElementById(child);
	
	p["at_parent"]     = p.id;
	c["at_parent"]     = p.id;
	p["at_child"]      = c.id;
  	c["at_child"]      = c.id;	

	c.style.visibility = 'hidden';	
	c.style.top = (p.offsetTop - c.offsetHeight) + "px";
	c.style.left = p.offsetLeft + "px";
	c.style.width = p.offsetWidth + "px";

	if (cursor != undefined) p.style.cursor = cursor;

	p["tempo_exibir"] = null;
	p["tempo_esconder"] = null;

	p.onmouseover = exibir;
	p.onmouseout  = esconder;
	c.onmouseover = exibir;
	c.onmouseout = esconder;
}