$(document).ready(function() {
						
	
	var hash = window.location.hash.substr(1);
	var href = $('#menu li a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
		}											
	});
	
	$(".logo").fadeIn(3000);
	$("#content").fadeOut(0);
	$("#content").fadeIn(1000);
	$("#footer").fadeIn(1500);
	$("#menuWrap").animate({opacity: "0"}, 0)
	$("#menuWrap").animate({opacity: "1", left: "0"}, 1200)

	$('#menu li a').click(function(){
		$('#loading').fadeIn();
		var addClass = $(this).attr('class');						  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').fadeOut('normal',loadContent);
		$('#menu li').removeClass("current");
		$('#menu li.' + addClass).addClass("current");
		window.location.hash = $(this).attr('class');
		function loadContent() {
			$('#content').load(toLoad, function() {
				$('#content').fadeIn('normal');
				$('#loading').fadeOut('fast');
			});
		}
		
		return false;
		
	});

});
