/**
 * @name main.js
 * @fileOverview
 * @version 1.0
 * @description
 * <p>(c) FOURDIGIT Inc. Licensed <a href="http://ja.wikipedia.org/wiki/GNU_General_Public_License">GNU General Public License</a>.</p>
 */
//他ライブラリと共存する場合、下の一行削除($無効化)
//jQuery.noConflict();
(function($){
	var config = function () {
	//bodyのクラスにブラウザ情報を追加
		$.addClassUA();
	//easyOverのターゲット設定
		$("img.ahover, .ahoverArea img").easyOver();
	//IE5,6にてPNG有効化 (pngfixの読み込みが必要)
		$("img[src$=png],p.png").enablePNG();
	//Flash
		//$("object, embed").enableFlash();
	//ポップアップリンクに置換
		$(".commonPop").easyPop();
	//他ドメインリンク時にpageTracker有効化
		//$("a,area").blankLogToGoogle();
	//アンカーリンクをスムージング
		$("a[href^=#]").smoothScroll();
	//対象の要素をスクロールに追従するようにする
		//$("#fixBox").fixPosition("stopperID","normal");
	}

	//onload 追記
	$(function() {
		config();
		switch (jQuery("body").attr("id")) {
			case "pageID":
				//eachPageFunction
			break;
		}
	});

})(jQuery);

function tabImg(i,n){
	if(i == 1) {
		$("#bigImg01").attr("src" , "imgs/img-0"+ n +"-b.jpg");
		for(var j=1;j<=4;j++){
			$(".tab1-"+ j).children("a").children("img").attr("src" , "imgs/img-0"+ j +"-s.jpg");
		}
		$(".tab1-"+ n).children("a").children("img").attr("src" , "imgs/img-0"+ n +"-s-ov.jpg");
	}
	
	if(i == 2) {
		$("#bigImg02").attr("src" , "imgs/img2-0"+ n +"-b.jpg");
		for(var j=1;j<=4;j++){
			$(".tab2-"+ j).children("a").children("img").attr("src" , "imgs/img2-0"+ j +"-s.jpg");
		}
		$(".tab2-"+ n).children("a").children("img").attr("src" , "imgs/img2-0"+ n +"-s-ov.jpg");
	}
}

$().ready(function(){
	$(".request input,.request textarea,.request select").focus(function(){
		$(this).parent("td").css("background","#EAEBEE");
		$(this).parent("td").parent("tr").children("th").css("background","#DFE0E3");
	});
	
	$(".request input,.request textarea,.request select").blur(function(){
		$(this).parent("td").css("background","#fff");
		$(this).parent("td").parent("tr").children("th").css("background","#F3F3F3");
	});
});

$().ready(function(){
	$(".navLink li").each(function(i){
		$(this).click(function(){
			$(".news").hide();
			$(".news").eq(i).show();
			$(".snavLink li").removeClass("on");
			$(".snavLink li").eq(i).addClass("on");
			$(".navLink li").removeClass("on");
			$(this).addClass("on");
		});
	});
});

$().ready(function(){
	$(".navLink2 li").each(function(i){
		$(this).click(function(){
			$(".news2").hide();
			$(".news2").eq(i).show();
			$(".snavLink2 li").removeClass("on");
			$(".snavLink2 li").eq(i).addClass("on");
			$(".navLink2 li").removeClass("on");
			$(this).addClass("on");
		});
	});
});

$().ready(function(){
	$(".snavLink li").each(function(i){
		$(this).click(function(){
			$(".news").hide();
			$(".news").eq(i).show();
			$(".navLink li").removeClass("on");
			$(".navLink li").eq(i).addClass("on");
			$(".snavLink li").removeClass("on");
			$(this).addClass("on");
		});
	});
});

$().ready(function(){
	$(".example01 li").each(function(i){
		$(this).click(function(){	
			if(i%2 == 1){
				$(".bigImg01 .ico").attr("src" , "imgs/blt-01.gif");
				$(".bigImg01 .ico").attr("alt" , "Before");
			} else {
				$(".bigImg01 .ico").attr("src" , "imgs/blt-02.gif");
				$(".bigImg01 .ico").attr("alt" , "After");
			}
			$("#bigImg01").attr("src" , "imgs/img-0"+ (i+1) +"-b.jpg");
			$(".example01 li").removeClass("on");
			$(this).addClass("on");
		});
	});
});

$().ready(function(){
	$(".example02 li").each(function(i){
		$(this).click(function(){
			if(i%2 == 1){
				$(".bigImg02 .ico").attr("src" , "imgs/blt-01.gif");
				$(".bigImg02 .ico").attr("alt" , "Before");
			} else {
				$(".bigImg02 .ico").attr("src" , "imgs/blt-02.gif");
				$(".bigImg02 .ico").attr("alt" , "After");
			}
			$("#bigImg02").attr("src" , "imgs/img2-0"+ (i+1) +"-b.jpg");
			$(".example02 li").removeClass("on");
			$(this).addClass("on");
		});
	});
});
