$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('#link div a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length)){
			var toLoad = hash+'#content';
			$('#content').load(toLoad)
		}											
	});

	$('#link div a').click(function(){
								  
		var toLoad = $(this).attr('href')+'#content';
		$('#content').hide('normal',loadContent);
		$('#load').remove();
		$('#wrapper').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').show('slow',hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});

});