$(function()
{
    // onload時の更新処理
    update_forms();
    
    // 会員区分がクリックされた場合の処理
    $("#member_type_1").click(function()
    {
        update_forms();
    });
    $("#member_type_2").click(function()
    {
        update_forms();
    });
    
    // 「ケアマネ会員」がクリックされた場合の処理
    $("#from_other_site_type").click(function()
    {
        update_forms();
    });
});

// フォームの表示状態を更新
function update_forms()
{
    if ($("#member_type_2").attr("checked")) {
        $("#span_from_other_site_type").show();
        $("#regist-frame").addClass("frame-a");
        $("#regist-frame").removeClass("frame-q");
    } else {
    	$("#span_from_other_site_type").hide();
        $("#regist-frame").addClass("frame-q");
        $("#regist-frame").removeClass("frame-a");
    }
    
    if ($("#member_type_2").attr("checked") && $("#from_other_site_type").attr("checked")) {
        $(".for_caremane_user").show();
        $("#btn_newentry").attr("name", "action_newentry_cmEntryDo");
    } else {
    	$(".for_caremane_user").hide();
        $("#btn_newentry").attr("name", "action_newentry_sendDo");
    }
}