var curr_menu="home";


$(document).ready(function(){
	$.historyInit(showPage, "jquery_history.html");
	$("a[rel='history']").click(function(){
		var hash = this.href;
		hash = hash.replace(/^.*#/, '');
		$.historyLoad(hash);
		return false;
	});
});


function showPage(p) {
	$("li").removeClass();
	$("a").removeClass();
	$("#menu_"+p).addClass("act");
	$("#menu_"+p).parent().addClass("act");
	if(p!="home"){
		$("#home_footer").hide();
		$("#bottom_home").hide();
		$("#bottom").show();
		$("#MME").show();
	}
	else {
		$("#home_footer").show();
		$("#bottom_home").show();
		$("#bottom").hide();
		$("#MME").hide();
	}
	if(curr_menu!="home"){
		$("#"+curr_menu).fadeOut(500,function(){
			$("#"+p).fadeIn(900);
		});
	}
	else {
		$("#"+curr_menu).slideUp(function(){
			$("#"+p).slideDown();
		});
	}
	curr_menu=p;
}

