// Lojas AJAX Driven Functions

var eventosXML;
//
function renderEventosList (xmlData, resultStr)
{
	xmlEventos = $j(xmlData.responseXML).get();
	//
	var listItem = '';
	//
	$j('evento', xmlEventos).each (function (i)
	{
		listItem += '<li><a href="view-eventos.php?evenId=' + $j(this).attr ('id') + '">' + $j(this).attr ('data') + ' - ' + $j('titulo', this).text () + '</a></li>';
	});
	//
	$j('#lista-eventos ul').empty  ();
	$j('#lista-eventos ul').append (listItem);
}
//
function loadEventosXML ()
{
	$j.ajax ({
				url: '_services/listar_eventos.php',
				dataType: 'xml',
				complete: renderEventosList
			});
}
//
function setPage ()
{
	loadEventosXML ();
}
//
$j(function ($j) { setPage () } );