$(function(){
	// Auto highlight subnav based on Body Class matching subnav a class
	$("#secondaryNav a."+$("body").attr("class")).addClass("active");
	
	// Handle off-site links properly
	$('#content a, #inside a').filter(function() {
		var theHref = this;
		if (theHref.hostname && theHref.hostname !== location.hostname) {
			$(theHref).not(".noAutoIcon").addClass("offSite");
			$(theHref).not(".noAutoLink").attr("target","_none").bind('click keypress', function(event) {
				var code=event.charCode || event.keyCode;
				if (!code || (code && code == 13)) {
					var fixedLink = this.href;
					_gaq.push(['_trackEvent','Links','Outbound',fixedLink]);
				};
			});
		};
	});
	
	// Fix for Chrome for Windows behaving badly
	if ((navigator.userAgent.toLowerCase().match('chrome')!=null) && (navigator.userAgent.toLowerCase().match('windows')!=null)) {$("body").addClass("chromeWin");};
});
