/**
 * Common functions to use when needed
 */

/**
 * Textarea limit by jquery
 */
function textarea_maxlength()
{
    var max = new Array();
    $('textarea').attr('maxlength', function(i){
        if(max[i] = this.getAttribute('maxlength')){
            $(this).keypress(function(event){
                return ((event.which == 8) || (event.which == 9) || (this.value.length < max[i]));
            })
        }
    });
}