jQuery.fn.charCount = function(params)
{
  var p =  {
  	counterElement:"display_count"
  };
  var total_words;
  var max_words = 5000;

  if(params) {
  	jQuery.extend(p, params);
  }

  //for each keypress function on text areas
  this.keyup(function()
  {
    total_words = max_words - this.value.length;
    jQuery('#'+p.counterElement).html(total_words);
  });
  

};