function chusyoblogpartswrite(){
document.write("<style type=\"text/css\">  \n");
document.write("#chusyoblogarea{   \n");
document.write("outline: 0;  \n");
document.write("list-style: none;  \n");
document.write("line-height:1em;   \n");
document.write("letter-spacing: 0em;   \n");
document.write("color:#000000;   \n");
document.write("font-family:'ＭＳ Ｐゴシック','ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro',Meiryo,sans-serif;  \n");
document.write("font-size:12px;   \n");
document.write("font-weight:normal;   \n");
document.write("width: 160px;   \n");
document.write("margin: 0px 0px 0px 0px;   \n");
document.write("padding: 0px 0px 0px 0px;   \n");
document.write("text-decoration: none;  \n");
document.write("text-indent: 0px;  \n");
document.write("text-align:center;  \n");
document.write("background-color:#FFFFFF;   \n");
document.write("}   \n");
document.write("img#chusyoblogarea{   \n");
document.write(" height: 40px;   \n");
document.write(" border:none;   \n");
document.write("}   \n");
document.write("#chusyoblogarea div#chusyo_blog_title{   \n");
document.write(" background: url(http://www.chusyokin.co.jp/imgs/blog_head.jpg) no-repeat;   \n");
document.write(" height: 40px;   \n");
document.write(" width: 100%;   \n");
document.write("}   \n");
document.write("#chusyoblogarea div#chusyo_blog_title2{   \n");
document.write(" font-size: 12px;   \n");
document.write(" padding: 15px 0px 0px 0px;   \n");
document.write(" color: #ffffff;   \n");
document.write(" font-weight: bold;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts{   \n");
document.write(" background: url(http://www.chusyokin.co.jp/imgs/blog_background1x.jpg);   \n");
document.write(" background-repeat: repeat-y;   \n");
document.write(" cellspacing: 0px 0px 0px 2px;   \n");
document.write(" width: 160px;   \n");
document.write(" border-collapse: separate;   \n");
document.write(" border-spacing: 4px 1px;   \n");
document.write(" margin:0;   \n");
document.write(" padding: 0px 0px 0px 0px;  \n");
document.write("}   \n");
document.write("table#chusyoblogparts th{   \n");
document.write(" padding: 4px 4px 4px 4px;   \n");
document.write(" background-color:#f28f18;   \n");
document.write(" color:#ffffff;   \n");
document.write(" text-align: left;   \n");
document.write(" font-weight: lighter;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts td{   \n");
document.write("margin: 0px 0px 0px 2px;   \n");
document.write("cellspacing: 0px 0px 0px 2px;   \n");
document.write("padding: 2px 4px 2px 4px;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts td a{   \n");
document.write(" color: #ffffff;   \n");
document.write(" text-decoration: none;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts td a:hover{   \n");
document.write(" color: #ffff66;   \n");
document.write(" text-decoration: none;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts input{   \n");
document.write(" width: 38px;   \n");
document.write(" font-size: 11px;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts input[type=button]{   \n");
document.write(" width: 38px;   \n");
document.write(" padding: 2px 3px;   \n");
document.write(" font-size: 11px;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts input.chusyo_input_right{   \n");
document.write(" text-align: right;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts td.chusyo_blog_td{   \n");
document.write(" width: 61px;   \n");
document.write(" background-color:#f28f18;   \n");
document.write(" font-size: 11px;   \n");
document.write(" color:#ffffff;   \n");
document.write(" border-bottom: solid 1px #dbedd7;   \n");
document.write("}   \n");
document.write(".chusyo_blog_center{   \n");
document.write(" text-align: center;   \n");
document.write("}   \n");
document.write(".chusyo_blog_th{   \n");
document.write(" font-size: 11px;   \n");
document.write("}   \n");
document.write(".chusyo_blog_right{   \n");
document.write(" text-align:left;   \n");
document.write(" font-size: 10px;   \n");
document.write("}   \n");
document.write(".chusyo_blog_price{   \n");
document.write(" color: #333333;   \n");
document.write(" text-align: right;   \n");
document.write(" font-size: 12px;   \n");
document.write(" font-weight: bold;   \n");
document.write("}   \n");
document.write(".chusyo_blog_p{   \n");
document.write(" font-size: 11px;   \n");
document.write("}   \n");
document.write(".chusyo_blog_btn{   \n");
document.write(" text-align: center;   \n");
document.write(" margin: 0px 0px 0px 0px;   \n");
document.write(" padding: 0px 0px 0px 0px;   \n");
document.write(" font-size: 11px;   \n");
document.write(" height: 45px;   \n");
document.write(" background-color:#ff0000;   \n");
document.write(" background: url(http://www.chusyokin.co.jp/imgs/blog_button.jpg) no-repeat;   \n");
document.write("}   \n");
document.write("#chusyo_blog_bottom{   \n");
document.write(" width: 160px;   \n");
document.write(" margin: 0px 0px 0px 0px;  \n");
document.write(" padding: 0px 0px 0px 0px;  \n");
document.write("}   \n");
document.write("table#chusyoblogparts2{   \n");
document.write(" background-repeat: repeat-y;   \n");
document.write(" width: 160px;   \n");
document.write(" border-collapse: separate;   \n");
document.write(" border-spacing: 4px 1px;  \n");
document.write(" margin: 0px 0px 0px 0px;  \n");
document.write(" padding: 0px 0px 0px 0px;  \n");
document.write(" background: url(http://www.chusyokin.co.jp/imgs/blog_background2x.jpg);  \n");
document.write(" background-repeat: repeat-y;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 th{   \n");
document.write(" padding: 4px 4px 4px 4px;   \n");
document.write(" background-color:#0098db;   \n");
document.write(" color:#ffffff;   \n");
document.write(" text-align: left;   \n");
document.write(" font-weight: lighter;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 td{   \n");
document.write("margin: 0px 0px 0px 2px;   \n");
document.write("cellspacing: 0px 0px 0px 2px;   \n");
document.write("padding: 2px 4px 2px 4px;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 td a{   \n");
document.write(" color: #ffffff;   \n");
document.write(" text-decoration: none;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 td a:hover{   \n");
document.write(" color: #ffff66;   \n");
document.write(" text-decoration: none;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 input{   \n");
document.write(" width: 38px;   \n");
document.write(" font-size: 11px;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 input.chusyo_input_right{   \n");
document.write(" text-align: right;   \n");
document.write("}   \n");
document.write("table#chusyoblogparts2 td.chusyo_blog_td{   \n");
document.write(" width: 61px;   \n");
document.write(" background-color:#e0b535;   \n");
document.write(" font-size: 11px;   \n");
document.write(" color:#ffffff;   \n");
document.write(" border-bottom: solid 1px #dbedd7;   \n");
document.write("}   \n");
document.write("</style>  \n");
document.write("<div id=\"chusyoblogarea\">  \n");
document.write("<div id=\"chusyo_blog_title\"><div id=\"chusyo_blog_title2\">利息計算ブログパーツ</div></div>  \n");
document.write("<table id=\"chusyoblogparts\">  \n");
document.write("<tbody><tr>  \n");
document.write("<td class=\"chusyo_blog_td\">借入希望<br>金額</td>  \n");
document.write("<td class=\"chusyo_blog_right\"><input maxlength=\"8\" class=\"chusyo_input_right\" id=\"chusyo_kakiki\" value=\"100\" type=\"text\">&nbsp;&nbsp;万円</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td class=\"chusyo_blog_td\">仮計算日数</td>  \n");
document.write("<td class=\"chusyo_blog_right\"><input maxlength=\"4\" class=\"chusyo_input_right\" id=\"chusyo_kani\" value=\"31\" type=\"text\">&nbsp;&nbsp;日</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td class=\"chusyo_blog_td\">適用利率</td>  \n");
document.write("<td class=\"chusyo_blog_right\"><input maxlength=\"4\" class=\"chusyo_input_right\" id=\"chusyo_riritsu\" value=\"4.05\" type=\"text\">&nbsp;&nbsp;％</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" class=\"chusyo_blog_center\">  \n");
document.write("<input id=\"chusyo_calc\" value=\"計 算\" onclick=\"chusyo_calc_onckick();\" type=\"button\">  \n");
document.write("<input id=\"chusyo_reset\" value=\"クリア\" onclick=\"chusyo_reset_onckick();\" type=\"button\">  \n");
document.write("</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<th colspan=\"2\" id=\"input_date\" class=\"chusyo_blog_th\">利息金額概算</th>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" id=\"chusyo_rikiga\" class=\"chusyo_blog_price\">&nbsp;&nbsp;円</td>  \n");
document.write("</tr>  \n");
document.write("</tbody></table>  \n");
document.write("<img id=\"chusyo_blog_bottom\" src=\"http://www.chusyokin.co.jp/imgs/blog_joint.gif\">  \n");
document.write("<table id=\"chusyoblogparts2\">  \n");
document.write("<tr>  \n");
document.write("<th colspan=\"2\" id=\"chusyo_th\" class=\"chusyo_blog_th\">手形貸付（３か月前払い）</th>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" class=\"chusyo_blog_p\">手形貸付（９１日分）</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" id=\"chusyo_tekashi3\" class=\"chusyo_blog_price\">&nbsp;&nbsp;円</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<th colspan=\"2\" id=\"chusyo_th\" class=\"chusyo_blog_th\">極度貸付利息概算</th>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" class=\"chusyo_blog_p\">６か月毎の<br>元本組入利息概算</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" id=\"chusyo_kyokashi\" class=\"chusyo_blog_price\">&nbsp;&nbsp;円</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" class=\"chusyo_blog_th\">１年利用した場合の<br>元本組入利息概算</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" id=\"chusyo_kyokashinen\" class=\"chusyo_blog_price\">&nbsp;&nbsp;円</td>  \n");
document.write("</tr>  \n");
document.write("<tr>  \n");
document.write("<td colspan=\"2\" class=\"chusyo_blog_btn\">  \n");
document.write("<a id=\"chusyo_syumilink\" target=\"_brank\" href=\"http://www.chusyokin.co.jp/loan/flow/simulation_2.html\">メールでアンサー 借入試算<br>はこちら</a>  \n");
document.write("</td>  \n");
document.write("</tr>  \n");
document.write("</tbody></table>  \n");
document.write("<img id=\"chusyo_blog_bottom\" src=\"http://www.chusyokin.co.jp/imgs/blog_bottom.jpg\">  \n");
document.write("</div>  \n");
}
function chusyo_calc_onckick(){
    C4 = chusyo_strconverttoherf(document.getElementById("chusyo_kakiki").value    );
    C5 = chusyo_strconverttoherf(document.getElementById("chusyo_kani").value);
    C6 = chusyo_strconverttoherf(document.getElementById("chusyo_riritsu").value);
    document.getElementById("chusyo_kakiki").value   =  C4;
    document.getElementById("chusyo_kani").value     =  C5;
    document.getElementById("chusyo_riritsu").value  =  C6;
    document.getElementById("chusyo_rikiga").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_tekashi3").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_kyokashi").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_kyokashinen").innerHTML = "&nbsp;&nbsp;円";
    if((!chusyo_check(C4))||(!chusyo_check(C5))||(!chusyo_check2(C6))){return;}
    C6=C6/100;
    C4=C4*10000;
	document.getElementById("input_date").innerHTML = "利息金額概算" + chusyo_strconverttoZen(C5) + "日分";
    document.getElementById("chusyo_rikiga").innerHTML = chusyo_addFigure(Math.floor(C4*C5*C6/365)) + "&nbsp;&nbsp;円";
    document.getElementById("chusyo_tekashi3").innerHTML =  chusyo_addFigure(Math.floor(C4*91*C6/365)) + "&nbsp;&nbsp;円";
    document.getElementById("chusyo_kyokashi").innerHTML = chusyo_addFigure(Math.floor(C4*C6/2)) + "&nbsp;&nbsp;円";
    C12 = Math.floor(C4*C6/2);
    document.getElementById("chusyo_kyokashinen").innerHTML = chusyo_addFigure(Math.floor((parseFloat(C4)+parseFloat(C12))*C6/2+parseFloat(C12))) + "&nbsp;&nbsp;円";
}
function chusyo_addFigure(str) {
    var num = new String(str).replace(/,/g, "");
    while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
    if (num.length > 20){
        return "";
    }
    return num;
}
function chusyo_check(val){
    if(!chusyo_intcheck(val)){return false;}
    if(val.indexOf(".") >= 0){return false;}
    return true;
}
function chusyo_check2(val){
    return chusyo_intcheck(val);
}
function chusyo_intcheck(val){
    if(!val){return false;}
    if(isNaN(val)){return false;}
    if(val < 0){return false;}
    return true;
}
function chusyo_reset_onckick(){
    document.getElementById("chusyo_kakiki").value = "100";
    document.getElementById("chusyo_kani").value = "31";
    document.getElementById("input_date").innerHTML = "利息金額概算３１日分";
    document.getElementById("chusyo_rikiga").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_tekashi3").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_kyokashi").innerHTML = "&nbsp;&nbsp;円";
    document.getElementById("chusyo_kyokashinen").innerHTML = "&nbsp;&nbsp;円";
    chusyo_kinri_input();
}
function chusyo_kinri_input(){
    var removeelem = document.getElementById("chusyojavascriptcode");
    if(removeelem){ document.documentElement.removeChild(removeelem); }
    var chusyoscriptcode = document.createElement('script');
    chusyoscriptcode.id = "chusyojavascriptcode";
    chusyoscriptcode.type = "text/javascript";
    chusyoscriptcode.src = 'http://www.chusyokin.co.jp/cms/feed_nenritsu.php5?type=blogparts&target=chusyo_riritsu';
    document.documentElement.appendChild(chusyoscriptcode);
}
function chusyo_strconverttoherf(txt){
    hankaku1="0123456789";
    zenkaku1="０１２３４５６７８９";
    str="";
    for(i=0;i<txt.length;i++){
        c=txt.charAt(i);
        n1=zenkaku1.indexOf(c,0);if(n1>=0)c=hankaku1.charAt(n1);
        str+=c;
    }
    return str;
}
function chusyo_strconverttoZen(txt){
	hankaku1="0123456789";
	zenkaku1="０１２３４５６７８９";
	str="";
	for(i=0;i<txt.length;i++){
		c=txt.charAt(i);
		n1=hankaku1.indexOf(c,0);if(n1>=0)c=zenkaku1.charAt(n1);
		str+=c;
	}
	return str;
}
chusyoblogpartswrite();
window.onload = function(){
    chusyo_reset_onckick();
}

