function contaCaracteres(textareaC, maximo, divmsg){
        var tamanho = textareaC.value.length;
        var restante = maximo - tamanho;
        if( restante <= 0 ){
                textareaC.value = textareaC.value.slice(0, maximo);
                restante = 0;
        }
        var aviso = "Espaço disponível:<b>" + restante + " toques</b>.";

        if (divmsg!=null) document.getElementById(divmsg).innerHTML = aviso;
}
