    jQuery(document).ready( function(){

        // Set the threshold for how many characters are allowed
        var textareaLen = 1000;

        var textlimitshow = document.createElement( 'div' );
        textlimitshow.innerHTML = "(Limit of " + textareaLen + " characters)";
        textlimitshow.style.color = "#666";
        textlimitshow.style.fontSize = "10px";

        jQuery("textarea").before( textlimitshow );
        
        jQuery("textarea").keyup( function(){
            if ( jQuery(this).attr( 'value' ).length > textareaLen ){
                var newLength = jQuery(this).attr( 'value' ).length - textareaLen;
                jQuery(this).attr( 'value', jQuery(this).attr( 'value' ).slice( 0, -( newLength ) ) );

                jQuery(this).animate( { width: jQuery(this).css( 'width' ) + 2, height: jQuery(this).css( 'height' ) + 2 }, 10 );
                jQuery(this).animate( { width: jQuery(this).css( 'width' ) - 4, height: jQuery(this).css( 'height' ) - 4 }, 10 );
                jQuery(this).animate( { width: jQuery(this).css( 'width' ) + 2, height: jQuery(this).css( 'height' ) + 2 }, 10 );
           } 
       });
   }); 

