// JavaScript Document
ativoinstitu = null;
cellAtivoinstitu = null;
timeIdinstitu = null;
document.onclick = new Function("showinstitu()");
function showinstitu(obj,name)
{
	fade = name;
	name = document.getElementById(name);
	if(ativoinstitu!=null) { 
		ativoinstitu.style.visibility = "hidden"; 
		ativoinstitu=null
	}
	if(obj)
	{
		cellAtivoinstitu = obj;
	}
	if(timeIdinstitu!=null){ clearTimeout(timeIdinstitu); }
	if(name)
	{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	//var x = new getObj(name);
		//document.getElementById("conteudo").style.zIndex = "1";
		//document.getElementById("conteudoespaco").style.zIndex = "1";
		//document.getElementById("msghomeflash").style.zIndex = "1";
		name.style.zIndex = 300;
		name.style.visibility = "visible";
		name.style.top = newY + 0 + 'px';
		name.style.left = newX + 130 + 'px';
	
		//colorfade(fade);
		ativoinstitu = name;
	}
}
function timerHidePopinstitu()
{
	if(ativoinstitu!=null)
	{
		timeIdinstitu = setTimeout("ativoinstitu.style.visibility = 'hidden'; timeIdinstitu=null; ativoinstitu=null;",1);
	}
}
//EFEITOS ---------------------------------------------------------------------------------------------
/*function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	//if (lyr == 'testP') newY -= 50;
	var x = new getObj(lyr);
	//serversistes/testes/teste1.html
	x.style.top = newY + 20 + 'px';
	x.style.left = newX + 'px';
}*/

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

// -----------------------------------------------------------------------------------