function Tweet(result){
	_result = result || {};
	this.created_at = _result.created_at;
	this.from_user = _result.from_user;
	this.from_user_id = _result.from_user_id;
	this.geo = _result.geo;
	this.id = _result.id;
	this.iso_language_code = _result.iso_language_code;
	this.location = _result.location;
	this.profile_image_url = _result.profile_image_url;
	this.source = _result.source;
	this.text = _result.text;
	this.to_user = _result.to_user;
	this.to_user_id = _result.to_user_id;
	
	if (this.geo){
		this.latLng = new google.maps.LatLng(this.geo[0], this.geo[1]);
	}
}

Tweet.prototype.parseHTML = function(){
	  //Regex for status from http://deanjrobinson.com/code/how-to-add-clickable-hashtags-to-your-twitter-widget/
    var status = this.text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
        return '<a target="_blank" href="'+url+'">'+url+'</a>';
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
        return '<a target="_blank" href="http://twitter.com/'+reply.substring(1)+'">'+reply.charAt(0)+reply.substring(1)+'</a>';
    }).replace(/\B#([_a-z0-9]+)/ig, function(hashtag) {
        return '<a target="_blank" href="http://twitter.com/search?q=%23'+hashtag.substring(1)+'">'+hashtag+'</a>';
    });

    var html = "<a target='_blank' href='http://www.twitter.com/"+this.from_user+"'><div class='profile_image' style='background-image:url("+this.profile_image_url+");'></div></a>";
    html += "<div class='tweet_content'>";
    html += "<a target='_blank' class='tweet_user' href='http://www.twitter.com/"+this.from_user+"'>"+this.from_user+"</a>";
    html += " - " + status;
    html += "<br /><span class='add_info'><span class='pdate' title='"+this.created_at+"' >"+this.created_at+"</span> from "+this.location+" via "+this.source.unescapeHtml()+"</span>";
    html += "</div><div class='clear'></div>";
    return html;
}
Tweet.prototype.hasPics = function(){
	return /twitpic|tweetphoto|flickr/gi.test(this.text);
}
Tweet.prototype.getPicThumbnails = function(){
	var imageHtml = "";
  if (/twitpic/gi.test(this.text)){
      var regExMatch = tweetText.match(/http\:\/\/twitpic.com\/([a-zA-Z0-9]*)/i);
      var imageId = regExMatch[1];
      var url = regExMatch[0];
      imageHtml = "<div class='twitpic' style='background-image:url(http://twitpic.com/show/thumb/"+imageId+");' />";
  }
  return imageHtml;
}
