function updateCharactersLeft(form_element, output_name, maxlength)
{
  var output_object = document.getElementById(output_name);
  var char_count = maxlength - form_element.value.length;
  output_object.innerHTML = char_count;
  
  if(char_count < 10)
  {
    // Set it to red
    output_object.className = 'red';
  }
  else
  {
    output_object.className = '';
  }
  
  if(char_count <= 0)
  {
    // Truncate the form element
    form_element.value = form_element.value.substring(0, 1000);
    
    // Move to the bottom
    //form_element.scrollTop = form_element.scrollHeight;
    
    // Recalculate the length just in case
    char_count = maxlength - form_element.value.length;
    output_object.innerHTML = char_count;
    return false;
  }
}