$(function () {
	height = 0;
	$("#content").css("position", "relative");
	$("#home, #about, #contact").css({position:'absolute', top:'0',left:'0'});
	$("#home, #about, #contact").each (function () {
		height = $(this).height() > height ? $(this).height() : height;
	});	
	$("#footer").css({position:'absolute', top:height, left:0});
	if (location.hash && $(location.hash).length)
	{
		$("#home, #about, #contact").not(location.hash).hide();
		$("#navigation #nav-" + location.hash.slice(1)).addClass("active");
	}
	else
	{
		$("#navigation #nav-home").addClass("active");
		$("#about, #contact").hide();
	}
	$("#navigation a").click (function () {
		elem = $(this).attr("href");
		$(this).parent().siblings().removeClass("active");
		$(this).parent().addClass("active");
		$("#container div:not("+elem+",#footer)").fadeOut();
		$(elem).fadeIn();
	});
});

// slightly modified Google Analytics JS to track hashes as page views
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {var pageTracker = _gat._getTracker("UA-2513896-5");pageTracker._trackPageview();
if (pageTracker){$("#navigation a").click (function (){try{pageTracker._trackPageview($(this).attr("href").slice(1));}catch (err) {}});}
} catch(err) {}

