//=============================================================================
// CHAR COUNTER
var rtextc = 0;

    function textCounter(field, countfield, maxlimit, minlimit)
    {
        if (field.value.length > maxlimit) // if too long...trim it!
        {
            field.value = field.value.substring(0, maxlimit);
            countfield.style.color = "#FF0000";
        }
        else if( minlimit && field.value.length < minlimit )
        {
            countfield.value = maxlimit - field.value.length;
            countfield.style.color = "#FF0000";
        }
        else // otherwise, update 'characters left' counter
        {
            countfield.value = maxlimit - field.value.length;
            countfield.style.color = "#00FF00";
        }

    }

    function check_count(field, maxlimit, minlimit)
    {
        if (field.value.length > maxlimit) // if too long...trim it!
        {
            alert( "The text entered is too long." );
            return false;
        }
        else if( minlimit && field.value.length < minlimit )
        {
            alert( "The text entered is too short." );
            return false;
        }
        else // otherwise, update 'characters left' counter
        {
            return true;
        }

    }
//=============================================================================
