
jQuery.noConflict();

function tweetScroll(li) {
	
	var currentLi = li;
	if (currentLi == 0) {
		// make currentLi the first li
		currentLi = jQuery('#widget .twitter-list ul').children('li:first');
	}
	var nextLi = jQuery(currentLi).next('li');
	
	// if there is no next li, meaning this is the last li, make nextLi the first
	if (jQuery(currentLi)[0] == jQuery('#widget .twitter-list ul').children('li:last')[0]) {
		nextLi = jQuery('#widget .twitter-list ul').children('li:first');
	}
	
	// scroll to the nextLi
	jQuery('#widget .twitter-list ul').scrollTo(jQuery(nextLi), 500);
	
	// call tweetScroll again in 7 seconds
	setTimeout(function(){tweetScroll(jQuery(nextLi))}, 7000);
}


jQuery(document).ready(function() {
    // check for the scrolling twitter demo
    if (jQuery('#widget').length) {
        setTimeout(function(){tweetScroll(0)}, 7000);
    }
});


