//
// Contains validation of field length code
//

  // Validates that a single object containing a value - does not exceed a specified length.
  // It will ignore trailing spaces. Currently this just does an obj.value to get the value,
  // but it could be made smarter to try to get values out of other types of objects.
  //
  // @param obj the object to examine to see if its value is too large
  // @param maxlen the maximum length allowed for the value
  //
  // @return true if the object value is not larger than the max length, else false.
  function valMaxLen(obj, maxlen)
  {
    var result = true;
    if (obj != null)
    {
      var val = obj.value;
      if (val != null)
      {
        val = trimRight(val);
        result = (val.length <= maxlen);
      }
    }
    return result;
  }

