$(document).ready(function() {
	var pathname = document.URL;
	var toLoad = pathname+' #all_content #section01';
	$('#main_content_block').load(toLoad,'',showNewContent());
	function showNewContent() {
		$('#main_content_block').show('normal');
	}
	var href = $('#tab_menu_list a').each(function(){
		var href = $(this).attr('href');
	});

	$('#tab_menu_list a').click(function(){
		resetLinks();
		
		var toLoad = pathname+' #all_content div'+$(this).attr('href');
		$(this).addClass("current-nav-link");
		
		$('#main_content_block').fadeOut('fast',loadContent);
		
		function loadContent() {
			$('#main_content_block').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#main_content_block').fadeIn('normal',hideLoader());
		}
		function hideLoader() {
		}
		function resetLinks() {
			var parent = document.getElementById("tab_menu_list");
			var childCount = parent.getElementsByTagName("li").length;
			for(var i = 0;i<childCount;i++) {
				var thisLink = "#tab_menu_list #link0" + (i+1) + " a";
				$(thisLink).removeClass("current-nav-link");	
			}
		}
		return false;
		
	});
	

});
