$(document).ready(function(){
	$("#fotos").before("<ul id='navegacao'>").cycle({
		speed: 1000,
		timeout: 5000,
		fx: 'uncover',		
		pager: "#navegacao",
		prev: "#prev",
		next: "#next",
		cleartype: 1,
		fit: 0
	});		
	
	$("#navegacao a").click(function() { 		
		$("#mes_ano a").removeClass("activeSlide");		
	});
	
	$("#mes").click(function() { 
	    $('#fotos').cycle(3);
	    $("#mes_ano a#mes").addClass("activeSlide");
	    $("#mes_ano a#ano").removeClass("activeSlide");
	    return false; 
	});
	
	$("#ano").click(function() { 
	    $("#fotos").cycle(4); 
	    $("#mes_ano a#ano").addClass("activeSlide");
	    $("#mes_ano a#mes").removeClass("activeSlide");
	    return false; 
	});
	
	$("div#legenda1").css("opacity", 0);
	$("div#legenda2").css("opacity", 0);
	$("div#legenda3").css("opacity", 0);
	$("div#legenda4").css("opacity", 0);
	$("div#legenda5").css("opacity", 0);
	
	$(".img1").hover(			
		function() {			
			$("div#legenda1").stop().fadeTo("medium", 0.8);
		},
		function() {			
			$("div#legenda1").stop().fadeTo("fast", 0);
		}
	); 	
	$(".img2").hover(
		function() {			
			$("div#legenda2").stop().fadeTo("medium", 0.8);
		},
		function() {			
			$("div#legenda2").stop().fadeTo("fast", 0);
		}
	);
	$(".img3").hover(
		function() {			
			$("div#legenda3").stop().fadeTo("medium", 0.8);
		},
		function() {			
			$("div#legenda3").stop().fadeTo("fast", 0);
		}
	);
	$(".img4").hover(
		function() {			
			$("div#legenda4").stop().fadeTo("medium", 0.8);
		},
		function() {			
			$("div#legenda4").stop().fadeTo("fast", 0);
		}
	);
	$(".img5").hover(
		function() {			
			$("div#legenda5").stop().fadeTo("medium", 0.8);
		},
		function() {			
			$("div#legenda5").stop().fadeTo("fast", 0);
		}
	);
});

