jQuery(function($){ 
	totalT = 0;

$("#tweetbox").getTwitter({
	userName: "CajunToronto",
	numTweets: 5,
	loaded: function(){
		totalT = $('#twitter_update_list li').size();		
		$('#twitter_update_list li:first').clone().appendTo('#twitter_update_list');		
		$('#tweetbox p.loading').animate({opacity:0},400,'easeInOutExpo',function(){
			$(this).remove();
			$('#twitter_update_list').animate({top:0},400,'easeInOutExpo',function(){
				tweetCycle();
			});
		});
	}
});

currentY = 0;
currentT = 1;

var tweetTimer = {};

$('#tweetbox').hover(function(){
	$.clearTimer(tweetTimer);
},function(){
	tweetCycle();
});

});
function tweetCycle(){
	tweetTimer = $.timer(4200,function(){
		$.clearTimer(tweetTimer);
		if(currentT==totalT+1){
			$('#twitter_update_list').css({top:0});
			currentY = 0;
			currentT = 1;
		}
		currentY = currentY - 150;
		$('#twitter_update_list').animate({top:currentY},400,'easeInOutExpo');
		currentT = currentT + 1;
		tweetCycle();
	});
}

