$(function() {
	
	//アンカーリンク
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		&& location.hostname == this.hostname) {
		  var $target = $(this.hash);
		  $target = $target.length && $target
		  || $('[name=' + this.hash.slice(1) +']');
		  if ($target.length) {
			var targetOffset = $target.offset().top;
			$('html,body').animate({scrollTop: targetOffset}, 'slow','swing');
		   return false;
		  }
		}
	});

	$("#page_nav li a").hover(function(){
		$(this).stop(true,false).fadeTo(100, 0);
		},function(){
		$(this).stop(true,false).fadeTo(100, 1);
	});
	
	//.swap マウスオーバー画像を入れ替え
	var postfix = '_o';
	$('.swap').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.')) + postfix + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(function() {img.attr('src', src_on);},function() {img.attr('src', src);});
	});
	
	//.trans マウスオーバー画像を透過
	$('.trans').each(function() {
		$(this).hover(function(){
			$(this).stop(true,false).fadeTo(100, 0.7);
			},function(){
			$(this).stop(true,false).fadeTo(100, 1);
		});
	});
	
	//フッターリンク
	$('#page_footer .footer_body ul:first-child').addClass('first');
	$('#page_footer .footer_body > ul').flatHeights();

});
