/** 
 * @projectDescription	Theatre JS
 * @author 	Matt Hobbs
 * @version 	0.1 
 */
jQuery(function($){
	if($("#nav").length){
		var $nav = $("#nav");
		$nav.find("li:last").addClass("last");
		var padding = 16;//px
		var totalWidth = 4;//4 pixels for extra room
		$nav.find("li").each(function(){
			var $this = $(this);
			totalWidth += $this.width() + padding;
		});
		$nav.find("ul").css({width: totalWidth - padding});//-padding due to .last having 0 margin
	}
});

/** 
 * @projectDescription	Google Analytics outbound link tracker
 * @author 	Mark Rochefort, Harvest Digital
 */
$(document).ready(function(){
		
	$("a[rel='outbound']").click(function() {	
		$anchor_element = $(this);
		_gaq.push(['_trackPageview', '/virtual/outbound>' + $anchor_element.attr("href")]);
		window.open($anchor_element.attr("href"));
		return false;
	});
});