// JavaScript Document
var animateText = function() { 
	$('.word').fadeOut('slow').delay('200')
		.each( function (index) {
		$(this).delay(200*index).fadeIn('slow', function () {
			// check if it's the last index:
			if (index == 8) { 
				animateText();
			}
		});
	});
}

$(document).ready(function() {
	$('#content p.animated').each( function(index) { 
		var html = $(this)
			.html()
			.split(' ')
			.join('</span> <span class="word">');
		html = '<span class="word">' + html + '</span>';
		$(this).empty().html(html);
	});

	$('.word').hide(); // hide all text on start, quickly. 
	
	animateText();
	

});


