jQuery.noConflict();

(function($){//BEGIN jQuery
$(function(){//BEGIN jQuery.ready()
	
	/*main, side*/
	$main = $("#mainContents");
	$side = $("#sidebar");
	
	
	
	/*gNav*/
	$("#gNavList")
		.pageInit({
			".shop-index": 	"> li:eq(0)",
			".shop-info": 	"> li:eq(1)",
			".shop-blog": 	"> li:eq(2)",
			".shop-dvd": 	"> li:eq(3)",
			".shop-online": "> li:eq(4)",
			".shop-comic": 	"> li:eq(5)"
		}, function(){
			$(this).addClass("active");
		})
		.chimg({autoActive:true});
	
	
	
	/*toPageTop*/
	$("div.toPageTop a", $main)
		.click(function(){
			$("html,body").animate({
				scrollTop: 0
			}, 500);
			return false;
		});
	
	
	
	/*topicsTbl*/
	$("table.topicsTbl")
		.alternate();
	
	
	
	/* # トップページ
	 ****************************************/
	
	/*ニュースタブ*/
	$("#indexNewsBox")
		.each(function(){
			var $newsBox = $(this);
			var $tabs = $newsBox.find("div.indexNewsTabs:eq(0) li a");
			var $contents = $newsBox.find("div.contentsBox");
			
			$tabs
				.each(function(){
					var $tab = $(this);
					var target = $tab.attr("href");
					
					$tab
						.click(function(){
							if($(target).is(":visible")) return false;
							$contents.toggle();
							return false;
						});
				});
		});
	
	
	
	/* # 店舗紹介
	 ****************************************/
	
	/*店内マップ*/
	$("#zoomSeats")
		.each(function(){
			var $link = $(this);
			var src = this.href;
			var img = new Image;
				img.src = src;
			var $img = $(img).css({
					position: "absolute",
					top:0,
					left:0,
					display: "none",
					zIndex: 10
				});
			var $body = $("body");
			
			var animateSpeed = 700;
			
			var documentSize = function(){
				return {
					width: $.pageSize()[0],
					height: $.pageSize()[1]
				}
			};
			
			//overlay
			$overlay = $('<div id="zoomOverlay"></div>')
				.css({
					display:			"none",
					position:			"absolute",
					top:				0,
					left:				0,
					backgroundColor:	"#000000",
					opacity:			0.8,
					zIndex:				1
				})
			
			var toggleOverlay = function(){
				$overlay
					[$overlay.is(":visible") ? "fadeOut" : "fadeIn"](animateSpeed);
				$img[$img.is(":visible") ? "fadeOut" : "fadeIn"](animateSpeed);
			};
			
			
			//init
			$body
				.append($overlay)
				.append($img);
			$overlay
				.css(documentSize())
				.click(toggleOverlay);
			$img
				.click(toggleOverlay);
			$link
				.click(function(){
					var pageSize = $.pageSize();
					$img
						.css({
							top: ((pageSize[3] - img.height) / 2) + $.scrollPos().top,
							left: (pageSize[2] - img.width) / 2
						})
					toggleOverlay();
					return false;
				});
			$(window)
				.resize(function(){
					$overlay.css(documentSize());
					var pageSize = $.pageSize();
					$img
						.css({
							top: ((pageSize[3] - img.height) / 2) + $.scrollPos().top,
							left: (pageSize[2] - img.width) / 2
						})
				});
		});
	
	
	
	
	
});//END jQuery.ready()
})(jQuery);//END jQuery



