ativo = null;
cellAtivo = null;
timeId = null;
document.onclick = new Function("show()");

function addOption(obj,arr)
{
	var obj = document.getElementById(obj);
	var boxLength = obj.length;
	for(i=0; i<arr.length; i++)
	{
		newoption = new Option(arr[i][0], arr[i][1], false, false);
		obj.options[boxLength] = newoption;
		boxLength++;
	}
}

function show(cell, obj)
{
	obj = document.getElementById(obj);

	if(ativo != null) 
	{ 
		ativo.style.visibility = "hidden"; ativo=null;  cellAtivo.style.backgroundColor=''; 
	}
	if(cell)
	{
		cell.style.backgroundColor='#F6F6F6';
		cellAtivo = cell;
	}
	if(timeId != null)
	{ 
		clearTimeout(timeId); 
	}

	if(obj)
	{
		ativo = obj;
		obj.style.visibility = "visible";
	}

///	popUp(obj, e);
}


function timerHidePop()
{
	if(ativo != null)
	{
		timeId = setTimeout("ativo.style.visibility = 'hidden'; timeId=null; cellAtivo.style.backgroundColor=''; ativo=null;", 500);
	}
//	else 
//		cellAtivo.style.backgroundColor='';
}

