//SMDE@komura.Yukihiro need jQuery1.5.1
var _selfSrc01 = document.getElementsByTagName("script");
var _selfSrc02 = _selfSrc01[_selfSrc01.length-1].src;
var _selfSrc03 = _selfSrc02.slice(0, _selfSrc02.lastIndexOf("/") + -2);
var _nav = navigator.userAgent.toUpperCase();
var _IEchk = false;

/* ++++++++++++++++++++++++++++++++++++++++++++++
 +											
 +   ブラウザをチェックし、ルビcssを配置・調整する
 +
 ++++++++++++++++++++++++++++++++++++++++++++++ */
if(_nav.indexOf('FIREFOX') >= 0){
	document.write('\
		<style>\
		ruby {\
		  display:inline-table !important;\
		  text-align:center !important;\
		  white-space:nowrap !important;\
		  text-indent:0 !important;\
		  margin:0 !important;\
		  vertical-align:1.06em !important;\
		  font-family:"メイリオ", Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;\
		}\
		ruby>rb,ruby>rbc {\
		  display:table-row-group !important;\
		  line-height:130% !important;\
		  font-weight:bold !important;\
		  letter-spacing:0px !important;\
		}\
		ruby>rt,ruby>rbc+rtc {\
		  display:table-header-group !important;\
		  font-size:70% !important;\
		  line-height:80% !important;\
		  letter-spacing:0 !important;\
		}\
		rp {\
		  display:none !important;\
		}\
		</style>\
	');
}
else if(_nav.indexOf('CHROME') >= 0){
	document.write('\
	<style>\
		rt {\
			font-size:80%;\
			letter-spacing:0px;\
		}\
		#menuInfo ul li a, #menuBooth ul li a, #menuGoods ul li a, #menuStage ul li a {\
			padding-top:20px;\
		}\
		#mainMenus ul li.noruby a { padding-top:10px !important; }\
	</style>\
	');
}
/*
else if(_nav.indexOf('MSIE 6') >= 0 || _nav.indexOf('MSIE 7') >= 0){
	_IEchk = true;
}
*/

(function($) {
$(document).ready(function(){	
/* ++++++++++++++++++++++++++++++++++++++++++++++
 +											
 +   メニュー制御
 +
 ++++++++++++++++++++++++++++++++++++++++++++++ */

// 初期設定--------------------------------------------
	var _setMenusUL = $('#mainMenus li').find('ul');
	$.each( _setMenusUL, function() {
			$(this).find('li:last-child').css('padding-bottom','30px');
			$(this).attr('rel',-($(this).height()-4));
			$(this).find('li:first-child').css('margin-top','-' + ($(this).height()-4) + 'px');
			$(this).fadeIn("fast");
	});

// オンマウスで表示・非表示（簡易ver)
    $("#mainMenus li").hover(function(){
        $(this).addClass("hover");
		//$('ul:first li:first',this).css('marginTop','0');
		$('ul:first li:first:animated',this).stop();
		$('ul:first li:first:not(:animated)',this).animate({marginTop:0},300);
    }, function(){
        $(this).removeClass("hover");
		//$('ul:first li:first',this).css('marginTop',Number($('ul:first',this).attr('rel')));
		$('ul:first li:first:animated',this).stop();
		$('ul:first li:first:not(:animated)',this).animate({marginTop:$('ul:first',this).attr('rel')},300);
    });

	
});
})(jQuery);


