$(document).ready(function() {
						   
	$('#content').wrap('<div id="content-wrapper"></div>');
						   
	function pageload(hash) {
		if(hash) {
			$("#content-wrapper").load(hash + ".html #content",'',function(){
				$('#content-wrapper').show('normal');
				$('#load').fadeOut('normal');												   
			});
		} else {
			$("#content-wrapper").load("index.html #content"); //default
		}
	}
	$.historyInit(pageload);			   

	$('#nav li a').click(function(){
								  
		var hash = $(this).attr('href');
		hash = hash.replace(/^.*#/, '');
		hash = hash.substr(0,hash.length-5);

		$('#content-wrapper').hide('fast',function(){$.historyLoad(hash)});
		$('#load').remove();
		$('#wrapper').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		return false;
		
	});

});
