/***************************************************************************************************
@ NoticiaAjax
@ Manipula notícias via ajax
***************************************************************************************************/
function carregaNoticia(){
	var params = 'action=carregaNoticia';
	var serverPath = '../class/view/ajax/';
	
	$.ajax({
		type: 'POST',
		url: serverPath+'NoticiaAjax.php',
		data: params,
		beforeSend: function(){
			$('#conteudo-noticia').html('<img src="../images/loading.gif"/>').fadeIn();
        },   
		success: function(xml){
			if($(xml).children.length>0) {
				var noticiaHtml = "";
				$(xml).find("noticia").each(function(){
					noticiaHtml += '<li><a href="'+$(this).find('link').text()+'" target="_blank">'+$(this).find('titulo').text()+'</a></li>';
				});
				$('#conteudo-noticia').html(noticiaHtml);
			}
		},

        error: function(erro){
			//alert("[AJAX] Erro - Houve algum problema com o objeto XMLHttpRequest!\n\n");
        }
	});
}