function abreSubmenu(sub1, sub2) {
	var status = eval("document.getElementById('"+sub1+"').style.display");
	if (status == "none"){
		eval("document.getElementById('"+sub1+"').style.display = 'inline';")
	}
	else {
		eval("document.getElementById('"+sub1+"').style.display = 'none';")
	}
}



function galeriaFoto(objProjeto, objFoto){
	var width = 480;
	var height = 330;
	var left = (screen.width - width) / 2
	var top = (screen.HEIGHT - height) / 2
	window.open('foto.asp?projeto='+ objProjeto +'&foto='+ objFoto +'','teste', 'width='+width+', height='+height+', top='+top+', left='+left+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, fullscreen=no');
}

// Método que troca a foto
var Imagem = new Image();
function trocaFoto() {
	document.getElementById("foto").src = Imagem.src;
}

function mostraFoto(objProjeto, objFoto) {
	img = 'shared/img/projetos/'+ objProjeto +'/fotos/'+ objFoto

	document.getElementById("foto_geral").style.display = "inline";
	document.getElementById("bg_foto").style.display = "inline";
	document.getElementById("dv_foto").style.display = "inline";

	// Instancia um novo objeto de imagem
	Imagem = new Image();
	// Alteramos a URL da imagem, para ser carregada
	Imagem.src = img;
	// Assim que a imagem for carregada, executamos o método 'trocaFoto' (logo acima)
	
	//Imagem.onload = trocaFoto;
	trocaFoto();
	document.getElementById("combo_projetos").style.display = "none";

	strFoto = objFoto.split(".");
	numFoto = strFoto[0];

	switch(objProjeto) {
	case '13':
	  
	  switch (numFoto) {
	  		case '1':
				document.getElementById('legenda').innerHTML="Equipe do projeto com os habitantes da aldeia Vendaval."
	  			break
			case '2':
				document.getElementById('legenda').innerHTML="Equipe sobe o Rio Solimões para chegar à Aldeia Vendaval dos índios Ticuna."
	  			break
			case '3':
				document.getElementById('legenda').innerHTML="Jovem Ticuna arremessa a bola para derrubar a pilha de bananas no jogo Poï Arü Nhagü."
	  			break
			case '4':
				document.getElementById('legenda').innerHTML="Homens dançam na casa de reuniões que fica no centro da aldeia."
	  			break
			case '5':
				document.getElementById('legenda').innerHTML="Jovens Manchineri se enfrentam na batalha de piões."
	  			break
			case '6':
				document.getElementById('legenda').innerHTML="Mulheres brincam com o Jogo da Velha."
	  			break
			case '7':
				document.getElementById('legenda').innerHTML="Deodoro Kunkop constrói fazendinha com animais nativos usando polpa de buriti."
	  			break
			case '8':
				document.getElementById('legenda').innerHTML="O cacique Raul Mayoruna é exímio nos jogos com arco e flecha."
	  			break
			case '9':
				document.getElementById('legenda').innerHTML="As mulheres bororo são tetracampeãs de futebol nos Jogos dos Povos Indígenas."
	  			break
			case '10':
				document.getElementById('legenda').innerHTML="Tabuleiro do jogo Onça e Cachorros que os bororos chamam de Adugo."
	  			break
	  }
	  break
	case '15':
		switch (numFoto) {
	  		case '1':
				document.getElementById('legenda').innerHTML="Orquestra e Coral do Projeto Guri/Febem<BR>Abertura do 30º Festival Inverno de Campos do Jordão - 03/07/99 "
	  			break
			case '2':
				document.getElementById('legenda').innerHTML="Camerata de Violões do Internato Feminino da Febem Móoca no Theatro São Pedro."
	  			break
			case '3':
				document.getElementById('legenda').innerHTML=""
	  			break
			case '4':
				document.getElementById('legenda').innerHTML="Toquinho"
	  			break
			case '5':
				document.getElementById('legenda').innerHTML="Paulinho Nogueira"
	  			break
			case '6':
				document.getElementById('legenda').innerHTML="Yamandú Costa"
	  			break
			case '7':
				document.getElementById('legenda').innerHTML="Padre Marcelo Rossi e o Projeto Guri no Natal de 1999 no Palácio dos Bandeirantes."
	  			break
			case '8':
				document.getElementById('legenda').innerHTML="D. Lu Alckmin"
	  			break
			case '9':
				document.getElementById('legenda').innerHTML="D. Lila Covas"
	  			break
			case '10':
				document.getElementById('legenda').innerHTML=""
	  			break
	  }
	  break
	}
}

function fechaFoto() {
	document.getElementById("foto").src = "shared/img/transp.gif";
	document.getElementById("bg_foto").style.display = "none";
	document.getElementById("dv_foto").style.display = "none";
	document.getElementById("foto_geral").style.display = "none";
	document.getElementById("combo_projetos").style.display = "inline";
	//alert('asdf')
}