// ロールオーバー設定
$(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"))
	})
})

// フェードオーバー設定
$(function(){
	$("img.fadeover").hover(function(){
		$(this).fadeTo("normal", 0.5); // マウスオーバーで不透明度を50%にする
	},function(){
		$(this).fadeTo("normal", 1.0); // マウスアウトで不透明度を100%に戻す
	})
})

// Box型インデックス レイアウト設定
$(function(){
	/* 要素を2つずつの組に分ける */
	var sets = [], temp = [];
	$('div.boxIndex div.boxInner').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();
	});
});

// IE未対応擬似クラス設定
$(function() {
	if(!jQuery.support.opacity){
		if(!jQuery.support.style){ // IE6,7 の場合
			$('#footerGlobalNav ul.menuList > li:first-child, #subContent dl.dList > dt:first-child, #siteMapList li.blockL > a:first-child, #siteMapList li.blockR > a:first-child').addClass('first-child');
			$('#sideNav ul.menuList > li.trouble > a, #sideNav ul.menuList > li.treatment > a').addClass('parent');
		}
	}
})

