// コンテンツナビゲーション ホバー設定
$(function() {
	$('.contentNav .sub li,.contentNav .parent').hover(
		function() {
			$(this).addClass('hover');
		},
		function() {
			$(this).removeClass('hover');
		}
	);
});

// カテゴリトップ レイアウト設定
$(function(){
	/* 要素を2つずつの組に分ける */
	var sets = [], temp = [];
	$('.boxIndex > .boxSC322').each(function(i) {
		temp.push(this);
		if (i % 2 == 1) {
			sets.push(temp);
			temp = [];
		}
	});
	if (temp.length) sets.push(temp);
	/* 各組ごとに高さ揃え */
	$.each(sets, function() {
		$(this).flatHeights();
	});
});

// スムーズスクロール 設定

/* 1. jQuery Easing Plugin 追加 */

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Copyright (C) 2008 George McGinley Smith
 * All rights reserved.
*/
jQuery.easing.outExpo = function (x, t, b, c, d) {
	return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
};

/* 2. スムーズスクロールのプラグイン追加 */

/*
 * jQuery SmoothScroll
 *
 * Copyright (C) 2009 Hidemaro Mukai(http://www.maro-z.com).
*/
$(function() {
	var ua = $.browser;
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			$(this).blur();
			var t = navigator.appName.match(/Opera/) ? "html" : "html,body";
			$(t).queue([]).stop();
			var $targetElement = $(this.hash);
			var scrollTo = $targetElement.offset().top;
			if (window.scrollMaxY) {
				var maxScroll = window.scrollMaxY;
			} else {
				var maxScroll = document.documentElement.scrollHeight - document.documentElement.clientHeight;
			}
			if (scrollTo > maxScroll){
				scrollTo = maxScroll;
			}
			$(t).animate({ scrollTop: scrollTo }, 1000, 'outExpo');
			return false;
		}
	});
});

