// Include jquery.jtwitter.js


$j(document).ready(function(){
// I am query data for "jqueryHowto" user
	$j.jTwitter('ajaalyceanband', function(userdata){
	  //Callback functn with the user data as shown above
	  $j('#twitter h2 a small').html(userdata.followers_count + ' followers');
		var twitImage=userdata.profile_image_url;
		var twitImageBig=twitImage.replace("_normal", "_bigger");
	    $j('#twitterImgBox img').attr('src',twitImageBig);
	});
	
	$j('#twitterFeed li:first').addClass('active');
	$j('#twitterFeed p').each(function () {
		var twitterName = $j(this).text();
		twitterName = twitterName.replace("ajaalyceanband: ","");
		$j(this).text(twitterName);
	});
});



function twitterTicker() {
	var $jactive = $j('#twitterFeed li.active');

	if ( $jactive.length == 0 ) $jactive = $j('#twitterFeed li:last');

	var $jnext =  $jactive.next().length ? $jactive.next()
		: $j('#twitterFeed li:first');

	$jactive.addClass('last-active');

	$jnext.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$jactive.removeClass('active last-active');
		});
}

$j(function() {
	setInterval( "twitterTicker()", 10000 );
});
// The callback function is called when plugin gets user info
// from twitter. The *info* has the following object structure:


	


/*{
	"screen_name":"jqueryHowto",
	"name":"jQuery HowTo",
	"description":"jQuery and javascript howtos, tutorials, hacks, tips and performanace tests.",
	"url":"http://jquery-howto.blogspot.com",
	"followers_count":194,
	"friends_count":120,
	"favourites_count":0,
	"statuses_count":140,
	"location":"",
	"id":26767000,
	"time_zone":"Central Time (US & Canada)",
	"profile_image_url":"http://s3.amazonaws.com/twitter_production/profile_images/110763033/jquery_normal.gif",
	"notifications":false,
	"utc_offset":-21600,
	"following":false,
	"protected":false,
	"created_at":"Thu Mar 26 14:58:19 +0000 2009",
	"profile_link_color":"0000ff",
	"profile_sidebar_fill_color":"e0ff92",
	"profile_background_tile":false,
	"profile_sidebar_border_color":"87bc44",
	"profile_background_color":"9ae4e8",
	"profile_text_color":"000000"
	"profile_background_image_url":"http://static.twitter.com/images/themes/theme1/bg.gif",
}*/
