//usage: <textarea onChange="textAreaMaxLength(this,4000)" onkeypress="textAreaMaxLength(this,4000)" onkeyup="textAreaMaxLength(this,4000)" cols="50" rows="20" name="li_descript"></textarea>
//onChange as the last resort, onkeypress: when user types, onkeyup when user pastes using the keyboard (might only work on IE)
function textAreaMaxLength(obj,maxChars){
        if (obj.value.length >= maxChars) {        
                obj.value=obj.value.substring(0,maxChars); 
        } 
}