	/* メニューリスト */
	$(function() {
		$("#menuList li").click(function() {
			$("#menuList li").removeClass("menuCurrent");
			$(this).addClass("menuCurrent");
		});    
	});

	$(function(){
		$('#gmenu #menuList .subMenu .menu').mouseover(function(){
			var src = $(this).find('img').attr('src');
			var src_on = src.replace('.gif.','_on.gif');
			$(this).find('img').attr('src', src_on);
		});
		$('#gmenu #menuList .subMenu .menu').mouseout(function(){
			var src_on = $(this).find('img').attr('src');
			var src = src_on.replace('_on.gif','.gif');
			$(this).find('img').attr('src', src);
		});
	});


	/* メインイメージスライド */
	var timeOut = 6000;
	var t;
	$(function() {
		t = setTimeout('timedCount()', timeOut);
		$('#gallery li').hover(
			function() { // over
			clearTimeout(t);
			},
		function() { // out
			t = setTimeout('timedCount()', timeOut);
		});
	});
	
	function timedCount() {
		var $nextImage;
		$('#gallery li').each(function(i) {
			if ($(this).hasClass('current')) {
				$(this).removeClass();
				$nextImage = $(this).next();
				if ($nextImage.length == 0) {
					$nextImage = $('#gallery li:first');
				}
			}
		});
		$nextImage.addClass('current');
		t = setTimeout('timedCount()', timeOut);
	};

	/* ニュースエリア */
	$(function(){
		var src = "img/top/navi_news.gif";
		var src_on = "img/top/navi_news_on.gif";
		$("#news").mouseover(function(){
			this.style.backgroundColor = "#09265B";
			//this.style.color = "#FFFFFF";
			this.style.color = "#F7F700";
			$(this).find("img").attr('src', src_on);
			$(this).find(".newsCon a").css({'color':"#F7F700"});
		});
		$("#news").mouseout(function(){
			this.style.backgroundColor = "white";
			//this.style.color = "#09265B";
			this.style.color = "#009300";
			$(this).find("img").attr('src', src);
			$(this).find(".newsCon a").css({'color':"#009300"});
		});
		
	});




	/*　バナー　ツールチップ*/
	$(function() {
		//Select all anchor tag with rel set to tooltip
		$('a[rel=tooltip]').mouseover(function(e) {
		
		//Grab the title attribute's value and assign it to a variable
		var tip = $(this).attr('title');    
		
		//Remove the title attribute's to avoid the native tooltip from the browser
		$(this).attr('title','');
		
		//Append the tooltip template and its value
		$(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');        
		
		//Show the tooltip with faceIn effect
		$('#tooltip').fadeIn('500');
		$('#tooltip').fadeTo('10',0.9);
		
		}).mousemove(function(e) {
		//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse
		$('#tooltip').css('top', e.pageY - 110 );
		$('#tooltip').css('left', e.pageX + 10 );
		
		}).mouseout(function() {
		//Put back the title attribute's value
		$(this).attr('title',$('.tipBody').html());
		//Remove the appended tooltip template
		$(this).children('div#tooltip').remove();
		
		});
	});

