jQuery(document).ready(function() {
                
	$(".desenv").click(function() {
        menu_title = $(this).attr('title') ? $(this).attr('title') : false;
		$("#nav_ning_top .abare a").css('background-color', '#59350b');
		$("#nav_ning_top .mapeamento a").css('background-color', '#59350b');
		$("#nav_ning_bottom .ecoturismo a").css('background-color', '#59350b');
		$("#nav_ning_bottom .artesanato a").css('background-color', '#59350b');
				
        if(menu_title) {
			$('#nav_ning_bottom .'+menu_title+' a').css('background-color', '#265610');
			$('#nav_ning_top .'+menu_title+' a').css('background-color', '#265610');
        } 
				
        $(".desenv").css('opacity', '.5');
        $(this).css('opacity', '1');

        target = "#" + $(this).attr('id') + "_desc";
        $(".abre_desenv").slideUp("fast");
		$(target).slideDown("fast");
		
		return false;
	 });
	
		$("#inst_z_foto").slideDown("fast");
		
	$(".instit").mouseover(function() {
				
       	target = "#" + $(this).attr('id') + "_foto";
        $(".abre_instit").hide(0);
		$(target).fadeIn(5);
		
	//	window.clearTimeout(timer2);
	//	timer2 = null;
		
		return false;
	 });
	
	$(".instit").mouseleave(function() {
		
		target = "#" + $(this).attr('id') + "_foto";
		
	//	timer2 = window.setTimeout(function() {
			$(target).hide(0);
			$("#inst_z_foto").show(0);
	//	}, 1000);
		
				
		return false;
	 });

	$(".instit").click(function() {

		target_cor = "#" + $(this).attr('id') + " a";
		
		$('#inst_a a').css('background-color', '#59350b');
		$('#inst_b a').css('background-color', '#59350b');
		$('#inst_c a').css('background-color', '#59350b');
		$('#inst_d a').css('background-color', '#59350b');
		$('#inst_e a').css('background-color', '#59350b');
		$('#inst_f a').css('background-color', '#59350b');
		$('#inst_g a').css('background-color', '#59350b');
		$(target_cor).css('background-color', '#284d24');
		
       	
		target_cont = "#" + $(this).attr('id') + "_cont";
        $(".abre_instit_desc").slideUp("fast");
		$(target_cont).slideDown("fast");
		
		return false;
	 });
	
	$(".programa").click(function() {
	   target = "#" + $(this).attr('id') + "_desc";
	   $(".abre_programa").slideUp("fast");
	   $(target).slideDown("fast");
		return false;
   });
	
	$(".toggle_container").hide(); 
	$(".trigger").click(function(e){
		e.preventDefault();
		$('.toggle_container').not($(this).next()).slideUp("slow");	
		$(this).next().slideToggle("slow");
		//return false; //Prevent the browser jump to the link anchor
	});

	$(".js-include").each(function(){
		var inc=$(this);
		$.get(inc.attr("title"), function(data){
			inc.replaceWith(data);
		});
	});
	
});


function initialize() {
		var latlng = new google.maps.LatLng(-3.189879,-55.623779);
		var settings = {
			zoom: 8,
			center: latlng,
			mapTypeControl: true,
			mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
			navigationControl: true,
			navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
			mapTypeId: google.maps.MapTypeId.ROADMAP
    };
	
	var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
}

