// 画像設定 -------------------------------------------------------------------------------
// プルダウンメニュー

//var _base_pattern = "^\/yaesuhall\/";
var _base_pattern = "^\/";
var _nav_menu = {
"top" : 
	{
		"path_pattern" : "$",
		"on" : template_url + "/image/button_top_ora.png", 
		"off": template_url + "/image/button_top.png"
	},
	"detail" :
	{
		"path_pattern" : "halldetail\/",
		"on" : template_url + "/image/button_detail_ora.png", 
		"off": template_url + "/image/button_detail.png"
	},
	"fare" :
	{
		"path_pattern" : "price\/",
		"on" : template_url + "/image/button_fare_ora.png", 
		"off": template_url + "/image/button_fare.png"
	},
	"reservation" :
	{
		"path_pattern" : "reservation\/",
		"on" : template_url + "/image/button_reservation_ora.png", 
		"off": template_url + "/image/button_reservation.png"
	},
	"guide" :
	{
		"path_pattern" : "guide\/",
		"on" : template_url + "/image/button_guide_ora.png", 
		"off": template_url + "/image/button_guide.png"
	},
	"access" :
	{
		"path_pattern" : "accessmap\/",
		"on" : template_url + "/image/button_access_ora.png", 
		"off": template_url + "/image/button_access.png"
	},
	"faq" :
	{
		"path_pattern" : "faq\/",
		"on" : template_url + "/image/button_faq_ora.png", 
		"off": template_url + "/image/button_faq.png"
	}
};

//スライドショー

/*var sampleImageFileNames = [
	"/image/n-act_top.png",
	"/image/jisseki_cosmos.png",
	"/image/jisseki_venus.png",
	"/image/jisseki_bda.png",
	"/image/f-sec_top.png",
	"/image/katana_top.png",
	"/image/foz_tuhan_top.png",
	"/image/china_tea.png"];
*/
// 先読み画像格納先
var preloads = [];


// ページ初期化処理 -------------------------------------------------------------------------
//$(document).ready(function(){
jQuery(document).ready(function(){
	//alert(window.location.pathname);
	// マウスオーバー時アニメーション設定の初期化
	jQuery(".nav")
	.superfish({
		animation : { opacity:"show",height:"show", delay:"0", speed:"fast"}
	})
	.find(">li:has(ul)")
		.mouseover(function(){
//			jQuery("ul",this).bgIframe({opacity:false});
	
		})
		.find("a")
			.focus(function(){

//		jQuery("ul",jQuery(".nav>li:has(ul)")).jQuery({opacity:false});
		jQuery("ul",jQuery(".nav>li:has(ul)")).bgIframe({opacity:false});
			});
	
	// プルダウンメニュー画像の初期化
	for(var id in _nav_menu)
	{
		//alert(id + ":" + _nav_menu[id].on);
		var selector  = "#" + id;
		var defaultStatus =  "off";
		if(window.location.pathname.match(new RegExp(_base_pattern + _nav_menu[id].path_pattern))) {
			//defaultStatus =  "on";
			jQuery(selector + "> img").attr({ src: _nav_menu[id].on });
		} else {
			jQuery(selector + "> img").attr({ src: _nav_menu[id].off });
			jQuery(selector)
				.hover(
					function() {
						jQuery("img", this).attr({ src: _nav_menu[this.id].on });
					},
					function() {
						jQuery("img", this).attr({ src: _nav_menu[this.id].off });
					}
				);

		}

		var image = new Image();
		image.src = eval("_nav_menu."+id+".on");
		preloads.push(image);
	};
	
	// スライドショー画像先読み
/*	for(var id in sampleImageFileNames)
	{
		var image = new Image();
		image.src = sampleImageFileNames[id];
		preloads.push(image);
	}
*/
});

