/**
 * jquery function for rotating tweets
 */
var visibleIndex = 0;
var visibleCount = 2;
var seconds = 7;
var $tweets;
function rotateTweets()
{
    var nextIndex = visibleIndex + visibleCount;
    if (nextIndex >= $tweets.length) {
        nextIndex = nextIndex - $tweets.length;
    }
    var position = visibleIndex + visibleCount - 1;
    if (position >= $tweets.length) {
        position = 0;
    }
    $tweets.eq(nextIndex).remove().insertAfter($tweets.eq(position))/*.fadeIn('slow', function () {*/
    .slideDown('slow', function () {
        $tweets.eq(visibleIndex).slideUp();
        visibleIndex++;
        if (visibleIndex == $tweets.length) {
            visibleIndex = 0;
        }
    });
    return true;
}
$(function () {
    $tweets = $("#tweets p").slice(visibleCount).hide().end();
    if ($tweets.length <= visibleCount) {
        return;
    }
    $tweets.parent().addClass('rotator');
    window.setInterval("rotateTweets()", seconds * 1000);
});