(function ($) {
  $.fn.autoScale = function(opts) {
    var opts = $.extend({
      complete: function () {}
    }, opts);

    this.each(function () {
      var $this = $(this);
      $this.attr("size", $this.val().length + 3);
    });

    opts.complete();

    return this;
  };

  $.fn.autoSelect = function() {
    return this.click(function() { this.select(); });
  };

  $.fn.hoverClass = function() {
    return this.hover(function() {
      $(this).addClass("hover");
    }, function() {
      $(this).removeClass("hover");
    });
  };

  $.registerGoal = function(gid) {
    $("body").append('<iframe src="/_/goal/' + gid + '" width="0" height="0" frameborder="0" style="display: none;"></iframe>');
  }
})(jQuery);
