jQuery.fn.clearable = function() {
 
  $('.morelink').live('click', function() {
    var $this = $(this);
    if ($this.hasClass('less')) {
      $this.removeClass('less');
      $this.html(config.moreText);
    } else {
      $this.addClass('less');
      $this.html(config.lessText);
    }
    $this.parent().prev().toggle();
    $this.prev().toggle();
    return false;
  });
 
  return this.each(function() {
	
	
    	
	$(this)
		.wrap('<div  class="divclearable"></div>')
		.parent()
		.attr('class', $(this).attr('class') + ' divclearable')
		.append('<a class="clearlink" href="#"></a>');

	$('.clearlink')
		.attr('title', 'Kliknij tutaj aby wyczyścić to pole')
		.click(function() {
			
			$(this).prev().val('').focus();
			return false;

	});
  });
}
