(function($) {
  var geocoder = new google.maps.Geocoder();

  $.fn.autoGeocoder = function(options) {
    options = $.extend(true, {}, $.fn.autoGeocoder.defaults, options || {});

    this.setupExtras(options.setup || $.fn.autoGeocoder.base, options);
    this.each(function() {
      $(this).trigger('auto-geocoder-initialize');
    });

    return this;
  };

  $.fn.autoGeocoder.base = {
    initialize: [function(options) {
      options.initial.center = new google.maps.LatLng(
        options.initial.center[0],
        options.initial.center[1]
      );

      this.bind('auto-geocoder-initialize', function() {
        $(this).trigger('auto-geocoder-createMap');
      });
    }],

    createMap: [function(options) {
      this.bind('auto-geocoder-createMap', function() {
        $(this)
          .after('<div class="jquery-auto-geocoder-map" />')
          .keyup(function() {
            $(this).trigger('auto-geocoder-onKeyUp');
          });

        this.map = new google.maps.Map($(this).next()[0], options.initial);
      });
    }],

    onKeyUp: [function(options) {
      this.bind('auto-geocoder-onKeyUp', function() {
        var self    = $(this);
        var address = $.trim(self.val());

        if (this.timeout) {
          clearTimeout(this.timeout);
        }

        if (address == '') {
          self.trigger('auto-geocoder-onGeocodeResult', [[], '']);

          return;
        }

        this.timeout = setTimeout(function() {
          geocoder.geocode({ address: address }, function(results, status) {
            self.trigger('auto-geocoder-onGeocodeResult', [results, status]);
          });
        }, options.delay);
      })
    }],

    onGeocodeResponse: [function(options) {
      this.bind('auto-geocoder-onGeocodeResult', function(e, results, status) {
        if (status == google.maps.GeocoderStatus.OK && results.length) {
          if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
            this.map.set_zoom(options.success.zoom);
            this.map.set_center(results[0].geometry.location);

            if (this.marker) {
              this.marker.set_position(results[0].geometry.location);
              this.marker.set_map(this.map);
            } else {
              this.marker = new google.maps.Marker({
                map      : this.map,
                position : results[0].geometry.location
              });
            }
          }

          $(this).trigger('auto-geocoder-onGeocodeSuccess', [results, status]);
        } else {
          this.map.set_zoom(options.initial.zoom);
          this.map.set_center(options.initial.center);

          $(this).trigger('auto-geocoder-onGeocodeFailure', [results, status]);
        }

        if (results.length == 0 && this.marker) {
          this.marker.set_map(null);
          delete this.marker;
        }
      });
    }],

    onGeocodeSuccess: [],
    onGeocodeFailure: []
  };

  $.fn.autoGeocoder.defaults = {
    delay   : 500,
    success : {
      zoom : 14
    },
    initial : {
      zoom           : 1,
      center         : [34, 0],
      draggable      : false,
      mapTypeId      : google.maps.MapTypeId.ROADMAP,
      mapTypeControl : false
    }
  };

  // From:
  // http://yehudakatz.com/2009/04/20/evented-programming-with-jquery/
  jQuery.fn.setupExtras = function(setup, options) {
    for (property in setup) {
      var self = this;

      if (setup[property] instanceof Array) {
        for (var i = 0; i < setup[property].length; i++) {
          setup[property][i].call(self, options);
        }
      } else {
        setup[property].call(self, options);
      }
    }
  };
})(jQuery);

@@ -788,32 +788,23 @@
     
-$(this)%0A          .after
+var element = $
 ('%3Cd
@@ -843,16 +843,18 @@
 ap%22 /%3E')
+;%0A
 %0A       
@@ -854,18 +854,219 @@
         
-  
+if (options.position == 'before' %7C%7C options.position == 'after') %7B%0A          $(this)%5Boptions.position%5D(element);%0A        %7D else %7B%0A          $(options.position).append(element);%0A        %7D%0A%0A        $(this)
 .keyup(f
@@ -1079,34 +1079,32 @@
 n() %7B%0A          
- 
- 
 $(this).trigger(
@@ -1125,26 +1125,24 @@
 -onKeyUp');%0A
-  
         %7D);%0A
@@ -1185,22 +1185,15 @@
 Map(
-$(this).next()
+element
 %5B0%5D,
@@ -3122,24 +3122,48 @@
 efaults = %7B%0A
+    position : 'after',%0A
     delay   
@@ -3162,16 +3162,17 @@
 delay   
+ 
 : 500,%0A 
@@ -3182,16 +3182,17 @@
 success 
+ 
 : %7B%0A    
@@ -3222,16 +3222,17 @@
 initial 
+ 
 : %7B%0A    

Allow the map element to be inserted before or after the input element, as well as appended to a specific element.