$(document).ready(function() {
	   
	var hash = window.location.hash.substr(1);

	var href = $('#nav 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 a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		
		$("#nav img").each(function(){
			var cItemImgLink = ($(this).attr("src")).replace(/_on/, '_off');
			$(this).attr({src: cItemImgLink});
		});
		
		cItem = ($(this).attr('href')).replace(/.html/, '')
		
		cItemImgLink = ($("#"+cItem).attr("src")).replace(/_off/, '_on');
		$("#"+cItem).attr({src: cItemImgLink});
		
		$('#content').fadeOut('fast',loadContent);
		$('#load').remove();
		$('#all').append('<span id="load">LOADING CONTENT...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').fadeIn('fast',hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
	});*/

    $(document).pngFix(); 
});
