
$(document).ready(function() {
	
	timest();
						   
	var hash = window.location.hash.substr(1);
	var href = $('#nav li a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-4)){
			var toLoad = hash+'.php #content';
			$('#content').load(toLoad)
		}											
	});

	$('#nav li a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';

		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}

		function showNewContent() {
			$('#content').fadeIn(1500);
		}

		$('#content').fadeOut(500,loadContent);
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4);
		return false;
		
	});

});

