$(document).ready(function() {
	
	$("a.fotos").each(function(){
		var path = $(this).attr("href");
		$(this).append("<img src='" + path + "' alt=''>");
	});
	
	$("a.fotos").fancybox({
		onComplete: function(){
			if( $.browser.msie ) {
				var width_antigo = $("#fancybox-inner").css("width");
				var width_antigo = width_antigo.replace("px", "");
				var width_novo   = width_antigo - 45;
				$("#fancybox-inner").css("width", width_novo + "px");
				var height_antigo = $("#fancybox-inner").css("height");
				var height_antigo = height_antigo.replace("px", "");
				var height_novo   = height_antigo - 45;
				$("#fancybox-inner").css("height", height_novo + "px");
			}
		}
	});
	
	$("#head_documentos").toggle(function(){
		$(".body_documentos").show("slow");
		$(".espaco_documentos").show();
	},function(){ 
		$(".body_documentos").hide("slow");
		$(".espaco_documentos").hide();
	});
	
	$("#head_legislacao").toggle(function(){
		$(".body_legislacao").show("slow");
		$(".espaco_legislacao").show();
	},function(){ 
		$(".body_legislacao").hide("slow");
		$(".espaco_legislacao").hide();
	});
	
	$("#head_reunioes_cronograma").toggle(function(){
		$(".body_reunioes_cronograma").show("slow");
		$(".espaco_reunioes_cronograma").show();
	},function(){ 
		$(".body_reunioes_cronograma").hide("slow");
		$(".espaco_reunioes_cronograma").hide();
	});
	
	$("#head_relatorios").toggle(function(){
		$(".body_relatorios").show("slow");
		$(".espaco_relatorios").show();
	},function(){ 
		$(".body_relatorios").hide("slow");
		$(".espaco_relatorios").hide();
	});
	
	$("#head_fotos").toggle(function(){
		$(".body_fotos").show("slow");
	},function(){ 
		$(".body_fotos").hide("slow");
	});
	
});
