diff --git a/meebo.admin.inc b/meebo.admin.inc
index 8069e68..5a29994 100644
--- a/meebo.admin.inc
+++ b/meebo.admin.inc
@@ -17,6 +17,7 @@ function meebo_settings($form, &$form_state) {
   $links_sharable = variable_get('meebo_links_sharable', FALSE);
   $images_sharable = variable_get('meebo_images_sharable', FALSE);
   $videos_sharable = variable_get('meebo_videos_sharable', FALSE);
+  $script_pos = variable_get('meebo_script_pos', 'footer');
   
   $form['meebo_bar'] = array(
     '#type' => 'fieldset',
@@ -46,6 +47,13 @@ function meebo_settings($form, &$form_state) {
     '#markup' => '<p>' . t('See your <a href="!url" target="_blank">Meebo Bar Stats</a>',
     array('!url' => url('https://dashboard.meebo.com/' . $meebo_id . '/stats/'))) . '</p>',
   );
+  $form['meebo_bar']['meebo_script_pos'] = array(
+    '#type' => 'radios',
+    '#title' => t('Script Position'),
+    '#description' => t('Select which position in the markup the meebo code should appear. Either the header or the footer.'),
+    '#options' => array('header' => t('Header'), 'footer' => t('Footer')),
+    '#default_value' => $script_pos,
+  );
    
   $form['meebo_sharing'] = array(
     '#type' => 'fieldset',
diff --git a/meebo.module b/meebo.module
index 9bb5163..ac83e73 100644
--- a/meebo.module
+++ b/meebo.module
@@ -126,16 +126,25 @@ function _meebo_is_enabled() {
  * return the JS
  */
 function _meebo_add_js() {
-    
+  $script_pos = variable_get('meebo_script_pos', 'footer'); 
   $meebo_id = variable_get('meebo_id', '');
-  drupal_add_js(array('meebo' => array('id' => $meebo_id)), 'setting');
   
   // Read the Meebo embed script from the file, and embed it as an inline script
   // per the docs. This cuts down the HTTP requests being made
   $script_path = drupal_get_path('module', 'meebo') . '/meebo.js';
   $script_handle = fopen($script_path, 'r');
   $script = fread($script_handle, filesize($script_path));
-  drupal_add_js($script, array('type' => 'inline', 'scope' => 'footer'));
+
+  // to set the code in the header we'll need to add the settings as well.
+  // because it will be above the declaration of the drupal settings array.
+  if ($script_pos == "header") {
+    $script = str_replace("Drupal.settings.meebo.id", '"'.$meebo_id.'"', $script);
+    drupal_add_js($script, array('type' => 'inline', 'scope' => $script_pos));
+  }
+  else {
+    drupal_add_js(array('meebo' => array('id' => $meebo_id)), 'setting');
+  }
+
   fclose($script_handle);
   
   $js = '';
