$(document).ready(function() {						   
	var hash = window.location.hash.substr(1);
	var href = $('../').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
			
		}											
	});

	$('.title h2 a, .title h1 a, .postmetadata a, .title h3 a, .metpost a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').hide(0,loadContent);
		$('#load').remove();
	  $('#header').append('<span id="load">Загрузка данных...</span>');  
		$('#load').show(200);
		window.location.hash = $(this).attr('href').substr(0,attr('href').length-0);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').show(3000,hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut(500);		}
		return false;		
	});
		$("a[id^='sc']").click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').hide(0,loadContent);
		$('#load').remove();
	  $('#header').append('<span id="load">Загрузка данных...</span>');  
		$('#load').show(200);
		window.location.hash = $(this).attr('href').substr(0,attr('href').length-0);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').show(3000,hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut(500);		}
		return false;		
	});
});