--- automodal.js	2010-06-24 22:52:52.000000000 -0700
+++ automodal.js	(working copy)
@@ -18,6 +18,13 @@ Drupal.behaviors.automodal = function (c
           }
         };
       }
+      else if (typeof settings.onSubmit == 'string') {
+        // Parse strings into functions.
+        var func = settings.onSubmit.match(/function\s*\((.*?)\)\s*\{(.*)\}/i);
+        if (func) {
+          settings.onSubmit = new Function(func[1].match(/(\w+)/g), func[2]);
+        }
+      }
 
       settings.url = $(this).attr('href') || '#';
 
