$(document).ready(function() {

	//タイトル・閉じる・全てボタンなどカーソル制御
	$(".faq h2,.faq .close-accordion,.all-open").hover(function(){
		$(this).css("cursor","pointer");
		$(this).css("color","#990000");
	},function(){
		$(this).css("cursor","default");
		$(this).css("color","#336699");
	});
	
	//デフォで回答を閉じておく
	$(".faq p").hide();

	//タイトルクリックで回答を表示・非表示
	$(function(){
		$(".faq h2").toggle(
			function(){
				$(this).next().fadeIn("slow");
				$(".faq .close-accordion").click(function(){
				$(this).parent().fadeOut("slow");
			});
			},function(){
				$(this).next().fadeOut("slow");
			}
		);
	});

	//全てボタンの切替え
	$(function(){
		$(".all-open").toggle(
			function(){
				$(".all-open").html("全ての回答を閉じる");
				$(".faq p").fadeIn("slow");
			},function(){
				$(".all-open").html("全ての回答を表示する");
				$(".faq p").fadeOut("slow");
			}
		);
	});
});
