
//  Show how many characters remained
function CountChars(id_in, id_out, max) {
    
    var text = document.getElementById(id_in).value.length;
    document.getElementById(id_out).innerHTML = max - text;
    
    if (text >= max) {
        document.getElementById(id_in).value =
            document.getElementById(id_in).value.substring(0, max - 1);
        document.getElementById(id_out).innerHTML = 0;
    }
} 

