$(document).ready(function() {
						   
	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-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
		}											
	});

	$('#nav li a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').hide('fast',loadContent);
		$('#load').remove();
		$('#container').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent());
			$('#content').load(toLoad,'',animation());
 			//alert(toLoad);
		}
		function showNewContent() {
			$('#content').show('normal',hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		function animation()
		{
			$("#content").animate({ 
					width: "85%",
					height: "477px",
					opacity: 0.9,
					marginLeft: "0.6in",
					fontSize: "1em", 
					borderTopWidth: "8px", 
					borderBottomWidth: "8px", 
					borderLeftWidth: "1px", 
					borderRightWidth: "1px"
					}, 1200 );
		}
		return false;
		
	});

});

 		function closeDisplay(){
 		$("#content").animate({ 
 		width: "0px",
 		height: "0px",
 		opacity: 0,
 		marginLeft: "0in",
 		fontSize: "0em", 
 		borderWidth: "0px"
 		}, 1200 );
 		}