function charactersLeft(count,input,limit) {
  // Get the element where the current count is displayed
  var countEl = document.getElementById(count);
  // Get the element where the text is being entered
  var inputEl = document.getElementById(input);
  // Get the text from the input element
  var inputStr = inputEl.value;
  // # of characters left = max input - current string length
  var charsLeft = limit - inputStr.length;
  
  // Change text color to red if 5 or less characters are left
  if(charsLeft <= 128) {
    countEl.style.color = "#f60";
  }
  else {
    countEl.style.color = "#00693f";
  }
  
  // When 0 characters are left...
  if(charsLeft <= 0) {
  	// always set charsLeft to 0 so no negative #'s display
    charsLeft = 0;
	// trim the extra input off of the input string and push
	// to the input element
    inputEl.value = inputStr.substring(0,limit);
  }
  
  // push the current count to the count element
  countEl.innerHTML = charsLeft;
}

