// JavaScript Document

function ShowLayer(layer){
	OcultarCamadas('fotocapa');
	iState = 1;
	var obj = document.getElementById(layer);
	obj.style.display = iState ? "block" : "none";
}
		//Create an array 
var allPageTags = new Array(); 
function OcultarCamadas(theClass) { 
//Populate the array with all the page tags 
var allPageTags=document.getElementsByTagName("*"); 
//Cycle through the tags using a for loop 
for (i=0; i<allPageTags.length; i++) { 
		//Pick out the tags with our class name 
		if (allPageTags[i].className==theClass) { 
			//Manipulate this in whatever way you want 
			allPageTags[i].style.display='none'; 
		} 
		
		// muda os links na cor padrao
		if (allPageTags[i].className=="ativo") { 
			//Manipulate this in whatever way you want 
			allPageTags[i].className="inativo"; 
		} 
	} 
} 
		
var y = 1;
function LayersLoop(n){
	total = n;
	camada = "capa" + y;
	ShowLayer(camada);
	
	// muda a cor do link
		var numero = document.getElementById("controle" + y);
		numero.className = "ativo";
	
	y++;
	status = camada;
	if(y>total){
		y=1;
	}
	setTimeout("LayersLoop(total)", 9000);
}

function MostraLayer(layer){
	var y = layer;
	camada = "capa" + layer;
	ShowLayer(camada);
	
	var numero = document.getElementById("controle" + y);
	numero.className = "ativo";

	}