diff --git includes/common.inc includes/common.inc
index 75953a0..4e7d481 100644
--- includes/common.inc
+++ includes/common.inc
@@ -2522,6 +2522,23 @@ function drupal_get_path($type, $name) {
 }
 
 /**
+ * Returns the path prefix of the current request.
+ *
+ * @return
+ *   The path prefix.
+ */
+function drupal_get_path_prefix() {
+  $prefix = &drupal_static(__FUNCTION__);
+  if (!isset($prefix)) {
+    // url() gets the path prefix by running hook_url_outbound_alter(). As it
+    // is against Drupal's coding standards to call an alter hook from multiple
+    // locations, extract the prefix from url() by passing $prefix by reference.
+    url('', array('prefix' => &$prefix));
+  }
+  return $prefix;
+}
+
+/**
  * Return the base URL path (i.e., directory) of the Drupal installation.
  *
  * base_path() prefixes and suffixes a "/" onto the returned path if the path is
@@ -3546,6 +3563,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
         'settings' => array(
           'data' => array(
             array('basePath' => base_path()),
+            array('pathPrefix' => drupal_get_path_prefix()),
           ),
           'type' => 'setting',
           'scope' => 'header',
diff --git modules/overlay/overlay-parent.js modules/overlay/overlay-parent.js
index dd32929..025321f 100644
--- modules/overlay/overlay-parent.js
+++ modules/overlay/overlay-parent.js
@@ -594,8 +594,9 @@ Drupal.overlay.isAdminLink = function (url) {
 
   // Turn the list of administrative paths into a regular expression.
   if (!self.adminPathRegExp) {
-    var adminPaths = '^(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|^(') + ')$';
-    var nonAdminPaths = '^(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|^(') + ')$';
+    var regExpPrefix = '^' + Drupal.settings.pathPrefix + '(';
+    var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$';
+    var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$';
     adminPaths = adminPaths.replace(/\*/g, '.*');
     nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*');
     self.adminPathRegExp = new RegExp(adminPaths);
diff --git modules/simpletest/tests/ajax.test modules/simpletest/tests/ajax.test
index 3fc93e3..6da7106 100644
--- modules/simpletest/tests/ajax.test
+++ modules/simpletest/tests/ajax.test
@@ -47,6 +47,8 @@ class AJAXFrameworkTestCase extends AJAXTestCase {
     $this->assertIdentical($result[0]['command'], 'settings', t('drupal_add_js() settings are contained first.'));
     // Verify that basePath is contained in JavaScript settings.
     $this->assertEqual($result[0]['settings']['basePath'], base_path(), t('Base path is contained in JavaScript settings.'));
+    // Verify that pathPrefix is contained in JavaScript settings.
+    $this->assertEqual($result[0]['settings']['pathPrefix'], drupal_get_path_prefix(), t('Path prefix is contained in JavaScript settings.'));
   }
 
   /**
diff --git modules/simpletest/tests/common.test modules/simpletest/tests/common.test
index 777b413..3707f9b 100644
--- modules/simpletest/tests/common.test
+++ modules/simpletest/tests/common.test
@@ -1057,6 +1057,7 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     $this->assertTrue(array_key_exists('misc/drupal.js', $javascript), t('Drupal.js is added when file is added.'));
     $this->assertTrue(array_key_exists('misc/collapse.js', $javascript), t('JavaScript files are correctly added.'));
     $this->assertEqual(base_path(), $javascript['settings']['data'][0]['basePath'], t('Base path JavaScript setting is correctly set.'));
+    $this->assertEqual(drupal_get_path_prefix(), $javascript['settings']['data'][1]['pathPrefix'], t('Path prefix JavaScript setting is correctly set.'));
   }
 
   /**
@@ -1064,8 +1065,8 @@ class JavaScriptTestCase extends DrupalWebTestCase {
    */
   function testAddSetting() {
     $javascript = drupal_add_js(array('drupal' => 'rocks', 'dries' => 280342800), 'setting');
-    $this->assertEqual(280342800, $javascript['settings']['data'][1]['dries'], t('JavaScript setting is set correctly.'));
-    $this->assertEqual('rocks', $javascript['settings']['data'][1]['drupal'], t('The other JavaScript setting is set correctly.'));
+    $this->assertEqual(280342800, $javascript['settings']['data'][2]['dries'], t('JavaScript setting is set correctly.'));
+    $this->assertEqual('rocks', $javascript['settings']['data'][2]['drupal'], t('The other JavaScript setting is set correctly.'));
   }
 
   /**
@@ -1084,6 +1085,7 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     drupal_add_js(array('testSetting' => 'testValue'), 'setting');
     $javascript = drupal_get_js('header');
     $this->assertTrue(strpos($javascript, 'basePath') > 0, t('Rendered JavaScript header returns basePath setting.'));
+    $this->assertTrue(strpos($javascript, 'pathPrefix') > 0, t('Rendered JavaScript header returns pathPrefix setting.'));
     $this->assertTrue(strpos($javascript, 'testSetting') > 0, t('Rendered JavaScript header returns custom setting.'));
     $this->assertTrue(strpos($javascript, 'misc/jquery.js') > 0, t('Rendered JavaScript header includes jQuery.'));
   }
