$(document).ready(function() {

	$("#sendBusca").click( function(){
	
		if ( $("#strBusca").val() == 'Cidade' || $("#strBusca").val() == '' )
		{
		
			alert('Preencha corretamente o campo de busca.');
			return true;
			
		}
		
		// $("#divArtNotRec").hide();
		$("#loading").show();
		
		$.ajax({
		
			type: "POST",
			url: "/processAjax/buscaRss.php",
			cache: false,
			data: "strBusca="+$("#strBusca").val(),
			success: function (html){
			
				$("#resultado_busca").html(html);
				
				// alert(html);				
			},
			error: function (a,b,c)
			{
			
				// alert(a+"\n"+b+"\n"+c);
				alert( 'Houve um erro na sua requisição, tente novamente.' );
				
			},
			complete: function(html){
			
				$("#testandoTable")
				.tablesorter({
				
					widthFixed: false, 
					// widgets: ['zebra'], 
					debug: false,  
					headers: {
					
						0:{
						
							sorter:"shortDate"
							
						}
						
					},
					dateFormat: 'dd/mm/yy'
					
				})
				
				.tablesorterPager({
				
					container: $("#pager"),
					size: 5,
					positionFixed: false,
					cssPageSize: '.pagesize'
				
				});


				$("#loading").hide();
				$("#resultado_busca").show();
				// alert($("#resultado_busca").html());
								
			}
			
		});
		
		
		// $("#showResultados").pager('ul'); 
				
	});
		
});