$(function(){
	$(".mega_area").hover(
		function () {
			$('.mega_menu').show("fast");
		},
		function () {
			$('.mega_menu').hide("slow");
		}
	);
})

$(function(){
	$(".top_area1_box1").hover(function(){
		$(this).addClass("hover1a");
	},function(){
		$(this).removeClass("hover1a");
	})
	
	$(".top_area1_box2").hover(function(){
		$(this).addClass("hover1b");
	},function(){
		$(this).removeClass("hover1b");
	})
	
	$(".top_area1_box3").hover(function(){
		$(this).addClass("hover1c");
	},function(){
		$(this).removeClass("hover1c");
	})
	
	$(".top_area1_box4").hover(function(){
		$(this).addClass("hover1d");
	},function(){
		$(this).removeClass("hover1d");
	})
	
	$(".top_area1_box1").hover(function(){
		$(".top_area1_box1 .top_area1_boxtitle").addClass("hover2a");
	},function(){
		$(".top_area1_box1 .top_area1_boxtitle").removeClass("hover2a");
	})
	
	$(".top_area1_box2").hover(function(){
		$(".top_area1_box2 .top_area1_boxtitle").addClass("hover2b");
	},function(){
		$(".top_area1_box2 .top_area1_boxtitle").removeClass("hover2b");
	})
	
	$(".top_area1_box3").hover(function(){
		$(".top_area1_box3 .top_area1_boxtitle").addClass("hover2c");
	},function(){
		$(".top_area1_box3 .top_area1_boxtitle").removeClass("hover2c");
	})
	
	$(".top_area1_box4").hover(function(){
		$(".top_area1_box4 .top_area1_boxtitle").addClass("hover2d");
	},function(){
		$(".top_area1_box4 .top_area1_boxtitle").removeClass("hover2d");
	})
})

$(function(){
	$('.gnavi2_ a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-64px -72px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-40px 0)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0"})
			}})
		})
});

jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
};
 
// Usage
$.preloadImages("./images/top/top_area1back1s.gif", "./images/top/top_area1back2s.gif", "./images/top/top_area1back3s.gif", "./images/top/top_area1back4s.gif", "./images/top/top_area1lead1s.jpg", "./images/top/top_area1lead2s.jpg", "./images/top/top_area1lead3s.jpg", "./images/top/top_area1lead4s.jpg");
