$.fn.clickUrl = function() {
	var link_regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
	var search_regexp = /#([A-Za-z0-9]+)/gi;
	this.each(function() {
		$(this).html(
			$(this).html().replace(link_regexp,'<A href="$1" target="_blank">$1</A>')
		);
		$(this).html(
			$(this).html().replace(search_regexp,'<A href="http://twitter.com/search?q=%23$1" target="_blank">#$1</A>')
		);
	});
	return $(this);
}

function twitterCallback(data) {
	var found = false;
	$.each(data, function(){
		if (this["text"].indexOf('@') != 0 && this["text"].indexOf('#dthmtl') != -1 && !found) {
			$('#twitter').html(this["text"]);
			$('#twitter').clickUrl();
			var followText = "&nbsp;&nbsp;<a href='http://www.twitter.com/markw351' target='_blank'>Follow me on Twitter</a>";
			$('#twitter').append(followText);
			found = true;
      }
	});
	if (!found) {
		$('#twitter').html("");
	}
}