// jQuery Easing Plugin をセット
jQuery.easing.outExpo = function (x, t, b, c, d) {
     return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
};

$(function(){

//ロールオーバー設定
	var current = '_on';
	$("img.rollover").not('[src*="'+ current +'."]').mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	});

// スムーズスクロール設定
/*
 * jQuery SmoothScroll
 *
 * Copyright (C) 2009 Hidemaro Mukai(http://www.maro-z.com).
*/
	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 }, 500, 'outExpo');// Easing Plugin 指定
			return false;
		}
	});

// Box 型 インデックス設定
	$('div.boxIndex > div.cBox:nth-child(odd)').css('clear', 'left');

// 奇数子要素に class 追加
	$('table.typeHS tr:even,#questionIndex dd:even').addClass('even');

// IE6,7 のみに適用させる設定
	if(!jQuery.support.opacity){
		if(!jQuery.support.style){
		//IE6 and IE7
			//Before content
			$('ul.nml > li,dl.nml > dt').prepend('●');
		}
		if(typeof document.documentElement.style.maxHeight == "undefined") {
		//IE6 Onry
			//first-child
			$('dl.jobSummaryList > dt:first-child,div.contentNav ul.menu > li:first-child,.col2-fL .colR > p:first-child,.col2-fR .colR > p:first-child').addClass('first-child');
			//Adjacent sibling selectors
			$('.ttl-typeA + div.section,.ttl-typeB + div.section').addClass('section-adj');
		}
	}

});

