// ===========================================

// Common JS

// ===========================================


// fontchanger
// -------------------------------------------

$(document).ready(function() {
    if($.cookie("css")) {
        var C = $.cookie("css");
        $("body").addClass(C);
    }
    $("#fontchanger a").click(function() {
        var C = $(this).attr('rel');

        $("body").removeClass("fs");
        $("body").removeClass("fm");
        $("body").removeClass("fl");

        $("body").addClass(C);
        $.cookie("css",$(this).attr('rel'), {expires: 90, path: '/'});
        return false;
    });
});



$(document).ready(function() {
    $("form input[type='text'], textarea").focus(function() {
	      $(this).addClass("focus");
    });
    $("form input[type='text'], textarea").blur(function() {
      if(!$(this).val()) {
	      $(this).removeClass("focus");
      }
    });
});



// memberlist
// -------------------------------------------

$(document).ready(function() {
		$("#member-list .member-body .member, .menu-list1 .menu-body").hover(
			function() {
				$(this).addClass("over");
			},
			function() {
				$(this).removeClass("over");
		});
});



// readmore
// -------------------------------------------

$(document).ready(function() {
	$("#main .section2 .section-body").each(function() {
		$(this).find(".more")
		.after('<div class="toggle open">詳細記事を表示する</div>')
		.hide();
	});

	$(this).find("div.toggle").toggle(
		function() {
			$(this).siblings(".more").slideDown("fast");
			$(this).html("詳細記事を閉じる");
			$(this).addClass("close");
			$(this).removeClass("open");
		},
		function() {
			$(this).siblings(".more").slideUp("fast");
			$(this).html("詳細記事を表示する");
			$(this).addClass("open");
			$(this).removeClass("close");
	});

});


