/*外部リンクをブランク表示*/
jQuery(function() {   
  jQuery(".window a").attr("target","_blank"); 
  jQuery("a.window").attr("target","_blank"); 
  jQuery(".link_blank a").attr("target","_blank"); 
  jQuery("a.link_blank").attr("target","_blank");  
});



/*--------------------

FAQアコーディオンスクリプト

--------------------*/
jQuery(function () {
	
	//初期化 読み込み時は非表示
	jQuery(".faq_area dd").css({"display":"none"});		
	
	//マウスオーバー時　カーソール表示
	jQuery(".faq_area dt").mouseover(function () {
		jQuery(this).css({"cursor":"pointer"});	
		this.style.backgroundColor = "#ffffff";
	});
	
	
	jQuery(".faq_area dt").mouseout(function () {
		this.style.backgroundColor = "#ffffff";
	});


	//dtクリック時次のdd表示
	jQuery(".faq_area dt").click(function () {
		//jQuery("dd:not(:first)").hide();
		jQuery(this).next().slideToggle(10);				 
	});
	
});


/*フリーワード検索　入力チェック*/
function form_check(f) {
   if (f.q.value == "") {
      alert("検索キーワードを入力してください。");
      return false;
   }
   else return true;
}




/*---------------------------------

タブ化スクリプト

---------------------------------*/
//ホバー
$(function() {
	$("#tab_menu li img").hover(
		function() {	
				onSrc = $(this).attr("src");							//イメージのSRCパス格納
				onSrc = onSrc.replace("_df.", "_ov.");
				$(this).attr("src",onSrc);
				$(this).parent().attr("id");
		},
		function() {
				offSrc = $(this).attr("src");							//イメージのSRCパス格納
				offSrc = offSrc.replace("_ov.", "_df.");
				$(this).attr("src",offSrc);
		});
});



$(function(){
			
	//フェードインスピード
	var speed = 300;
					 
	//初期化
	$("#tab_contents").children().css({"display":"none"})
	$("#tab_contents").children().eq(0).css({"display":"block"})

$("#tab_menu li").click(function() {
																	 
		//クリックしたliの子IMG　取得
		nowImg = $(this).children();
		
		//画像切り替え
		imgSrc = $(nowImg).attr("src");
		imgSrc = imgSrc.replace("_ov.", "_hit.");
		$(nowImg).attr("src",imgSrc);
		
		//IDから最後の数字取得
		imgNum = nowImg.attr("id").slice(5);
		imgNum = imgNum-1;
		$("#tab_contents").children().css({"display":"none"})
		$("#tab_contents").children().eq(imgNum).fadeIn(speed);
		
		//押したliの兄弟li取得
		$(this).siblings().each(function() {
			
			rstImg = $(this).children();
			rstSrc = $(rstImg).attr("src");
			
			//画像切り替え
			rstSrc = rstSrc.replace("_hit.", "_df.");
			$(rstImg).attr("src",rstSrc);	
			
		});
		
	 });

});




/*---------------------------------

カーソール表示

---------------------------------*/
$(function() {
		   
	$("#tab_menu li").mouseover(function () {
		$(this).css({"cursor":"pointer"});	
	});
	
	$("#switch_font li").mouseover(function () {
		$(this).css({"cursor":"pointer"});	
	});
});



/*---------------------------------

スライドショー

---------------------------------*/
$(function() {
			var imgWrapper = $('.slideshow > img');
			// only show the first image, hide the rest
			imgWrapper.hide().filter(':first').show();
			
			$('ul.recentlist li a').click(function () {
			
				// check if this item doesn't have class "current"
				// if it has class "current" it must not execute the script again
				if (this.className.indexOf('current') == -1){
					imgWrapper.hide();
					imgWrapper.filter("#"+ $(this).attr("name")).fadeIn(500);
					$('ul.recentlist li a').removeClass('current');
					$(this).addClass('current');
					//$(this).attr('href','javascript:void(0)');
				}
				return false;
			});
		});



/*---------------------------------

スライドショー2

---------------------------------*/
$(function() {
			var imgWrapper2 = $('.slideshow2 > img');
			// only show the first image, hide the rest
			imgWrapper2.hide().filter(':first').show();
			
			$('ul.recentlist2 li a').click(function () {
			
				// check if this item doesn't have class "current"
				// if it has class "current" it must not execute the script again
				if (this.className.indexOf('current') == -1){
					imgWrapper2.hide();
					imgWrapper2.filter("#"+ $(this).attr("name")).fadeIn(500);
					$('ul.recentlist2 li a').removeClass('current');
					$(this).addClass('current');
					//$(this).attr('href','javascript:void(0)');
				}
				return false;
			});
		});







