(function($) {
  $.fn.autowidth = function(readonly) {
    return this.filter('select')
        .mouseover(function() { $(this).width("auto").mouseout(function() { $(this).width(""); }); })
        .click(function() { $(this).unbind("mouseout"); })
        .blur(function() { $(this).width(""); })
        .change(function() { $(this).width(""); });
  }
})(jQuery);
