$(function(){
	
	var winWidth = 620;
	var winHeight;
	
	//園内マップ　ライトウィンドウ（高さ：400px）	
	chgWinHeight();
	window.onresize = chgWinHeight;
	
	function chgWinHeight(){
		winHeight = 300;
		$('a.maplink').each(function(i){
			var $href = $(this).attr('href');
			$href.match(/map\/([^/.]+)\.html/);
			if(RegExp.$1 != ""){
				var $class = RegExp.$1;
				$(this).attr('href', $href + '?TB_iframe=true&width='+ winWidth +'&height='+ winHeight);
				$(this).addClass($class);
				$(this).addClass('thickbox');
			}
		});
	}
	
	//園内マップ　ライトウィンドウ「朱雀の庭・いのちの森」（高さ：フリー）	
	chgWinHeight02();
	window.onresize = chgWinHeight02;
	
	function chgWinHeight02(){
		winHeight = 400;
		$('a.maplink02').each(function(i){
			var $href = $(this).attr('href');
			$href.match(/map\/([^/.]+)\.html/);
			if(RegExp.$1 != ""){
				var $class = RegExp.$1;
				$(this).attr('href', $href + '?TB_iframe=true&width='+ winWidth +'&height='+ winHeight);
				$(this).addClass($class);
				$(this).addClass('thickbox');
			}
		});
	}
	

	
	
	thinkBoxInit();
	
	//document.location.search.match(/[?&]article=([^&]+)/);
	//$article = RegExp.$1;
	//$("a." + $article).triggerHandler('click');
	
});


$(document).ready(function(){
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
				var $target = $(this.hash);
				$target = $target.length && $target
				|| $('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body')
				.animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});
});

