--- gmap3_tools.js	2012-10-02 09:56:44.000000000 +1300
+++ gmap3_tools_copy.js	2012-10-25 15:49:58.000000000 +1300
@@ -108,20 +108,22 @@
 /**
  * Attach gmap3_tools maps.
  */
-Drupal.behaviors.gmap3_tools = function(context) {
-  // Create all defined google maps.
-  if (Drupal.settings.gmap3_tools == undefined) {
-    return;
-  }
-  $.each(Drupal.settings.gmap3_tools.maps, function(i, map) {
-    // @todo - we should really use css selector here and not only element id.
-    var $mapElement = $('#' + map.mapId, context);
-    if ($mapElement.length == 0 || $mapElement.hasClass('gmap3-tools-processed')) {
+Drupal.behaviors.gmap3_tools = {
+  attach: function (context, settings) {
+    // Create all defined google maps.
+    if (Drupal.settings.gmap3_tools == undefined) {
       return;
     }
-    $mapElement.addClass('gmap3-tools-processed');
-    var gmap = gmap3ToolsCreateMap(map);
-  });
+    $.each(Drupal.settings.gmap3_tools.maps, function(i, map) {
+      // @todo - we should really use css selector here and not only element id.
+      var $mapElement = $('#' + map.mapId, context);
+      if ($mapElement.length == 0 || $mapElement.hasClass('gmap3-tools-processed')) {
+        return;
+      }
+      $mapElement.addClass('gmap3-tools-processed');
+      var gmap = gmap3ToolsCreateMap(map);
+    });
+  }
 };
 
 })(jQuery);
