$(document).ready(function(){
0
	$('div.mapas').each(function(){
		//aplica atributo (opened) que diz se div esta aberta ou fechada
		if($(this).hasClass('mapa_fechado'))
			$(this).attr('opened', 'false');
		else
  		$(this).attr('opened', 'true');
		
		//aplica evento
		$(this).click(function(){
			accordionAbre($(this));
    });
	});
});

function accordionAbre(obj){
  $('div.mapas').attr('opened', 'false');
  obj.attr('opened', 'true');
	
	$('div.mapas').each(function(){
    var opened = ($(this).attr('opened') == 'true')?true:false;
		$(this).animate({
			height: ((opened)?363:59)
		}, 200, function() {
			$(this).attr('opened', 'false');
		});
	});
}
