$(document).ready(function() {

	
	
	function view_content(container, scroll)
	{
		//if(scroll == true) {
			$('html, body').animate({
				scrollTop: $("#navbar").offset().top
			}, 'swing');	
		//}
		
			
		var total_height = $(window).height();
		var min_height = total_height + $("#upper").height();
		$('body').css('min-height', min_height);	
		
		$('.nav-col').addClass('unselected');
		$('#' + container + '-btn').removeClass('unselected');
		
		$("#content").html($("#" + container + "-content").html());
		window.location.hash = container;
	}
	
	if (window.location.hash && document.referrer != window.location) {
		var container = window.location.hash.replace("#", "");
		view_content(container, false);
	}
	
	$('#navbar .nav-col').click(function() {
	    var id = this.id.replace('-btn', '');
		view_content(id, true);
	});
});

