// default java script page

$(document).ready(function() {
   	// tweetify function
	$.fn.tweetify = function() {
		this.each(function() {
			$(this).html(
				$(this).html()
					.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>')
					.replace(/(^|\s)#(\w+)/g,'$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>')
					.replace(/(^|\s)@(\w+)/g,'$1<a href="http://twitter.com/$2">@$2</a>')
			);
		});
		return $(this);
	} // end tweetify

	// get twitter feed
	$.getJSON("http://twitter.com/statuses/user_timeline/adamaoc.json?callback=?", function(data) {
	     $("#twitter").html(data[0].text);
	     $("#twitter").tweetify();
	});
	// off get twitter feed
});
