/*!
 * jQuery animateText Plugin
 * version: 1.0 (16-MAR-2011)
 * @requires jQuery v1.4 or later
 * @author Cientista
 * 
 */

(function( $ ){

	$.fn.animateText = function(duration) {
		if (!duration) duration = 1000;
		
		$(this).each(function() {
			var text = $(this).text();
			
			$(this).extend({count:0}).animate({count: text.length}, {
			    duration: duration,
			    step: function() {
			        $(this).text( text.substring(0, Math.round(this.count)) + "_" );
			    },
			    complete: function() {
			    	$(this).text(text);
			    }
			});
		});
	};

})( jQuery );
