﻿function GetCharCount(obj, maxLen) {
    if (obj.value.length > maxLen) {
        obj.value = obj.value.substr(0, maxLen);
        if (obj.value.length > maxLen) {
            obj.value = obj.value.substr(0, maxLen - 1);
        }
    }
}

function tbxSC(obj, obj1, count) {
    var c = document.getElementById(obj).value.length;
    document.getElementById(obj1).innerHTML = '(осталось: ' + ((count - c) < 0 ? 0 : (count - c)) + ')';
}
