function localizarListaPresentes(){
	
	document.frmBuscarListaPresentes.submit();
	
}

function acessarListaPresentes(){
	
	document.frmListaPresentes.submit();
	
}


function enviarAcessoLista(varIDLista){
	
	$.ajax({
		type: 'post',
		url: '/cria.acesso.lista.php',
		data: '&id-lista='+varIDLista,
		beforeSend: function(){
			$('#mensagens-sistema').html("Aguarde! Acessando a lista de presentes");
		},
		success: function(txt){
			$('#listas').html(txt);
		},
		error: function(txt){
			$('#mensagens-sistema').html("Ops! Ocorreu um erro durante a requisição do arquivo.");
		}
	});
	
}

//Função responsável por efetuar o envio da função login
function buscarLista(){
	$forms = $('#frmListas');
	$forms.submit(function(){
		return false;
	});
	
	
	$forms.bind('submit', function(){
	
		var params = $(this.elements).serialize();
		var self = this;
		$.ajax({
			type: 'post',
			url: this.action,
			data: params,
			beforeSend: function(){
				$('#convidados').hide();
				$('#resultados').show();
				$('#resultados').html("Por favor, aguarde, localizando listas");
			},
			success: function(txt){
				//$button.attr('disabled',false);
				$('#resultados').html(txt);
				//self.reset();
			},
			error: function(txt){
				$('#resultados').html(txt);
			}
		})
		
	});
	
}

