/* ===================================================================
JS information

 script info :共通スクリプト（ Use jQuery ）
 
 *Since: 2010-06-17
=================================================================== */

$(function() {


	// グローバルナビ現在地の表示
	$("#gnv li a").each(function(){
		var link = $(this).attr("href").split("/");
		var firstId = $("div:first").attr("id");
		if ( link[1] == firstId) {
			$(this).children("img").css({opacity:0.3}).removeClass("fade").unwrap();
		};
	});	


	// 透明度の変更
	$("img.fade, input.fade").hover(function() {
		$(this).css({opacity:0.7});
	}, function() {
		$(this).css({opacity:1});
	});


	// ページの先頭へ
	$("#btnPagetop01 a").click( function() {
		scrollTo(0,0)
		return false;
	});
	$("#btnPagetop02 a").click( function() {
		scrollTo(0,0)
		return false;
	});


	// ブログ定義リストclass
	if (document.getElementById("blog")) {
		$("#blog #contents dl:nth-child(even)").addClass("even");
		$("#blog #contents dl:nth-child(odd)").addClass("odd");
	};


	// 高さ揃え
	if (document.getElementById("customer")) {
		var sets = [], temp = [];
		$("#customer .repair").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(); });
	};

});
