$(document).ready(function(){
	
	$("#navi a").each(function(){
		if($(this).attr("href").match(/\#/)) {
			void(0);
		}
		else if($(this).attr("href").match(/\?/)) {
			$(this).attr("href",$(this).attr("href")+"&parts=navi");
		} else {
			$(this).attr("href",$(this).attr("href")+"?parts=navi");
		}
	});
	$("#side-a a").each(function(){
		if($(this).attr("href").match(/\#/)) {
			void(0);
		}
		else if($(this).attr("href").match(/\?/)) {
			$(this).attr("href",$(this).attr("href")+"&parts=side");
		} else {
			$(this).attr("href",$(this).attr("href")+"?parts=side");
		}
	});
	$("#side-b a").each(function(){
		if($(this).attr("href").match(/\#/)) {
			void(0);
		}
		else if($(this).attr("href").match(/\?/)) {
			$(this).attr("href",$(this).attr("href")+"&parts=side");
		} else {
			$(this).attr("href",$(this).attr("href")+"?parts=side");
		}
	});
	$("#footer_navi a").each(function(){
		if($(this).attr("href").match(/\#/)) {
			void(0);
		}
		else if($(this).attr("href").match(/\?/)) {
			$(this).attr("href",$(this).attr("href")+"&parts=footer");
		} else {
			$(this).attr("href",$(this).attr("href")+"?parts=footer");
		}
	});

	//imgタグに[class="rollover"]で[src="hogehoge_on"]を参照
	$("img.rollover:not(.sort)").each(function() {
		var off = this.src;
		var dot = this.src.lastIndexOf('.');
		var on = this.src.substr(0, dot) +
			'_on' + this.src.substr(dot, 4);
		$(this).hover(
			function() { this.src = on; },
			function() { this.src = off; });
	});
	
	//よくある質問の開閉
	$(".qanda dd").hide();
	$(".qanda dt a").click(function(){
		$(this).toggleClass("active");
		$(this).parents("dl").children("dd").slideToggle();
	});
	$(".qanda dd p.close a").click(function(){
		$(this).parents("dd").slideUp();
		$(this).parents("dl").children("dt").children("a").removeClass("active");
	});
	$(".question_list ul li a").click(function(){
		var questionID = $(this).attr("href");
		questionID = questionID.slice(1);
		$("dl[id="+questionID+"] dd").show();
		$("dl[id="+questionID+"] dt a").addClass("active");
	});
		
});
