
window.brand_data = null;
window.prev_brand_data = null;
window.locker_start_rank = 10;

window.logged_in = false;
window.twitter_page = 1;
window.twitter_live_mode = true;

/* ************************************************************************* */
$(document).ready(function()
{		
	// External links
	$("a[rel=external]").live("click", function(event)
	{
		event.preventDefault();
		trackEvent("/external/" + $(this).attr("href"));
		window.open($(this).attr("href"));
	});
	
	// Ticker event handlers
	$("#ticker marquee").marquee("pointer").mouseover(function()
	{
		$(this).trigger("stop");
	}
	).mouseout(function()
	{
		$(this).trigger("start");
	}
	).mousemove(function(event)
	{
		if ($(this).data("drag") == true)
		{
			this.scrollLeft = $(this).data("scrollX") + ($(this).data("x") - event.clientX);
		}
	}
	).mousedown(function(event)
	{
		$(this).data("drag", true).data("x", event.clientX).data("scrollX", this.scrollLeft);
	}
	).mouseup(function()
	{
		$(this).data("drag", false);
	});
	
	// Twitter event handlers
	
	// Pagination
	$("#tweet-pagination a").click(function(event)
	{
		event.preventDefault();
		window.twitter_live_mode = false;
		$("#tweet-pagination a.live-updates").text("Resume live updates");
		window.twitter_page = parseInt($(this).text());
		
		$("#tweet-pagination li").removeClass("active");
		$("#tweet-pagination li:nth-child(" + window.twitter_page + ")").addClass("active");
		
		var lower = (window.twitter_page * 10) - 10;
		var upper = window.twitter_page * 10;
		
		$("#tweets .tweet-content:lt(" + (lower + 1) + ")").hide();
		$("#tweets .tweet-content:gt(" + (lower) + ")").show();
		$("#tweets .tweet-content:gt(" + (upper) + ")").hide();
	});
	$("#tweet-pagination a.live-updates").click(function(event)
	{
		event.preventDefault();
		if(!window.twitter_live_mode)
		{
			window.twitter_live_mode = true;
			window.twitter_page = 1;
			$("#tweet-pagination li").removeClass("active");
			$(this).text("Live updates on");
			loadTweets();
		}
	});
	
	// Fancybox 
	$(".iframe").fancybox({ "frameWidth": 630, "frameHeight": 520 }); 
	
	// Hulu
	$("#hulu").fancybox({ "type": "iframe", "frameWidth": 525, "frameHeight": 630 });

	// Ticker
	loadTicker();
	$("#ticker").everyTime(150 * 1000, function(i)
	{
		loadTicker();
	}, 0);
		
	// Tweets
	loadTweets();
	$("#tweets").everyTime(10 * 1000, function(i)
	{
		if(window.twitter_live_mode){ loadTweets(); }
	});
	
});
/* ************************************************************************* */


/* ************************************************************************* */
function loadTicker()
{
	
	var ticker_messages = [
		"Final results&mdash;Doritos wins the BrandBowl!",
		"Mullen would like to thank our partners Radian6 and Hulu, and everyone who participated. We had a blast. We hope you did, too.",
		"And congratulations to the Saints for winning that other Bowl."
	];
	
	html = "";
	$.each(ticker_messages, function(i, item)
	{
		if(i != ticker_messages.length)
		{
			html += "<span>" + item + "</span>";
		}
		else
		{
			html += "<span class=\"last\">" + item + "</span>";
		}
	});
	$("#ticker p").empty().append($(html));
	$("#ticker marquee").trigger("start");
}
/* ************************************************************************* */


/* ************************************************************************** */
function loadTweets()
{	
	var tweets = [
		{ "text": "RT @tsmuse: wow, godaddy is still paying tons of money to put shit on the air. I wish I could get 1/2 that budget for my stuff #sbAds #brandbowl", "from_user": "truckerDesiree", "profile_image_url": "http://a2.twimg.com/profile_images/1098417934/Last_Ride_bigger.jpg" },
		{ "text": "Doritos coffin commercial.  Not good #brandbowl #superbowl44", "from_user": "jamesdalman", "profile_image_url": "http://a3.twimg.com/profile_images/792799327/JD-Pic_bigger.jpg" },
		{ "text": "Dammit Doritos is ROCKING it. #brandbowl", "from_user": "benkunz", "profile_image_url": "http://a0.twimg.com/profile_images/1095408500/benk101_bigger.jpg" },
		{ "text": "RT @agardina Who gets a better value; Pepsi's social campaign or Coke's ads? #44ads #brandbowl #sb44 #fb", "from_user": "dhatfield", "profile_image_url": "http://a0.twimg.com/profile_images/908122948/danielle-avatar-may-2010-101861993_bigger.jpg" },
		{ "text": "Boy, these #Doritos commercials are rather dark! #sb44 #superbowl #brandbowl", "from_user": "mariva", "profile_image_url": "http://a3.twimg.com/profile_images/422611563/flower_bigger.jpg" },
		{ "text": "HAHAHAHA Doritos WIN #brandbowl", "from_user": "kimlw", "profile_image_url": "http://a3.twimg.com/profile_images/1097279871/vegastwitter55_bigger.JPG" },
		{ "text": "OMG -- Doritos -- ROFL Irreverent AND funny #brandbowl", "from_user": "LovelyLu", "profile_image_url": "http://a3.twimg.com/profile_images/502411351/DSC00831b_bigger.JPG" },
		{ "text": "Doritos casket ad in bad taste.  Maybe they have been collaborating with Go Daddy? #SB44 #brandbowl", "from_user": "eileengriffin", "profile_image_url": "http://a1.twimg.com/profile_images/1083104225/c025537a-45e0-427f-9289-96e515f9e431_bigger.jpg" },
		{ "text": "Loved that coke/Simpsons ad! #brandbowl", "from_user": "shalinguyen", "profile_image_url": "http://a0.twimg.com/profile_images/1091343212/shali-newhair_bigger.jpg" },
		{ "text": "YES. FINALLY. Score on the auto tune Bud Light!  Two Thumbs up! #brandbowl", "from_user": "shenanigansMKT", "profile_image_url": "http://a3.twimg.com/profile_images/1088455131/Picture_26_bigger.png" },
		{ "text": "Coke spot.  Clear direction of the brand #brandbowl", "from_user": "slprquattro", "profile_image_url": "http://a3.twimg.com/profile_images/447426599/ellieanddaddy_bigger.jpg" },
		{ "text": "Love Bud Light jumped all over the autotune/T-Pain hype.  Quite funny. // #sbad #brandbowl", "from_user": "keithstoeckeler", "profile_image_url": "http://a1.twimg.com/profile_images/531018745/untitled_bigger.jpg" },
		{ "text": "casket by doritos is my favorite right now.  that was hilarious. #brandbowl #sb44", "from_user": "fabfo", "profile_image_url": "http://a0.twimg.com/profile_images/867043356/prof_bigger.jpg" },
		{ "text": "My kids like the Bud Light commercial, which scares me a little. #brandbowl", "from_user": "lisaashby", "profile_image_url": "http://a0.twimg.com/profile_images/1087292204/P1080483_sm_bigger.jpg" },
		{ "text": "Doritos, Bud Light, I can't figure out if you had two different agencies work your ads or what? #44ads #brandbowl", "from_user": "chershberger", "profile_image_url": "http://a1.twimg.com/profile_images/413842633/chris_bigger.jpg" },
		{ "text": "Won't the #brandbowl reward bad work that gets buzz @edwardboches?", "from_user": "joycekthomas", "profile_image_url": "http://a1.twimg.com/profile_images/698282469/DSCN0528_bigger.jpg" },
		{ "text": "Wonder how many people we could feed & house in #Haiti for the money Doritos & Bud Light are spending to shill this crap? #brandbowl", "from_user": "Jpdaly", "profile_image_url": "http://a2.twimg.com/profile_images/745209282/JPD3_081509_2_bigger.jpg" },
		{ "text": "#brandbowl Budlight, auto-tunes, wrong", "from_user": "whitebookagency", "profile_image_url": "http://a1.twimg.com/profile_images/299816025/nv4_bigger.jpg" },
		{ "text": "Monster has the cute factor going for it. #sbads #brandbowl", "from_user": "TheBeanCast", "profile_image_url": "http://a0.twimg.com/profile_images/115260328/beancast_logo_sm_bigger.jpg" },
		{ "text": "Fiddling beavers?  Oh God, I mean... I think I like it.  He's fiddling. You can't mess up too much with bluegrass. #brandbowl", "from_user": "just_kate", "profile_image_url": "http://a3.twimg.com/profile_images/800258367/Kate_Laughing_Antique_Small_bigger.jpg" },
		{ "text": "Looks like an expensive ad for Coke. I get the story angle but it's too explicit for me #BrandBowl.", "from_user": "LindaSherman", "profile_image_url": "http://a0.twimg.com/profile_images/365863372/linda_in_blue_dress_medium_flickr_bigger.jpg" },
		{ "text": "Auto-tune and T-Pain may have finally just jumped the shark. #brandbowl", "from_user": "scottweisbrod", "profile_image_url": "http://a2.twimg.com/profile_images/930718994/-1_bigger.jpg" },
		{ "text": "Sad RT @mtlb: Because autotune always works with white hipsters. #budlight #sb44 #sbads #brandbowl", "from_user": "cbaccus", "profile_image_url": "http://a2.twimg.com/profile_images/932244986/self_bigger.jpg" },
		{ "text": "why does monster pay for that? #brandbowl", "from_user": "chelle1014", "profile_image_url": "http://a0.twimg.com/profile_images/53506860/bw_bigger.jpg" },
		{ "text": "monster was fun #brandbowl", "from_user": "loxly", "profile_image_url": "http://a3.twimg.com/profile_images/281373119/loxly-4644_bigger.jpg" },
		{ "text": "Doritos winning the #Brandbowl #sb44", "from_user": "Kimbirly", "profile_image_url": "http://a3.twimg.com/profile_images/644265807/twitterProfilePhoto_bigger.jpg" },
		{ "text": "Ad if vocoder & autotune wasn't annoying enough for the past year.  Bud Light = FAIL. #brandbowl", "from_user": "JonBuch", "profile_image_url": "http://a3.twimg.com/profile_images/1089291003/Jwayne_bigger.jpg" },
		{ "text": "Doritos is the new Bud.  Congrats.  If there was a hink of family in your demo, you've killed it. #sb44 #sbads #brandbowl", "from_user": "mtlb", "profile_image_url": "http://a2.twimg.com/profile_images/321718938/As-seen-on-twitter_bigger.gif" },
		{ "text": "GoDaddy = lack of creativity. Ugh. Seriously? #brandbowl", "from_user": "AmberCadabra", "profile_image_url": "http://a3.twimg.com/profile_images/736954571/Amber_March_bigger.jpg" },
		{ "text": "Not a fan of the monster ad #brandbowl", "from_user": "mshahab", "profile_image_url": "http://a3.twimg.com/profile_images/1056826387/mshahab_bigger.jpg" },
		{ "text": "Monster ad makes as much sense as their purchase of HotJobs. #brandbowl #sb44", "from_user": "99GR81", "profile_image_url": "http://a2.twimg.com/profile_images/576548294/SZE_Caricature_2_bigger.jpg" },
		{ "text": "I've always argued that GoDaddy's tactic is probably effective, but that version seemed limp. #brandbowl", "from_user": "jj_magee", "profile_image_url": "http://a2.twimg.com/profile_images/846094330/twitter_bigger.JPG" },
		{ "text": "#brandbowl Go Daddy spot was awful!", "from_user": "jmoore700", "profile_image_url": "http://a3.twimg.com/profile_images/701918679/lo-JohnMoore_2009_v2_bigger.JPG" },
		{ "text": "@chrisbrogan agreed! Thought the violinist beaver was pretty cute though...#brandbowl", "from_user": "gretchen_smith", "profile_image_url": "" },
		{ "text": "My 5yo ranks Monster as best of day...any furry creature wins a child's heart #brandbowl", "from_user": "AshleyMahaffey", "profile_image_url": "http://a3.twimg.com/profile_images/76609879/MyPicture_bigger.jpg" },
		{ "text": "Bud Light autotune commercial had a lot of potential to make fun of autotuners but ended soft. #brandbowl", "from_user": "mdowney", "profile_image_url": "http://a1.twimg.com/profile_images/69812777/mike_downey2_bigger.jpg" },
		{ "text": "@caro__I'm the target gender and I can't stand them. I'm even a GoDaddy cust. #brandbowl", "from_user": "tsudo", "profile_image_url": "http://a2.twimg.com/profile_images/409026294/profilepic1_smaller_bigger.jpg" },
		{ "text": "Dear Monster.com -- just using a Beaver is not funny nor smart #brandbowl #adbowl", "from_user": "GordonPlutsky", "profile_image_url": "http://a3.twimg.com/profile_images/913720051/gordon_smaller_web_bigger.jpg" },
		{ "text": "RT @joeboughner: Please tell me that was auto-tuning jumping the shark #brandbowl", "from_user": "mvolpe", "profile_image_url": "http://a3.twimg.com/profile_images/78485507/mike_volpe_600x600_orange_background_bigger.jpg" },
		{ "text": "RT @ForbesCMO: Someone at Monster's ad agency has been reading 'Mole Music,' about a violin playing critter, to his or her kid. #brandbowl", "from_user": "4GreenPs", "profile_image_url": "http://a3.twimg.com/profile_images/78485507/mike_volpe_600x600_orange_background_bigger.jpg" },
		{ "text": "when all other creative ideas fail you for a superbowl spot, putll out the cute furry animals #brandbowl", "from_user": "marksilva", "profile_image_url": "http://a1.twimg.com/profile_images/372639313/silvasimpson3th_bigger.jpg" },
		{ "text": "bud Light/tpain...the 2010 version of 'whassuuup' #brandbowl", "from_user": "JustDRob", "profile_image_url": "http://a1.twimg.com/profile_images/511589693/_MG_4939_bigger.jpg" },
		{ "text": "@chrisbrogan No, boo auto-tune. Let's get back to making music. #brandbowl", "from_user": "timcourtney", "profile_image_url": "http://a2.twimg.com/profile_images/1097249778/tim-madras-blazer.jpg" },
		{ "text": "Tim Tebow, whiny bitch. #brandbowl /via @AmberCadabra HA! (I'm crying) LOL", "from_user": "libbey", "profile_image_url": "http://a1.twimg.com/profile_images/878097489/image_bigger.jpg" },
		{ "text": "Monster.com ad is my favorite so far #brandbowl", "from_user": "noahyc", "profile_image_url": "http://a1.twimg.com/profile_images/60621537/polar-bear-tongue_bigger.jpeg" },
		{ "text": "Beaver + violin = A+ Monster #brandbowl", "from_user": "CMarzi84", "profile_image_url": "http://a3.twimg.com/profile_images/753087503/me_astronaut_bigger.JPG" },
		{ "text": "@chrisbrogan I think the selection of autotune was timely, but the execution could have been better #brandbowl", "from_user": "fienen", "profile_image_url": "http://a2.twimg.com/profile_images/981270014/twitter_bigger.jpg" },
		{ "text": "'Now THAT was a bachelor party' #brandbowl #sb44", "from_user": "swimmykimy", "profile_image_url": "http://a3.twimg.com/profile_images/115607199/P1010174_bigger.JPG" },
		{ "text": "Free Willy/The Hangover commercial for Bridgestone...TIRES? What? #brandbowl", "from_user": "LauraSK", "profile_image_url": "http://a3.twimg.com/profile_images/728208291/SMicon_bigger.jpg" },
		{ "text": "Doritos 'funeral' was boring.  Dull. Obvious. Monster.com funny, but way too busy.  And beavers? #brandbowl #relevance", "from_user": "tbrunelle", "profile_image_url": "http://a3.twimg.com/profile_images/1045446467/timbrunelle-july2010-sq_bigger.png" },
		{ "text": "Dear Bud Light auto-tune commercial, ned more that a six pack for a party. Just sayin. #brandbowl", "from_user": "tsand", "profile_image_url": "http://a1.twimg.com/profile_images/994659513/half_bigger.jpg" },
		{ "text": "Doritos and bud light commercial suck. Monster cute but predictable. #brandbowl", "from_user": "bugsyph1", "profile_image_url": "http://a1.twimg.com/profile_images/994659513/half_bigger.jpg" },
		{ "text": "Don't worry Bridgestone, I won't attempt that at home. #brandbowl #sb44", "from_user": "fbihop", "profile_image_url": "http://a0.twimg.com/profile_images/65941084/SmallPicture_bigger.jpg" },
		{ "text": "#brandbowl non ad folks love the Monster spot", "from_user": "mjenson", "profile_image_url": "http://a3.twimg.com/profile_images/96192163/TJ_Stores__09_bigger.jpg" },
		{ "text": "Dominos just delivered the pizza in 29 minutes.  Does that qualify for #brandbowl?", "from_user": "lawscomm", "profile_image_url": "http://a2.twimg.com/profile_images/574666482/twitterProfilePhoto_bigger.jpg" },
		{ "text": "YOU COME HARD TO SUPER ADS OR YOU GO HOME. @bradthomas @Lynx_the_one #sbads #sb44 #brandbowl", "from_user": "mtlb", "profile_image_url": "http://a2.twimg.com/profile_images/321718938/As-seen-on-twitter_bigger.gif" },
		{ "text": "Cars.com ad was good. Made me laugh. #brandbowl", "from_user": "mhanson", "profile_image_url": "http://a2.twimg.com/profile_images/46111942/micha_lukas_bigger.jpg" },
		{ "text": "#brandbowl Been years time since the ads were better than the game.  But now, even when the game sucks, it beats the ads.", "from_user": "loebster1", "profile_image_url": "http://s.twimg.com/a/1281028705/images/default_profile_1_bigger.png" },
		{ "text": "Fave so far? RT @LuxeTiffany: Agreed, Bridgestone was bizarre.  RT @chrisbrogan: No go for godaddy.  Coke was soso. #brandbowl", "from_user": "elitetravelgal", "profile_image_url": "http://a1.twimg.com/profile_images/458092369/twitterProfilePhoto_bigger.jpg" },
		{ "text": "@chrisbrogan #brandbowl it got my mom...Me, not so much", "from_user": "smcnary", "profile_image_url": "" },
		{ "text": "Monster Beaver...YES #brandbowl", "from_user": "bobbyp", "profile_image_url": "http://a1.twimg.com/profile_images/365720461/bpshadow_bigger.jpg" },
		{ "text": "Checking out the #brandbowl", "from_user": "nanoserwich", "profile_image_url": "http://a3.twimg.com/profile_images/71533019/100_1749_bigger.jpg" },
		{ "text": "RT @anamariecox: RT @scharpling: I just went to Go Daddy's website.  It was filled with nothing but the sickest pornography imaginable. #brandbowl", "from_user": "Patricialicious", "profile_image_url": "http://a1.twimg.com/profile_images/806032089/twitterProfilePhoto_bigger.jpg" },
		{ "text": "I totally dig how Pepsi chose to spend their dollars on social networking for a better world that superbowl ad http://ow.ly/14Rkm #brandbowl", "from_user": "TiffanyWinman", "profile_image_url": "http://a2.twimg.com/profile_images/698158158/Picture_117_bigger.jpg" },
		{ "text": "#brandbowl one of the only ads that seems to be getting the most positive reaction is the only one that an ad agency didn't create.", "from_user": "brennahanly", "profile_image_url": "http://a1.twimg.com/profile_images/1098436581/twitpic2.jpg" },
		{ "text": "Focus on the family was the most deceptive ad I have ever seen.  Shame on the agency. #brandbowl", "from_user": "TaylorJSnyder", "profile_image_url": "http://a1.twimg.com/profile_images/76616465/bbn538805364_2524446_8923_bigger.jpg" },
		{ "text": "Pepsi Skips Super Bowl TV Advertising for Social Media --Yahoo! News http://bit.ly/9ORVWp (via @SamuelsonsRocks) what do u think? #brandbowl", "from_user": "ronsamuelson", "profile_image_url": "http://a0.twimg.com/profile_images/984084612/ronrockstar_bigger.jpg" },
		{ "text": "#brandbowl puppy in the Budweiser ad was a nice touch", "from_user": "alexpriest", "profile_image_url": "http://a2.twimg.com/profile_images/1087810978/alex2_bigger.png" },
		{ "text": "Once again, LOL @Budweiser commercial.  Great commercial. #brandbowl", "from_user": "pgervais", "profile_image_url": "http://a3.twimg.com/profile_images/314930635/Dirty_Harry_bigger.jpg" },
		{ "text": "Budweiser, YES! #brandbowl", "from_user": "RyanNalepinski", "profile_image_url": "http://a0.twimg.com/profile_images/1080161884/madmen_icon_bigger.jpg" },
		{ "text": "Bud 'bridge' so would happen @FerrisState #brandbowl #collegetown", "from_user": "Mikinzie", "profile_image_url": "http://a3.twimg.com/profile_images/729771223/DSCF3729_2_bigger.jpg" },
		{ "text": "I liked that one too! RT @davidgerzof: #brandbowl best so far is Bud Light Astronomers", "from_user": "LBKinson", "profile_image_url": "http://a2.twimg.com/profile_images/708692818/LAURA_bigger.jpg" },
		{ "text": "#brandbowl This Bud delivery truck thing is SO stupid I can't believe they spent any $ on it at all.  horrible", "from_user": "PortalPocketGal", "profile_image_url": "http://s.twimg.com/a/1281028705/images/default_profile_1_bigger.png" },
		{ "text": "human Bridge was abut 15 seconds to long! #brandbowl", "from_user": "BadBradG", "profile_image_url": "http://a2.twimg.com/profile_images/1076419438/2196d59d8978aa8337433feb6e836eda_bigger.jpeg" },
		{ "text": "#brandbowl: Human bridge a nice diversion.", "from_user": "loebster1", "profile_image_url": "http://s.twimg.com/a/1281028705/images/default_profile_1_bigger.png" },
		{ "text": "Budweiser just drove over a bunch of PEOPLE! Monsters #superbowl #brandbowl", "from_user": "baratunde", "profile_image_url": "http://a2.twimg.com/profile_images/1088013334/mayorthurston200x200_bigger.jpg" },
		{ "text": "Budweiser,  you suck.  #sb44 #brandbowl", "from_user": "jpdaly", "profile_image_url": "http://a2.twimg.com/profile_images/745209282/JPD3_081509_2_bigger.jpg" },
		{ "text": "Bud bridge.  Not bad. #SuperBowl #BrandBowl", "from_user": "Kash_Shaikh", "profile_image_url": "http://a2.twimg.com/profile_images/629839278/kash_bigger.jpg" },
		{ "text": "Ok, Leno and Letterman get points for that commercial. #brandbowl", "from_user": "kevingamin", "profile_image_url": "http://a0.twimg.com/profile_images/67129192/HLt47NjDTaUUCU8LDEWrw9GAwmBs1d90TZnL7RtO3MGjBTUtxd2TjZ7fVr7m75ix_bigger.jpg" },
		{ "text": "Awww CBS cares -- I like the beating heart thing #brandbowl #sb44", "from_user": "carole_hicks", "profile_image_url": "http://s.twimg.com/a/1281028705/images/default_profile_4_bigger.png" },
		{ "text": "Dave Oprah Jay... Simple Genius.", "from_user": "Cubba", "profile_image_url": "http://a3.twimg.com/profile_images/1084569175/P1200267_bigger.JPG" },
		{ "text": "RT@arikhanson: After that promo, I would think CBS is clearly in the lead of #brandbowl. I mean, they did clearly state they were Network of the Decade.", "from_user": "andersonrob", "profile_image_url": "http://a2.twimg.com/profile_images/987928818/mt-si_bigger.jpg" }
	];
	
	$("#tweets").hide();
	
	// Shuffle the tweets
    shuffle = tweets;
    for(
    	var j, x, i = tweets.length; i;
    	j = parseInt(Math.random() * i),
    	x = tweets[--i], tweets[i] = tweets[j], tweets[j] = x
    );
    tweets = shuffle;
    
    // Cut off the list at 20
    tweets = tweets.slice(0,17);
	
	html = "";
	$.each(tweets, function(i, tweet)
	{
		html += getTweetMarkup(tweet);		
	});
	$("#tweets").empty().append($(html)).fadeIn("slow");
	$("#tweets p").autolink();
}
/* ************************************************************************** */


/* ************************************************************************** */
function getTweetMarkup(tweet)
{
	if(tweet.profile_image_url == "")
	{
		tweet.profile_image_url = "http://s.twimg.com/a/1281028705/images/default_profile_5_normal.png";
	}
	
	var html = "<div class=\"tweet-content\">";
	html += "<a href=\"http://twitter.com/" + tweet.from_user + "\" rel=\"external\" class=\"profile-image\"><img src=\"" + tweet.profile_image_url + "\" width=\"48\" height\"48\" alt=\"" + tweet.from_user + "\" /></a>";
	html += "<div class=\"tweet-inner\">";
	html += "<p><a href=\"http://twitter.com/" + tweet.from_user + "\" rel=\"external\">" + tweet.from_user + "</a>";
	html += tweet.text + "</p>";
	html += "</div>";
	html += "</div>";
	
	return html;
}
/* ************************************************************************** */


/* ************************************************************************* */
function trackEvent(url)
{
	if(pageTracker){ pageTracker._trackPageview(url); }
}
/* ************************************************************************* */


/* ************************************************************************* */
jQuery.fn.autolink = function()
{
	return this.each(function()
	{
		var re = /((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g;
		$(this).html($(this).html().replace(re, "<a href=\"$1\" rel=\"external\">$1</a>"));
	});
}
/* ************************************************************************* */

