/* variaveis globais */  
 var folhaAtual = 1;
 var acaoBanner = 1;
 
/* iniciar sequencia */
function mostrarFolhaPrincipal(folhaAtualFunc,preAcaoFunc){
  if(acaoBanner == "0" && preAcaoFunc == 1){
	 return true;	
  }else{	  
	if( folhaAtualFunc < 7 ){				
		folhaTxt =  "#foto" + folhaAtualFunc; 
		folhaAtualTxt =  "#foto" + folhaAtual;		
		numTxt = "<b>" +folhaAtualFunc+ " - 6</b>";
		$(folhaAtualTxt).fadeOut("slow",
		  function(){
			 $(folhaTxt).fadeIn("slow");
			 $(".txt_banner_seq").html(numTxt);
		  }
		);	
		folhaAtual = folhaAtualFunc;
		folha = folhaAtualFunc + 1;		
	}else{
		folhaAtualTxt =  "#foto" + folhaAtual;
		numTxt = "<b>1 - 6</b>";
		$(folhaAtualTxt).fadeOut("slow",
		 function(){
		    $("#foto1").fadeIn("slow");
			$(".txt_banner_seq").html(numTxt);
		 }
		);
		folhaAtual = 7;
		folha = 1;
	}	
	folhaAtual = folhaAtualFunc;
	if( preAcaoFunc == 0 ){
	    acaoBanner = 0;	
		setTimeout("mostrarFolhaPrincipal(folha,1)",8000);
	}else{
		setTimeout("mostrarFolhaPrincipal(folha,1)",8000);
	}
			
  }
}

/* parar sequencia */
function pausarBanner(){
   acaoBanner = "0";
}

/* ativar sequencia */
function ativarBanner(){
  if(acaoBanner != "1"){ 
   	 acaoBanner = 1;
	 if( folhaAtual == 7 ){
		mostrarFolhaPrincipal(1,1);  
	 }else{
		mostrarFolhaPrincipal((folhaAtual+1),1); 
	 }
  }	
}

/* iniciar sequencia */
//setTimeout("mostrarFolhaPrincipal(1,1)",8000);
