character limit for tinyMCE textarea

Hi,

   I am using TinyMCE editor for textarea.how to limit the characters in
that textarea.
   500 is limit for that textarea,how to limit characters for this
textarea in client side.

   alert message after 500 characters or displaying dynamic count of
characters above the text area.

thanks,
Ravi.