$().ready( function() {

	drops();

	var a = 1;
	var total = 3;
	var stage = 0;

	if(a < total){
		$.timer(8000, function (timer) {
			
			if(a < total && stage == 0) {
				a++;
				stage = 0;
			}
			else if(a > 1) {
				a--;
				stage = 1;
			}
			else if(a == 1) {
				a++;
				stage = 0;
			}

			if(stage == 0) $('.pagination a.next').click();
			else if(stage == 1) $('.pagination a.prev').click();

			//timer.stop();
		});		
	}

});

///////////////////////////////////* Drops *//////////////////////////////////

function drops(){

	$('.drops .pagination a').live("click", function(){

		var page = $(this).attr('href');
		page = page.split('pagina=');
		page = page[1];

		jQuery.ajax({
			type: "POST",
			url: "modules/widgets/drops-ajax.php",
			data: "pagina="+page,
			success: dropsResponse
		});

		return false;
	
	});

}

function dropsResponse(response){

	$('.drops ul').fadeOut("slow", function(){

		$('.drops').html(response).find('ul').each(function(){
		
			$(this).hide().fadeIn("slow");
		
		});
	
	});

}

//////////////////////////////////////////////////////////////////////////////
