diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml
index 7cf2b7710dc03e2247d66aff7538d54e0820b545..a6f9585b62969ff55b5e3ac8eee661dc0db56b7e 100644
--- a/indra/newview/app_settings/settings_alchemy.xml
+++ b/indra/newview/app_settings/settings_alchemy.xml
@@ -409,6 +409,19 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>AlchemyLastDirectoryTab</key>
+    <map>
+      <key>Comment</key>
+      <string>Last active tab in directory floater</string>
+	  <key>HideFromEditor</key>
+	  <integer>1</integer>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>AlchemyLookAtClampEnabled</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp
index db32a4936f550c5ba7c3541eed2bc290f26d53c0..5a4f1eda3612b9e889c09967c3ad61acdfa8e606 100644
--- a/indra/newview/llfloaterdirectory.cpp
+++ b/indra/newview/llfloaterdirectory.cpp
@@ -51,6 +51,7 @@
 #include "llpanelsearchbase.h"
 #include "llpanelsearchweb.h"
 #include "llproductinforequest.h"
+#include "llviewercontrol.h"
 
 SearchQuery::SearchQuery()
 :   category("category", ""),
@@ -98,6 +99,12 @@ BOOL LLFloaterDirectory::postBuild()
 	getChild<LLButton>("PageDn")->setCommitCallback(boost::bind(&LLFloaterDirectory::choosePage, this, _1));
 	showDetailPanel(LLStringUtil::null); // hide all the panels
 	paginate();
+
+	if (!mTabContainer->selectTab(gSavedSettings.getS32("AlchemyLastDirectoryTab")))
+	{
+		mTabContainer->selectFirstTab();
+	}
+
 	return LLFloater::postBuild();
 }
 
@@ -112,6 +119,14 @@ void LLFloaterDirectory::onOpen(const LLSD& key)
 	onTabChanged();
 }
 
+void LLFloaterDirectory::onClose(bool app_quitting)
+{
+	if (mTabContainer)
+	{
+		gSavedSettings.setS32("AlchemyLastDirectoryTab", mTabContainer->getCurrentPanelIndex());
+	}
+}
+
 void LLFloaterDirectory::setProgress(bool working)
 {
 	getChild<LLUICtrl>("loading")->setVisible(working);
diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h
index ec8c87a67be6ff78a52c6c06564fd20d109f29e0..02e9cc9c54094e4add18d5aff201c25fa168c03f 100644
--- a/indra/newview/llfloaterdirectory.h
+++ b/indra/newview/llfloaterdirectory.h
@@ -96,6 +96,7 @@ class LLFloaterDirectory : public LLFloater
 	LLFloaterDirectory(const Params& key);
 	BOOL postBuild() override;
 	void onOpen(const LLSD& key) override;
+	void onClose(bool app_quitting) override;
 	
 	static void processSearchPeopleReply(LLMessageSystem* msg, void**);
 	static void processSearchGroupsReply(LLMessageSystem* msg, void**);
diff --git a/indra/newview/skins/default/xui/en/panel_search_classifieds.xml b/indra/newview/skins/default/xui/en/panel_search_classifieds.xml
index 7af7ac76a94195a67acdfa65fe511ab7a4816673..a865121b618f1e72219ca92d89f24058d41cd9cd 100644
--- a/indra/newview/skins/default/xui/en/panel_search_classifieds.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_classifieds.xml
@@ -3,7 +3,8 @@
  height="70"
  layout="topleft"
  name="panel_search_classifieds"
- width="602">
+ width="602"
+ default_tab_group="2">
   <text
    follows="left|top|right"
    height="16"
@@ -80,6 +81,7 @@
    top_delta="-1"
    width="18"/>
   <search_editor
+   tab_group="2"
    follows="top|left|right"
    search_button_visible="true"
    height="22"
diff --git a/indra/newview/skins/default/xui/en/panel_search_events.xml b/indra/newview/skins/default/xui/en/panel_search_events.xml
index dbe5739bbf701ba1bc28ab402adbfd73d4177dd4..407eaf6486a0fc4d24a03b249002f89c7274f1fe 100644
--- a/indra/newview/skins/default/xui/en/panel_search_events.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_events.xml
@@ -3,7 +3,8 @@
  height="70"
  layout="topleft"
  name="panel_search_events"
- width="602">
+ width="602"
+ default_tab_group="2">
   <text
    follows="left|top"
    height="16"
@@ -151,6 +152,7 @@
    top_delta="-1"
    width="18"/>
   <search_editor
+   tab_group="2"
    follows="top|left|right"
    search_button_visible="true"
    height="22"
diff --git a/indra/newview/skins/default/xui/en/panel_search_groups.xml b/indra/newview/skins/default/xui/en/panel_search_groups.xml
index 3fd136702897b30b9b178ea8ef6db3b28bc2c8d6..78e531ca2fc354161acaa5df8039b58f59b9fb58 100644
--- a/indra/newview/skins/default/xui/en/panel_search_groups.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_groups.xml
@@ -3,7 +3,8 @@
  height="70"
  layout="topleft"
  name="panel_search_groups"
- width="602">
+ width="602"
+ default_tab_group="2">
   <text
    follows="left|top|right"
    height="16"
@@ -80,6 +81,7 @@
    top_delta="-1"
    width="18"/>
   <search_editor
+   tab_group="2"
    follows="top|left|right"
    search_button_visible="true"
    height="22"
diff --git a/indra/newview/skins/default/xui/en/panel_search_people.xml b/indra/newview/skins/default/xui/en/panel_search_people.xml
index addd20ff739ee3eccb085711d406ba6ad226d759..98387dbd9a2f18aada111dbf62fa904008499c05 100644
--- a/indra/newview/skins/default/xui/en/panel_search_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_people.xml
@@ -3,7 +3,8 @@
  height="70"
  class="panel_search_people"
  name="panel_search_people"
- width="602">
+ width="602"
+ default_tab_group="2">
   <panel.string name="SeachFilteredOnShortWordsEmpty">
    Your search terms were too short so no search was performed.
   </panel.string>
@@ -17,6 +18,7 @@
    value="Enter search terms:"
    width="255" />
   <search_editor
+   tab_group="2"
    follows="top|left|right"
    search_button_visible="true"
    height="22"
diff --git a/indra/newview/skins/default/xui/en/panel_search_places.xml b/indra/newview/skins/default/xui/en/panel_search_places.xml
index fabc2c6bbaaacaa7048d3ce05c47ce17e259356a..94ae80a1576933b64eeae4bd6547b57632c96921 100644
--- a/indra/newview/skins/default/xui/en/panel_search_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_places.xml
@@ -3,7 +3,8 @@
  height="70"
  layout="topleft"
  name="panel_search_places"
- width="602">
+ width="602"
+ default_tab_group="2">
   <text
    follows="left|top|right"
    height="16"
@@ -80,6 +81,7 @@
    top_delta="-1"
    width="18"/>
   <search_editor
+   tab_group="2"
    follows="top|left|right"
    search_button_visible="true"
    height="22"
diff --git a/indra/newview/skins/default/xui/en/panel_search_web.xml b/indra/newview/skins/default/xui/en/panel_search_web.xml
index c160728e735bd2ff26b91a2eb2d0d00bd2b61357..81cb9067db204685ce625dbfae92b9b87c36d1b9 100644
--- a/indra/newview/skins/default/xui/en/panel_search_web.xml
+++ b/indra/newview/skins/default/xui/en/panel_search_web.xml
@@ -4,7 +4,8 @@
  layout="topleft"
  follows="all"
  name="panel_search_web"
- width="780">
+ width="780"
+ default_tab_group="2">
   <layout_stack
     bottom="775"
     follows="all"
@@ -25,6 +26,7 @@
       auto_resize="true"
       width="585">
       <web_browser
+        tab_group="2"
         bottom="-2"
         follows="all"
         layout="topleft"