diff --git a/sites/all/modules/contrib/gmap/gmap.module b/sites/all/modules/patched/gmap/gmap.module
index 2f74458..3658959 100644
--- a/sites/all/modules/contrib/gmap/gmap.module
+++ b/sites/all/modules/patched/gmap/gmap.module
@@ -376,6 +376,8 @@ function theme_gmap_marker_popup($label) {
  *
  */
 function gmap_set_location($map, &$form, $fields) {
+
+
   static $ctr = 0;
   $ctr++;
   if (!is_array($map)) {
@@ -957,8 +959,36 @@ function theme_gmap($element) {
   }
   $mapids[$element['#map']] = TRUE;
 
-  // Put map data in a setting.
-  drupal_add_js(array('gmap' => array($element['#map'] => $map)), 'setting');
+  // Create a setting to store map data.
+
+  drupal_add_js(array('gmap' => array()), 'setting');
+
+  $o .= "<script type=\"text/javascript\">
+  jQuery.extend(Drupal.settings.gmap, ". drupal_to_js(array($element['#map'] => $map)) .");
+  $.getScript('/sites/all/modules/contrib/gmap/js/gmap.js', function() {
+      //alert('Load was performed.');
+  });\n";
+  $o .= "
+  $.getScript('/sites/all/modules/contrib/gmap/js/marker.js', function() {
+      //alert('Load was performed.');
+  });\n";
+  $o .= "
+  $.getScript('/sites/all/modules/contrib/gmap/js/highlight.js', function() {
+      //alert('Load was performed.');
+  });\n";
+  $o .= "
+  $.getScript('/sites/all/modules/contrib/gmap/js/gmap_marker.js', function() {
+      //alert('Load was performed.');
+  });\n";
+  $o .= "
+  $.getScript('/sites/all/modules/contrib/gmap/js/poly.js', function() {
+      //alert('Load was performed.');
+  });\n";
+  $o .= "
+  $.getScript('/sites/all/modules/contrib/gmap/js/locpick.js', function() {
+      //alert('Load was performed.');
+  });
+  </script>";
 
   return $o;
 }
@@ -1263,3 +1293,4 @@ function gmap_views_plugins() {
     ),
   );
 }
+
