diff --git a/dart.admin.inc b/dart.admin.inc
index 8ddac36..117da88 100644
--- a/dart.admin.inc
+++ b/dart.admin.inc
@@ -63,6 +63,12 @@ function dart_admin_settings() {
     '#description' => t('The value to use when no "zone" is specified on a given page.'),
     '#maxlength' => 32,
   );
+  $form['settings']['tag_settings']['dart_load_last'] = array(
+    '#type'           => 'checkbox',
+    '#title'          => t('Load ads last'),
+    '#default_value'  => variable_get('dart_load_last', '0'),
+    '#description'    => t('Wait until the entire page has loaded before loading ads. This will allow your pages to load faster but may cause empty spaces to appear on your pages before the ads load. <strong>You must use this option if you are loading ad tags asyncronously.</strong>'),
+  );
 
   // Global display options.
   $form['settings']['display_options'] = array(
@@ -244,7 +250,7 @@ function theme_dart_global_defaults_form($variables) {
     '!site' => drupal_render($form[$fields['site']]),
     '!zone' => drupal_render($form[$fields['zone']]),
   );
-  
+
   $form[$element_name] = array(
     '#prefix' => '<div class="form-item"><label>' . ucwords($mode) . ' prefix . site / zone</label>',
     '#markup' => '<div class="container-inline">' . t('!prefix . !site / !zone', $replacements) . '</div>',
diff --git a/dart.js b/dart.js
index 79c4507..a6a5afb 100644
--- a/dart.js
+++ b/dart.js
@@ -1,3 +1,4 @@
+(function($) {
 
 /**
  * Create a DART object to handle tagging functionality
@@ -12,23 +13,6 @@ Drupal.DART.settings = {
 };
 
 /**
- * If there are tags in the loadLastTags, then load them where they belong.
- */
-Drupal.behaviors.DART = function() {
-  if (typeof(Drupal.DART.settings.loadLastTags) == 'object') {
-    $('.dart-tag:visible').each( function() {
-      if(!$(this).hasClass('dart-processed')) {
-        var regex = /dart-name-(\w+)$/;
-        var result = regex.exec($(this).attr('class'));
-        var scriptTag = Drupal.DART.tag(Drupal.DART.settings.loadLastTags[result[1]]);
-
-        $(this).writeCapture().append(scriptTag).addClass('dart-processed');
-      }
-    });
-  }
-}
-
-/**
  * Using document.write, add a DART tag to the page
  */
 Drupal.DART.tag = function(tag) {
@@ -70,7 +54,7 @@ Drupal.DART.keyVal = function(key, val, useEval) {
 
 /**
  * Loop through an object and create kay|val pairs.
- * 
+ *
  * @param vals
  *   an object in this form:
  *   {
@@ -90,3 +74,20 @@ Drupal.DART.keyVals = function(vals) {
   }
   return ad;
 }
+
+/**
+ * If there are tags in the loadLastTags, then load them where they belong.
+ */
+Drupal.behaviors.DART = {attach: function(context) {
+  console.log('here');
+  if (typeof(Drupal.DART.settings.loadLastTags) == 'object') {
+    $('.dart-tag:visible').not('.dart-processed').each( function() {
+      var regex = /dart-name-(\w+)$/;
+      var result = regex.exec($(this).attr('class'));
+      var scriptTag = Drupal.DART.tag(Drupal.DART.settings.loadLastTags[result[1]]);
+
+      $(this).writeCapture().append(scriptTag).addClass('dart-processed');
+    });
+  }
+}};
+})(jQuery);
diff --git a/dart.module b/dart.module
index c7150d4..972b94e 100644
--- a/dart.module
+++ b/dart.module
@@ -372,9 +372,10 @@ function dart_preprocess_page(&$variables) {
     $inline_js .= 'Drupal.DART.settings.loadLastTags = {};' . "\n";
   }
 
-  // Include the inline js & dart.js file.
-  drupal_add_js(trim($inline_js, "\n"), array('type' => 'inline', 'scope' => JS_DEFAULT));
+  // Include the inline js & dart.js file. Dart.js must be included first
+  // because the inline_js can reference variables defined in dart.js.
   drupal_add_js(drupal_get_path('module', 'dart') . '/dart.js');
+  drupal_add_js(trim($inline_js, "\n"), array('type' => 'inline', 'scope' => 'header'));
 
   // Regenerate scripts variable to incorporate newly added scripts.
   $variables['scripts'] = drupal_get_js();
@@ -415,7 +416,7 @@ function dart_test_page() {
         '#markup' => module_exists('devel') ? kpr($tag, TRUE) : '',
       ),
       '#sorted' => TRUE,
-    );    
+    );
   }
 
   return $content;
