/* *********************
	change box
	2009/9/25
	
	要jQuery
*********************** */

$(function(){

	// 1番め以外のボックスを全て隠す
	$("#map-main div:gt(0)").hide();
	
	// ナビゲーションのボタンをクリックしたときの動作
	$("#mapnav li a").click(function(){
		
		// ボタンのアクティブ状態のクラスを削除
		$("#mapnav li > a").each(function(){
			$(this).removeClass("nav-on");
		});
		
		// 表示されているボックスを全て削除
		$("#map-main div").hide();
		
		
		// クリックしたボタンのaタグから表示したいボックスのIDを取得し、表示させる
		var showBoxId = "#" + $(this).attr("title");
		$(showBoxId).show();
		
		
		// ナビゲーションをアクティブに設定
		$(this).addClass("nav-on");
	});
	
	
	// map00のボックス内にあるリンクをクリックしたときの動作
	$("#map00 li > a").click(function(){
		
		// リンクが何番めかを取得（メインナビゲーションのボタンをアクティブにするときに使う）
		var linkIndex = $("#map00 li a").index(this);
								
		$("#mapnav li > a").each(function(){
			$(this).removeClass("nav-on");
		});
								  
		$("#map-main div").hide();
		
		var showBoxId = "#" + $(this).attr("title");
		$(showBoxId).show();
		
		// メインのナビゲーションの該当するリンクをアクティブに設定
		$("#mapnav li > a").eq(linkIndex).addClass("nav-on");
	});
	
	// べつのところに設置されているボタン（map00を表示）用
	
	$(".btn-all a").click(function(){
								   
		$("#mapnav li > a").each(function(){
			$(this).removeClass("nav-on");
		});
								  
		$("#map-main div").hide();
		
		var showAllId = "#" + $(this).attr("title");
		$(showAllId).show();
	
	
	});
	



});