function showRotatingText(allItems, currentItemIndex) {
	var wait = 9000;
	var fadeduration = 1000;
	
	// Hide all items except the current one. (This should not be necessary, but is included as a fallback.)
	for (i = 0; i < allItems.length; i++) {
		if (i != currentItemIndex) {
			$(allItems[i]).hide();
		}
	}
	
	// Work out which item to show next.
	var nextItemIndex = currentItemIndex < (allItems.length - 1) ? currentItemIndex + 1 : 0;
	var currentItem = $(allItems[currentItemIndex]);
	if (!currentItem.is(':visible')) {
		// Fade in the current item.
		$(currentItem).fadeIn(fadeduration);
	}
	
	// Wait, then fade out the current item. Call the showRotatingText() function in the callback to display the next item.
	$(currentItem).delay(wait).fadeOut(fadeduration, function () { showRotatingText(allItems, nextItemIndex); });
}

