//改行を含む文字数カウント
function ShowLength(inputted, limit, targ){
    len = 0;
    for (i = 0; i < inputted.length; i++) {
        STR = inputted.charAt(i);
        if (STR.indexOf("\r\n") > -1 || STR.indexOf("\n") > -1 || STR.indexOf("\r") > -1) {
            len += 2
        }
        else {
            len += 1
        }
        /*if (STR.match(/\w/)) {
         len += 0.5;
         }
         else {
         len += 1;
         }*/
    }
    if (limit > len) {
        document.getElementById(targ).innerHTML = "あと" + (limit - len) + "文字入力可能です。"//　現在"+len+"文字";
        document.getElementById(targ).className = "InputOk"
    }
    else
        if (limit == len) {
            document.getElementById(targ).innerHTML = "これ以上入力できません。";
            document.getElementById(targ).className = "InputOk"
        }
        else {
            document.getElementById(targ).innerHTML = (len - limit) + "文字減らして下さい。";
            document.getElementById(targ).className = "InputNg"
        }
}

//チェックボックスチェックでサブミットボタンを表示
function showSubmitButton(checkBoxValue,targetSubmitButtonId){
    if (checkBoxValue.checked) {
        document.getElementById(targetSubmitButtonId).style.display='inline';
    }
}