//Função usada para mostrar e ocultar uma div
function DivOculta(div)
{
	// Verifica se a div está visivel ou invisivel
	if(document.getElementById(div).style.display == "none")
	{
		document.getElementById(div).style.display = "block";
	}
	else
	{	
		document.getElementById(div).style.display = "none";
	}
}

//funcao para abrir uma div e fechar as outras listadas
function GrupoDivOculta(abrir, fechar)
{
	//quebra o array
	div_fechar = fechar.split(";");
	
	//percorre e fecha todas as divs listadas	
	for (var f in div_fechar)
	{
		document.getElementById(div_fechar[f]).style.display = "none";
	}
	
	//abre (ou fecha caso ja esteja aberta) a div em questão.
	if(document.getElementById(abrir).style.display == "block")
	{
		document.getElementById(abrir).style.display = "none";
	}
	else
	{
		document.getElementById(abrir).style.display = "block";
	}

}



//funcao para exibir ocultar níveis do menu
	var gId=0;
	var gValor='hide';

	function popMenu(pId, pValor)
	{
		// Evita ficar fricando o menu... só faz se houve mudança

		if ((gId != pId) || (gValor != pValor))
		{
			gId = pId;
			gValor = pValor;

			obj = document.getElementById(pId);

			if (obj != null)
			{
				// sobrepoeSelect(pId, pValor);

				if (obj.style)
				{
					obj=obj.style;
					pValor=(pValor=='show')?'visible':(pValor='hide')?'hidden':pValor;
				}

				obj.visibility=pValor;
			}
		}
	}

	function janela_foto(pValue, pWidth, pHeight)
	{
		var janela = window.open(pValue, "_blank", "width="+(pWidth+20)+",height="+(pHeight+25)+",scrollbars=no,status=no");
	}
	
	
	
//Funcao para exibir data	
function ExibeData()
{
	var mydate=new Date()
	var year=mydate.getYear()
	if (year<2000)
	year += (year < 1900) ? 1900 : 0
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
	daym="0"+daym
	var dayarray=new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado")
	var montharray=new Array(" de Janeiro de "," de Fevereiro de "," de Março de ","de Abril de ","de Maio de ","de Junho de ","de Julho de ","de Agosto de ","de Setembro de "," de Outubro de "," de Novembro de "," de Dezembro de ")
	
	document.getElementById("div_data").innerHTML = "   "+dayarray[day]+", "+daym+" "+montharray[month]+year+" ";
}	
