//=================================================================================
//住宅ローン借入可能額シミュレーション用の金利方式ラジオボタンの関連処理
//=================================================================================
//金利方式ラジオボタン
function kinri1_chg(){
    for (i=0; i < window.document.borrowing.r_houshiki.length; i++){
        if (window.document.borrowing.r_houshiki[i].checked){
            kinri1_chi = window.document.borrowing.temp_r_houshiki[i].value ;
        }
    }

    if ( kinri1_chi != "free"){
        window.document.borrowing.t_houshiki.value = kinri1_chi;
    }else if(kinri1_chi == "free" ){
        window.document.borrowing.t_houshiki.value = "";
        window.document.borrowing.t_houshiki.select();
    }else{
    }
}
//金利方式テキストボックス
function kinri1_text(){
        window.document.borrowing.r_houshiki[window.document.borrowing.r_houshiki.length-1].checked =true ;
}
//=================================================================================



//=================================================================================
//住宅ローン返済額シミュレーション用のボーナスラジオボタンの関連処理
//=================================================================================
//ボーナスラジオボタン
function bonus2_chg(){
    for (i=0; i < window.document.payment.r_times.length; i++){
        if (window.document.payment.r_times[i].checked){
            bonus2_chi = window.document.payment.r_times[i].value ;
        }
    }

    if ( bonus2_chi != "free" ){
        window.document.payment.t_times.value = "";
    }else {
        window.document.payment.t_times.value = "";
        window.document.payment.t_times.select();
    }
}

//ボーナステキストボックス
function bonus2_text(){
        window.document.payment.t_times.value = "";
        window.document.payment.r_times[window.document.payment.r_times.length-1].click() ;
}
//-------------------------------------------------------------------------------
//金利方式ラジオボタンの関連処理
//-------------------------------------------------------------------------------
//金利方式ラジオボタン
function kinri2_chg(){
    for (i=0; i < window.document.payment.r_houshiki.length; i++){
        if (window.document.payment.r_houshiki[i].checked){
            kinri2_chi = window.document.payment.temp_r_houshiki[i].value ;
        }
    }

    if ( kinri2_chi != "free" ){
        window.document.payment.t_houshiki.value = kinri2_chi;
    }else if(kinri2_chi == "free" ){
        window.document.payment.t_houshiki.value = "";
        window.document.payment.t_houshiki.select();
    }else{
    }
}

//金利方式テキストボックス
function kinri2_text(){
        window.document.payment.r_houshiki[window.document.payment.r_houshiki.length-1].checked =true;
}
//=================================================================================



//=================================================================================
//住宅ローン借り換えシミュレーション用のボーナスラジオボタンの関連処理
//=================================================================================
//ボーナスラジオボタン
function bonus3_chg(){
    for (i=0; i < window.document.refinance.r_times.length; i++){
        if (window.document.refinance.r_times[i].checked){
            bonus3_chi = window.document.refinance.r_times[i].value ;
        }
    }

    if ( bonus3_chi != "free" ){
        window.document.refinance.t_times.value = "";
    }else {
        window.document.refinance.t_times.value = "";
        window.document.refinance.t_times.select();
    }
}

//ボーナステキストボックス
function bonus3_text(){
        window.document.refinance.t_times.value = "";
        window.document.refinance.r_times[window.document.refinance.r_times.length-1].click() ;
}
//-------------------------------------------------------------------------------
//金利方式ラジオボタンの関連処理
//-------------------------------------------------------------------------------
//金利方式ラジオボタン
function kinri3_chg(){
    for (i=0; i < window.document.refinance.r_houshiki.length; i++){
        if (window.document.refinance.r_houshiki[i].checked){
            kinri3_chi = window.document.refinance.temp_r_houshiki[i].value ;
        }
    }

    if ( kinri3_chi != "free" ){
        window.document.refinance.t_houshiki.value = kinri3_chi;
    }else if(kinri3_chi == "free" ){
        window.document.refinance.t_houshiki.value = "";
        window.document.refinance.t_houshiki.select();
    }else{
    }
}

//金利方式テキストボックス
function kinri3_text(){
        window.document.refinance.r_houshiki[window.document.refinance.r_houshiki.length-1].checked=true ;
}
//=================================================================================



//=================================================================================
//無担保ローン返済額シミュレーション用のボーナスラジオボタンの関連処理
//=================================================================================
//ボーナスラジオボタン
function bonus4_chg(){
    for (i=0; i < window.document.mutanpo.r_times.length; i++){
        if (window.document.mutanpo.r_times[i].checked){
            bonus4_chi = window.document.mutanpo.r_times[i].value ;
        }
    }

    if ( bonus4_chi != "free" ){
        window.document.mutanpo.t_times.value = "";
    }else {
        window.document.mutanpo.t_times.value = "";
        window.document.mutanpo.t_times.select();
    }
}

//ボーナステキストボックス
function bonus4_text(){
        window.document.mutanpo.t_times.value = "";
        window.document.mutanpo.r_times[window.document.mutanpo.r_times.length-1].click() ;
}
//-------------------------------------------------------------------------------
//金利方式ラジオボタンの関連処理
//-------------------------------------------------------------------------------
//金利方式ラジオボタン
function kinri4_chg(){
    loan_type_f = "nodata";
    for (i=0; i < window.document.mutanpo.loan_type.length; i++){
        if (window.document.mutanpo.loan_type[i].checked){
            loan_type_f = window.document.mutanpo.loan_type[i].value ;
        }
    }
    for (i=0; i < window.document.mutanpo.r_houshiki.length; i++){
        if (window.document.mutanpo.r_houshiki[i].checked){
            kinri4_chi = window.document.mutanpo.r_houshiki[i].value ;
        }
    }
    if(loan_type_f == "nodata"){
    }else if (loan_type_f != "type_free"){
        if ( kinri4_chi != "free" ){
            window.document.mutanpo.t_houshiki.value = kinri4_chi;
        }else if(kinri4_chi == "free" ){
            window.document.mutanpo.t_houshiki.value = "";
            window.document.mutanpo.t_houshiki.select();
        }else{
        }
    }else if(loan_type_f == "type_free"){
        if ( kinri4_chi == "free" ){
        }else {
            window.alert("自由に計算する場合は金利を入力してください。");
            window.document.mutanpo.t_houshiki.value = "";
            window.document.mutanpo.r_houshiki[window.document.mutanpo.r_houshiki.length-1].click() ;
            window.document.mutanpo.t_houshiki.focus();
        }
    }

}

//金利方式テキストボックス
function kinri4_text(){
        window.document.mutanpo.r_houshiki[window.document.mutanpo.r_houshiki.length-1].checked = true;
}
//=================================================================================
