<script language="javascript">  
//Alter this variable depending on how many words you want to limit the textarea to.  
var maxwords = 120;  
   
function check_length(obj, cnt, rem)  
	{  
          var ary = obj.value.split(" ");  
          var len = ary.length;  
          cnt.innerHTML = len;  
          rem.innerHTML = maxwords - len;  
          if (len > maxwords) {  
              alert("Message in '" + obj.name + "' limited to " + maxwords + " words.");  
              ary = ary.slice(0,maxwords-1);  
              obj.value = ary.join(" ");  
              cnt.innerHTML = maxwords;  
              rem.innerHTML = 0;  
              return false;  
          }  
          return true;  
      }  
</script>   
