document.write('<script src="/common/js/smartRollover.js" type="text/javascript"></script>');
document.write('<script src="/common/js/jquery.scrollTo.js" type="text/javascript"></script>');
document.write('<script src="/common/js/jquery.tools.min.js" type="text/javascript"></script>');
document.write('<script src="/common/js/footer.js" type="text/javascript"></script>');
var leftMenu = null;
var headerMenu = null;
function mainmenu(){
	/*
	$("#leftNavi ul ul ").css({display: "none"}); // Opera Fix
	$("#leftNavi ul li").hover(
	function(){
		$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
	},function(){
		$(this).find('ul:first').css({visibility:"hidden"});
	});
	
	$("#headerMenu ul ul ").css({display: "none"}); // Opera Fix
	$("#headerMenu ul li").hover(
	function(){
		$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
	},function(){
		$(this).find('ul:first').css({visibility:"hidden"});
	});
	
	//ƒXƒ}ƒtƒH
	if(uaAr|uaIPo||uaIPh||uaIPa){

		$("#leftNavi ul li").toggle(
			function(){
				if( $(this).find('ul:first').get(0) ){
					$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
					return false;
				}
				location.href=$(this).find('a').get(0).href;
			},function(){
				location.href=$(this).find('a').get(0).href;
		});

		$("#headerMenu > ul > li > a").toggle(
		function(){
			$(this).parent().find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
		},function(){
			$('#headerMenu ul ul').css({visibility:"hidden"});
		});
		
		$("#headerMenu ul ul li").toggle(
			function(){
				if( $(this).find('ul:first').get(0) ){
					$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
					return false;
				}
				location.href=$(this).find('a').get(0).href;
			},function(){
				location.href=$(this).find('a').get(0).href;
		});
	}
	*/
		$("#leftNavi ul li").click(
			function(e){
				if( leftMenu ){
					if( leftMenu.get(0) == $(this).get(0) ){
						leftMenu=null;
						$(this).find('ul:first').slideUp();
						return false;
					}
				}
				var flg= 0;
				$(this).parent().parent().find("ul li").each(function(e){
						$(this).find('ul:first').slideUp();
				});
			
				if( $(this).find('ul:first').get(0) ){
					$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
					leftMenu = $(this);
					return false;
				}
				window.open($(this).find('a').get(0).href, ($(this).find('a').attr("target"))?$(this).find('a').attr("target"):"_top");
				return false;
				//location.href=$(this).find('a').get(0).href;
			});

		$("#headerMenu > ul > li > a").toggle(
		function(){
			$(this).parent().find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
		},function(){
				$(this).parent().find('ul:first').slideUp();
		});
		
		$("#headerMenu ul ul li").click(
			function(){
				if( headerMenu ){
					if( headerMenu.get(0) == $(this).get(0) ){
						headerMenu=null;
						$(this).find('ul:first').slideUp();
						return false;
					}
				}
				var flg= 0;
					$(this).parent().parent().find("ul li").each(function(e){
							$(this).find('ul:first').slideUp();
					});
				
				if( $(this).find('ul:first').get(0) ){
					$(this).find('ul:first').css({visibility:"visible",display:"none"}).slideDown();
					headerMenu = $(this);
					return false;
				}
				if( $(this).find('a').length == 1 ){
					window.open($(this).find('a').get(0).href, ($(this).find('a').attr("target"))?$(this).find('a').attr("target"):"_top");
					return false;
				}
				//location.href=$(this).find('a').get(0).href;
		});
}
$().ready(mainmenu);
$().ready(face);
function face(){
	$('a[rel*=facebox]').facebox();
	$('a[rel*=map],area[rel*=map]').each(function(){
		$(this).click(function(){$.facebox('<iframe src="'+this.href+'" width="100%" height="500" id="map_iframe" frameborder="0" scrolling="no"></iframe>'); $('#map_iframe').iframeAutoHeight();return false;});
	}														
	);
}
