function showUl( ul )
{
	if( document.getElementById( ul ).style.display == 'block' )
		document.getElementById( ul ).style.display = 'none';
	else
		document.getElementById( ul ).style.display = 'block';
}
function showProjeto( projetoID )
{
	for(i=1; i<=totalProjetos; i++)
	{
		document.getElementById( 'detalheProjeto'+i ).style.display = 'none';
		document.getElementById( 'linkProjeto'+i ).className = 'navlinks';
	}
	if( projetoAtivo != projetoID )
	{
		document.getElementById( 'detalheProjeto'+projetoID ).style.display = 'block';
		document.getElementById( 'linkProjeto'+projetoID ).className = 'sublinks_selected';
		projetoAtivo = projetoID;
	}
	else
	{
		document.getElementById( 'detalheProjeto'+projetoID ).style.display = 'none';
		document.getElementById( 'linkProjeto'+projetoID ).className = 'navlinks';
		projetoAtivo = 0;
	}
}
function exibeFoto( fotoId, fotoURL )
{
	for(i=1; i<=totalFotos; i++)
	{
		document.getElementById( 'foto_'+i ).className = '';
	}
	document.getElementById( 'foto_'+fotoId ).className = 'listGalery_Selected';
	fotoAtiva = fotoId;
	//atualizaDimensoesDaImagem();
	document.getElementById( 'bg_site' ).src = fotoURL;
	showLoading();
}
function resizeBrowser()
{
	var largura = 0;
	var altura = 0;
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			largura = window.innerWidth;
			altura = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			largura = document.body.offsetWidth;
			altura = document.body.offsetHeight;
		}
	}

	if( largura / altura > larguraImagem / alturaImagem )
	{
		document.getElementById( 'bg_site' ).width = largura;
		document.getElementById( 'bg_site' ).height = alturaImagem * largura / larguraImagem;
	}
	else
	{
		document.getElementById( 'bg_site' ).width = larguraImagem * altura / alturaImagem;
		document.getElementById( 'bg_site' ).height = altura;
	}
	
	/*document.getElementById( 'txtWidth' ).value = largura;
	document.getElementById( 'txtHeight' ).value = altura;*/
	
	larguraImagem = document.getElementById( 'bg_site' ).width;
	alturaImagem = document.getElementById( 'bg_site' ).height;
}
function atualizaDimensoesDaImagem()
{
	larguraImagem = document.getElementById( 'bg_site' ).width;
	alturaImagem = document.getElementById( 'bg_site' ).height;
	resizeBrowser();
}
function showLoading()
{
	document.getElementById( 'loader' ).style.display = 'block';
}
function hideLoading()
{
	atualizaDimensoesDaImagem();
	document.getElementById( 'loader' ).style.display = 'none';
}
