var tweetTempo;
$(function(){
    $('#formNewsletters').ajaxPost();

    
	$('.boxTwitter').ajaxLista({
		url: BASE_URL + 'noticias/muda',
		limite: 1,
		botoes: $('.setas'),
		next: $('.next'),
		prev: $('.prev')
	});

//    tweetTempo = setInterval(function() {
//    		if(typeof($('.twtr-tweet')[0])) {
//    	    	mostraTwitter();
//    	    }
//    }, 1000);
//    
//    setTimeout('clearInterval(tweetTempo)', 10000);
//    
//    //navegacao no boxTwitter
//    $('.setas a').click(function(){
//    	clearInterval(tweetTempo);
//    	var direcao = $(this).attr('class');
//    	$('.twtr-tweet').each(function(){
//    		if($(this).attr('style') == 'display: block;'){
//    			if(direcao == 'next'){
//	    			if($(this).next().html() != null){
//	    				$(this).hide();
//	    				$(this).next().show();
//	    				if(!$(this).next().next().html()){
//	    					$('.next').hide();
//	    				}else{
//	    					$('.setas a').show();
//	    				}
//	    				return false;
//	    			}
//	    		}else{
//	    			if($(this).prev().html() != null){
//	    				$(this).hide();
//	    				$(this).prev().show();
//	    				if(!$(this).prev().prev().html()){
//	    					$('.prev').hide();
//	    				}else{
//	    					$('.setas a').show();
//	    				}
//	    				return false;
//	    			}
//	    		}
//    		}
//    	});
//    });
});
