jQuery.fn.typewriter = function() 
{
    var i=0;
    var opt = { 'delay': 50 };
    var typeone = function(self, text, content) 
    {
        if (text.length > 0) 
        {
            i=i+1;
            var next = text.match(/(\s*(<[^>]*>)?)*(&.*?;|.?)/)[0];
            text = text.substr(next.length);
            jQuery(self).html(content+next);
            setTimeout(function()
        		{
                	typeone(self, text, content+next);
        		}, opt['delay']);
        }
    }
    this.each(function() 
    {
    	jQuery(this).height(jQuery(this).height());
    	jQuery(this).width(jQuery(this).width()); 
        typeone(this, jQuery(this).html(), '');
    });
    return this;
}
jQuery(document).ready(function()
{
	jQuery(".typewriter")
	.typewriter();
}); 
