$(document).ready(function() {
						   
	$('.btn_collapse').each(function(i, item) {
			$(item).toggle(
			  function () {
				getMais($(this).attr('id_'+i), i);
				$(this).html('-');
			  },
			  function () {
				$(this).html('+');
			  }
			);
		$(item).bind('click', function(event) {
			event.preventDefault();
			$('#div_collapse_'+i).slideToggle();
		});
	});

});

function getMais(acervo, i){

	$.ajax(	
		{		  
			type: "POST",		  
			url: "utajax_acervo.asp",		  
			data: "acao=getMais&id_acervo="+acervo, 
			beforeSend: function() { 
				// enquanto a função esta sendo processada, você			
				// pode exibir na tela uma msg de carregando		  
			},		  
			success: function(txt) {			
				// pega o id da div que envolve o select e a substitui com o texto 
				// enviado pelo php, que é um novo select com dados correspondentes
				$('#div_collapse_'+i).html(txt);
			},		  
			error: function(txt) {		 	
				// em caso de erro você pode dar um alert('erro');
				alert('Erro ao carregar Dados');		  
			}		
		}	
	); 
}

function preencheAcervo(){
	document.forms[0].act.value = 'buscar';
	document.forms[0].submit();
} 


