//-------------------------------
// Class
//-------------------------------

function TwitterApp() {
	
	var _self = this;

	//-------------------------------
	// Constants
	//-------------------------------
	
	//-------------------------------
	// Properties
	//-------------------------------
	
	var _urlRegExp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
	
	//-------------------------------
	// Constructor
	//-------------------------------
	
	$(function() {
		$.getJSON('http://twitter.com/statuses/user_timeline/rosequarter.json?callback=?', function(response) {
			$("#newsContent").html("");
			$(response).each( function(i) {
				$("#newsContent").append(content(this.text));
			});
			
			$('#newsContent').jScrollPane({scrollbarWidth:13, dragMinHeight:30, showArrows:true});
		});
	});
	
	//-------------------------------
	// Public Methods
	//-------------------------------
	
	//-------------------------------
	// Private Methods
	//-------------------------------
	
	function content(data) {
		var content
		
		content = "<div class='twitter-item'>";
		content += data.toString().replace(_urlRegExp,'<a href="$1" target="_blank">$1</a>');
		content += "<br/>";
		content += "</div>";
	
		return content;
	}
	
	//-------------------------------
	// Listeners
	//-------------------------------
	//-------------------------------
	// Getters/Setters
	//-------------------------------
}

