/* Depends:
 *	jquery.effects.core.js
 */

(function($) {
    
    $.fn.typewriter = function(step, callback) {
        this.each(function() {
            var $ele = $(this), str = $ele.text(), progress = 1;
            $ele.text(str.substring(0, 1))
            var timer = setInterval(function() {
                $ele.text(str.substring(0, ++progress));
                if (progress >= str.length) {
					clearInterval(timer);
					if (callback) {callback()};
				}
            }, step);
        });
        return this;
    };
    
})(jQuery);
