$(function(){

	$(".faq_section dl dd").css('display','none');

	$(".faq_section:first").before('<p class="all_answer">全ての回答を表示</p>');

	$(".faq_section dl dt").click(function() {

		if($(this).attr('class')=='open') {
			$(this).toggleClass('open');
			$(this).next().animate({height:'toggle',opacity:'toggle'});
			return false;
		}

		$(this).toggleClass('open');
		$(this).next().animate({height:'toggle',opacity:'toggle'});

	});


	$(".all_answer").click(function() {

		if($(".all_answer").html()=='全ての回答を表示') {
			$(".all_answer").html('全ての回答を非表示');
			$(".faq_section dl dd").hide();
			$(".faq_section dl dt").removeClass('open');
		}
		else {
			$(".all_answer").html('全ての回答を表示');
			$(".faq_section dl dd").show();
			$(".faq_section dl dt").addClass('open');
		}

		$(".all_answer").toggleClass('allopen');
		$(".faq_section dl dt").toggleClass('open');
		$(".faq_section dl dd").animate({height:'toggle',opacity:'toggle'});
	});
});

