// JavaScript Document

/*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;
}
/*function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   // }
	   //else
	   //{
	   // this.obj = document.layers.testP.layers[name];
	   // this.style = document.layers.testP.layers[name];
	   }
 }
}*/

			ativo = null;
			cellAtivo = null;
			timeId = null;
			document.onclick = new Function("show()");
			function show(obj,name)
			{
				fade = name;
				name = document.getElementById(name);
				if(ativo!=null) { 
					ativo.style.visibility = "hidden"; 
					ativo=null
				}
				if(obj)
				{
					cellAtivo = obj;
				}
				if(timeId!=null){ clearTimeout(timeId); }
				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 = 200;
					name.style.visibility = "visible";
					name.style.top = newY + 40 + 'px';
					name.style.left = newX + 'px';
					
					
					
					//colorfade(fade);
					ativo = name;
				}
			}
			function timerHidePop()
			{
				if(ativo!=null)
				{
					timeId = setTimeout("ativo.style.visibility = 'hidden'; timeId=null; ativo=null;",1);
					
				}
			}
			
	
			cc=2;			// Number of frames in the animation.
			aa=255;			// Initial value used as color parameter for Red, Green and Blue channels. 
			el=0;			// Index of the element. 
		
			function colorfade(nome) {
				
				// Animates until cc >0. It's an animation in 20 steps. Note that cc was initialized with 20. 
				if(cc>0) {
					// aa color value. Decreasing by 5 units. 
					aa-=5;
					// Sets the color value. 
					document.getElementById(nome).style.background="rgb("+aa+","+aa+","+aa+")";
					// Decreases the animation counter. 
					cc--;
					// Call colorfade again...
					setTimeout("colorfade('"+nome+"')",20);
				} else {
					// Reset all animation parameters except the el index. 
					cc=20;
					aa=255;
					// Call again the colorfade procedure increasing the el index until all 
					// elements (see HTML section bellow) are animated. The last element animated
					// is the sixth element. 
					if(el<1) {
						el++;
						setTimeout("colorfade('"+nome+"')",20);
					}
				}
			}
