diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 06781f1bdf3986ce9862e9a06c8b1de4e153d5c4..02ac928dfb5962aa2a4da1c16e4539f80a0be55b 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -554,6 +554,16 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
 	return TRUE;
 }
 
+void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
+{
+	overlay_width = mImageOverlay->getWidth();
+	overlay_height = mImageOverlay->getHeight();
+
+	F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f);
+	overlay_width = llround((F32)overlay_width * scale_factor);
+	overlay_height = llround((F32)overlay_height * scale_factor);
+}
+
 
 // virtual
 void LLButton::draw()
@@ -781,12 +791,10 @@ void LLButton::draw()
 	if (mImageOverlay.notNull())
 	{
 		// get max width and height (discard level 0)
-		S32 overlay_width = mImageOverlay->getWidth();
-		S32 overlay_height = mImageOverlay->getHeight();
+		S32 overlay_width;
+		S32 overlay_height;
 
-		F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f);
-		overlay_width = llround((F32)overlay_width * scale_factor);
-		overlay_height = llround((F32)overlay_height * scale_factor);
+		getOverlayImageSize(overlay_width, overlay_height);
 
 		S32 center_x = getLocalRect().getCenterX();
 		S32 center_y = getLocalRect().getCenterY();
@@ -994,11 +1002,15 @@ void LLButton::resize(LLUIString label)
 		S32 min_width = label_width + mLeftHPad + mRightHPad;
 		if (mImageOverlay)
 		{
+			S32 overlay_width = mImageOverlay->getWidth();
+			F32 scale_factor = getRect().getHeight() / (F32)mImageOverlay->getHeight();
+			overlay_width = llround((F32)overlay_width * scale_factor);
+
 			switch(mImageOverlayAlignment)
 			{
 			case LLFontGL::LEFT:
 			case LLFontGL::RIGHT:
-				min_width += mImageOverlay->getWidth() + mImgOverlayLabelSpace;
+				min_width += overlay_width + mImgOverlayLabelSpace;
 				break;
 			case LLFontGL::HCENTER:
 				break;
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index bc5e69fad54f58298d10a8524c653a885bd56882..08b45e01b33e7b3f3d790fc7cacfebb3405e8a84 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -270,6 +270,7 @@ class LLButton
 protected:
 	LLPointer<LLUIImage> getImageUnselected() const	{ return mImageUnselected; }
 	LLPointer<LLUIImage> getImageSelected() const	{ return mImageSelected; }
+	void getOverlayImageSize(S32& overlay_width, S32& overlay_height);
 
 	LLFrameTimer	mMouseDownTimer;
 
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 790025cb2dcd8397e4b9e72f5632208aa2dcd6cc..ab1c87caffeb571417a5c003d1045a3ab26ff841 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -96,9 +96,6 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder
 		Params();
 	};
 
-	// valid children for LLPanel are stored in this registry
-	typedef LLDefaultChildRegistry child_registry_t;
-
 protected:
 	friend class LLUICtrlFactory;
 	// RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8
diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp
index c3a51c36c94a037c3a5c3a408066ac08307c4567..942e84eeb6570302226494d8065f181c45db1fcb 100644
--- a/indra/llui/llresizehandle.cpp
+++ b/indra/llui/llresizehandle.cpp
@@ -55,6 +55,8 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p)
 	mImage( NULL ),
 	mMinWidth( p.min_width ),
 	mMinHeight( p.min_height ),
+	mMaxWidth(S32_MAX),
+	mMaxHeight(S32_MAX),
 	mCorner( p.corner )
 {
 	if( RIGHT_BOTTOM == mCorner)
@@ -177,6 +179,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
 				new_width = mMinWidth;
 				delta_x = x_multiple * (mMinWidth - orig_rect.getWidth());
 			}
+			else if (new_width > mMaxWidth)
+			{
+				new_width = mMaxWidth;
+				delta_x = x_multiple * (mMaxWidth - orig_rect.getWidth());
+			}
 
 			S32 new_height = orig_rect.getHeight() + y_multiple * delta_y;
 			if( new_height < mMinHeight )
@@ -184,6 +191,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
 				new_height = mMinHeight;
 				delta_y = y_multiple * (mMinHeight - orig_rect.getHeight());
 			}
+			else if (new_height > mMaxHeight)
+			{
+				new_height = mMaxHeight;
+				delta_y = y_multiple * (mMaxHeight - orig_rect.getHeight());
+			}
 
 			switch( mCorner )
 			{
diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h
index 531eb1db618b477b4bc197ab8f0f4318ad68401e..5cfe3fb63c933120a1f5b8da563973218831f301 100644
--- a/indra/llui/llresizehandle.h
+++ b/indra/llui/llresizehandle.h
@@ -56,6 +56,9 @@ class LLResizeHandle : public LLView
 
 	void			setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; }
 
+	void			setMaxWidth(S32 width) { mMaxWidth = width;}
+	void			setMaxHeight(S32 height) { mMaxHeight = height;}
+
 private:
 	BOOL			pointInHandle( S32 x, S32 y );
 
@@ -66,7 +69,9 @@ class LLResizeHandle : public LLView
 	LLCoordGL		mLastMouseDir;
 	LLPointer<LLUIImage>	mImage;
 	S32				mMinWidth;
+	S32				mMaxWidth;
 	S32				mMinHeight;
+	S32				mMaxHeight;
 	const ECorner	mCorner;
 };
 
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 8249df3e9d961d8208f62051e7288bc2ff58a6f2..677d50a0c75ac8ad19aee9ece65ce103359cdd0d 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -30,6 +30,7 @@
 #include <boost/foreach.hpp>
 #include "lltoolbar.h"
 
+#include "llcommandmanager.h"
 #include "llmenugl.h"
 #include "lltrans.h"
 
@@ -206,8 +207,8 @@ bool LLToolBar::addCommand(const LLCommandId& commandId)
 
 	if (add_command)
 	{
-		mButtonCommands.push_back(commandId);
-		createButtons();
+	mButtonCommands.push_back(commandId);
+	createButtons();
 	}
 
 	return add_command;
@@ -251,7 +252,9 @@ bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled)
 
 BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
 {
-	BOOL handle_it_here = !mReadOnly;
+	LLRect button_panel_rect;
+	mButtonPanel->localRectToOtherView(mButtonPanel->getLocalRect(), &button_panel_rect, this);
+	BOOL handle_it_here = !mReadOnly && button_panel_rect.pointInRect(x, y);
 
 	if (handle_it_here)
 	{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 7a1b2e4ba047872aee08b9cd79347ddc9f170326..9039366e7e3ab5eb2414c33521666c73bf3e1416 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -95,9 +95,6 @@ class LLViewDrawContext
 	static std::vector<LLViewDrawContext*> sDrawContextStack;
 };
 
-class LLViewWidgetRegistry : public LLChildRegistry<LLViewWidgetRegistry>
-{};
-
 class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElement
 {
 public:
@@ -150,7 +147,8 @@ class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElem
 		Params();
 	};
 
-	typedef LLViewWidgetRegistry child_registry_t;
+	// most widgets are valid children of LLView
+	typedef LLDefaultChildRegistry child_registry_t;
 
 	void initFromParams(const LLView::Params&);
 
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index cf0374075a26477e87aeb7a7d1355890e94d7661..fb3abb132b716bd9f581eecb82e8c5ccbe013338 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -95,7 +95,7 @@ LLChatBar::LLChatBar()
 	mGestureCombo(NULL),
 	mObserver(NULL)
 {
-	setIsChrome(TRUE);
+	//setIsChrome(TRUE);
 }
 
 
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4de69765343f56bd2fcc1238bf4f23494e715358..4602533736140d877c71962cec8ac553ae87d9db 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2449,8 +2449,10 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
 
 		LLChat chat(message);
 		chat.mSourceType = CHAT_SOURCE_SYSTEM;
+		
+		LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+		LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
 
-		LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
 		if(nearby_chat)
 		{
 			nearby_chat->addMessage(chat);
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 8d57ae3a3275792e8607d05c6516bf2c3b96471a..07e94f957aee08982bdce27651ff703193fba491 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -57,11 +57,13 @@
 
 static const S32 RESIZE_BAR_THICKNESS = 3;
 
-LLNearbyChat::LLNearbyChat(const LLSD& key) 
-	: LLFloater(key)
+
+static LLRegisterPanelClassWrapper<LLNearbyChat> t_panel_nearby_chat("panel_nearby_chat");
+
+LLNearbyChat::LLNearbyChat() 
+	: LLPanel()
 	,mChatHistory(NULL)
 {
-	
 }
 
 LLNearbyChat::~LLNearbyChat()
@@ -86,29 +88,12 @@ BOOL LLNearbyChat::postBuild()
 
 	mChatHistory = getChild<LLChatHistory>("chat_history");
 
-	if(!LLFloater::postBuild())
+	if(!LLPanel::postBuild())
 		return false;
-
-	if (mDragHandle)
-		mDragHandle->setTitleVisible(TRUE);
-
+	
 	return true;
 }
 
-
-void    LLNearbyChat::applySavedVariables()
-{
-	if (mRectControl.size() > 1)
-	{
-		const LLRect& rect = LLFloater::getControlGroup()->getRect(mRectControl);
-		if(!rect.isEmpty() && rect.isValid())
-		{
-			reshape(rect.getWidth(), rect.getHeight());
-			setRect(rect);
-		}
-	}
-}
-
 std::string appendTime()
 {
 	time_t utc_time;
@@ -204,18 +189,9 @@ void	LLNearbyChat::setVisible(BOOL visible)
 		}
 	}
 
-	LLFloater::setVisible(visible);
+	LLPanel::setVisible(visible);
 }
 
-void	LLNearbyChat::onOpen(const LLSD& key )
-{
-	LLFloater::onOpen(key);
-}
-
-void LLNearbyChat::setRect	(const LLRect &rect)
-{
-	LLFloater::setRect(rect);
-}
 
 void LLNearbyChat::getAllowedRect(LLRect& rect)
 {
@@ -238,9 +214,9 @@ void LLNearbyChat::updateChatHistoryStyle()
 //static 
 void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
 {
-	LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
-	if(nearby_chat)
-		nearby_chat->updateChatHistoryStyle();
+	//LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+	//if(nearby_chat)
+	//	nearby_chat->updateChatHistoryStyle();
 }
 
 bool isWordsName(const std::string& name)
@@ -314,7 +290,8 @@ void LLNearbyChat::loadHistory()
 //static
 LLNearbyChat* LLNearbyChat::getInstance()
 {
-	return LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+	LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+	return chat_bar->findChild<LLNearbyChat>("nearby_chat");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -342,7 +319,7 @@ BOOL	LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask)
 	
 	if(mChatHistory)
 		mChatHistory->setFocus(TRUE);
-	return LLFloater::handleMouseDown(x, y, mask);
+	return LLPanel::handleMouseDown(x, y, mask);
 }
 
 void LLNearbyChat::draw()
@@ -355,5 +332,5 @@ void LLNearbyChat::draw()
 		setTransparencyType(hasFocus() ? TT_ACTIVE : TT_INACTIVE);
 	}
 
-	LLFloater::draw();
+	LLPanel::draw();
 }
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index 834a31bbf043acf9014392881f1ec34787836a27..5ef584c8ff3a957c34b835f6cb3734d70be3dedf 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -34,10 +34,10 @@
 class LLResizeBar;
 class LLChatHistory;
 
-class LLNearbyChat: public LLFloater
+class LLNearbyChat: public LLPanel
 {
 public:
-	LLNearbyChat(const LLSD& key);
+	LLNearbyChat();
 	~LLNearbyChat();
 
 	BOOL	postBuild			();
@@ -54,12 +54,8 @@ class LLNearbyChat: public LLFloater
 	/*virtual*/ void	onFocusLost();
 	/*virtual*/ void	onFocusReceived();
 	
-	/*virtual*/ void	onOpen	(const LLSD& key);
-
 	/*virtual*/ void	setVisible(BOOL visible);
-
-	virtual void setRect		(const LLRect &rect);
-
+	
 	virtual void updateChatHistoryStyle();
 
 	static void processChatHistoryStyleUpdate(const LLSD& newvalue);
@@ -69,7 +65,6 @@ class LLNearbyChat: public LLFloater
 	static LLNearbyChat* getInstance();
 
 private:
-	virtual void    applySavedVariables();
 
 	void	getAllowedRect		(LLRect& rect);
 
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 185acb14148a551dae301a98be6c93c586095184..258aa9a8bf660d043aafe9504d48a68712f74a88 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -49,6 +49,8 @@
 #include "llrootview.h"
 #include "llviewerchat.h"
 
+#include "llresizehandle.h"
+
 S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;
 
 // legacy callback glue
@@ -414,8 +416,7 @@ LLCtrlListInterface* LLGestureComboList::getListInterface()
 LLNearbyChatBar::LLNearbyChatBar(const LLSD& key)
 	: LLFloater(key),
 	mChatBox(NULL)
-{
-	mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
+{	mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
 }
 
 //virtual
@@ -437,6 +438,10 @@ BOOL LLNearbyChatBar::postBuild()
 	mChatBox->setEnableLineHistory(TRUE);
 	mChatBox->setFont(LLViewerChat::getChatFont());
 
+
+	LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat");
+	show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this));
+
 	mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator");
 	mOutputMonitor->setVisible(FALSE);
 
@@ -678,6 +683,25 @@ void LLNearbyChatBar::sendChat( EChatType type )
 	}
 }
 
+
+void LLNearbyChatBar::onToggleNearbyChatPanel()
+{
+	LLView* nearby_chat = getChildView("nearby_chat");
+
+	if (nearby_chat->getVisible())
+	{
+		nearby_chat->setVisible(FALSE);
+		reshape(getRect().getWidth(), 60);
+		mResizeHandle[0]->setMaxHeight(60);
+	}
+	else
+	{
+		nearby_chat->setVisible(TRUE);
+		reshape(getRect().getWidth(), 360);
+		mResizeHandle[0]->setMaxHeight(S32_MAX);
+	}
+}
+
 void LLNearbyChatBar::onChatBoxCommit()
 {
 	if (mChatBox->getText().length() > 0)
@@ -781,6 +805,7 @@ void LLNearbyChatBar::startChat(const char* line)
 		return;
 
 	cb->setVisible(TRUE);
+	cb->setFocus(TRUE);
 	cb->mChatBox->setFocus(TRUE);
 
 	if (line)
@@ -812,15 +837,6 @@ void LLNearbyChatBar::stopChat()
  	gAgent.stopTyping();
 }
 
-void LLNearbyChatBar::onClose(bool app_quitting)
-{
-	LLFloater* nearby_chat = LLFloaterReg::findInstance("nearby_chat", LLSD());
-	if (nearby_chat)
-	{
-		nearby_chat->closeFloater(app_quitting);
-	}
-}
-
 // If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20.
 // Otherwise returns input and channel 0.
 LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index f4a8605e18ec5f2efa964c63c289bb1304d527a2..1d28a21ef3c386ec467e0e20058681c8aa0104b6 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -108,8 +108,6 @@ class LLNearbyChatBar
 
 	virtual void draw();
 
-	virtual void onClose(bool app_quitting);
-
 	std::string getCurrentChat();
 	virtual BOOL handleKeyHere( KEY key, MASK mask );
 
@@ -129,6 +127,8 @@ class LLNearbyChatBar
 	void onChatBoxCommit();
 	void onChatFontChange(LLFontGL* fontp);
 
+	void onToggleNearbyChatPanel();
+
 	static LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
 	EChatType processChatTypeTriggers(EChatType type, std::string &str);
 
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 957b6d5f94fc6d8498fd6e4a4dcd441d36da9573..dcf444b048c4129109d232238a830946ad787c2b 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -41,6 +41,7 @@
 
 #include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance
 #include "llviewerwindow.h"//for screen channel position
+#include "llnearbychatbar.h"
 
 //add LLNearbyChatHandler to LLNotificationsUI namespace
 using namespace LLNotificationsUI;
@@ -473,8 +474,9 @@ LLNearbyChatHandler::~LLNearbyChatHandler()
 
 void LLNearbyChatHandler::initChannel()
 {
-	LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
-	LLView* chat_box = LLBottomTray::getInstance()->getChildView("chat_box");
+	LLNearbyChatBar* chat_bar = LLFloaterReg::getTypedInstance<LLNearbyChatBar>("chat_bar", LLSD());
+	LLView* chat_box = chat_bar->getChatBox();
+	LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 	S32 channel_right_bound = nearby_chat->getRect().mRight;
 	mChannel->init(chat_box->getRect().mLeft, channel_right_bound);
 }
@@ -502,7 +504,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not
 			tmp_chat.mText = tmp_chat.mText.substr(3);
 	}
 
-	LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+	LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+
+	LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
+
 	{
 		//sometimes its usefull to have no name at all...
 		//if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null)
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index de90023f3b8bd2bbcf95e605ef47bba7870dfddc..1b767e80d4232d00a4be3e04f6f1a8eb607298c1 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -385,7 +385,7 @@ void LLHandlerUtil::logGroupNoticeToIMGroup(
 // static
 void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type)
 {
-	LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+	LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 	if(nearby_chat)
 	{
 		LLChat chat_msg(notification->getMessage());
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index 02b217fc9430736d143477bac3c537d4d52e7195..2a08a29842aeea07d00eb85c14a8c04a50bb2ab5 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -92,8 +92,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
 			LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM);
 
 			// don't show toast if Nearby Chat is opened
-			LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<
-					LLNearbyChat>("nearby_chat", LLSD());
+			LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 			if (nearby_chat->getVisible())
 			{
 				return false;
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 09a50300d0425590521ae5c8ae9e235cfef265a8..0b3b8e23a51c60288c67076838eeb91375b7c6d7 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -182,7 +182,6 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
 
 	LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>);
-	LLFloaterReg::add("nearby_chat", "floater_nearby_chat.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>);
 	LLFloaterReg::add("chat_bar", "floater_chat_bar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChatBar>);
 
 	LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index e5877dcf3af2e8ae267ba1634763d1f7f6eb6654..5665a68addf356e0b731180df741dbde9d948464 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2189,7 +2189,7 @@ void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string m
 	// Treat like a system message and put in chat history.
 	chat.mText = av_name.getCompleteName() + ": " + message;
 
-	LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+	LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 	if(nearby_chat)
 	{
 		nearby_chat->addMessage(chat);
@@ -2751,7 +2751,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 
 			// Note: lie to Nearby Chat, pretending that this is NOT an IM, because
 			// IMs from obejcts don't open IM sessions.
-			LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+			LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 			if(SYSTEM_FROM != name && nearby_chat)
 			{
 				chat.mOwnerID = from_id;
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index d0059b281e3450e1febd7c65817e21caaab60f61..9d61c94eb142e80333d0d63991f8a76fccac41c9 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -3,16 +3,27 @@
  height="60"
  layout="topleft"
  legacy_header_height="20"
+ single_instance="true"
  title="Nearby chat"
+ save_rect="true"
  can_close="true"
  can_minimize="true"
  help_topic="chat_bar"
- save_rect="true"
  min_height="60"
  min_width="150"
  can_resize="true"
  name="chat_bar"
  width="380">
+    <panel
+        top="20"
+        class="panel_nearby_chat"
+        follow="all"
+        width="380"
+        height="0"
+        visible="false"
+        filename="panel_nearby_chat.xml"
+        name="nearby_chat" />
+    <panel width="380" height="31" left="0" bottom="-1" follows="left|right|bottom">
     <line_editor
      border_style="line"
      border_thickness="1"
@@ -27,7 +38,7 @@
      text_pad_left="5"
      text_pad_right="25"
      tool_tip="Press Enter to say, Ctrl+Enter to shout"
-     top="27"
+     top="0"
      width="335" />
     <output_monitor
      auto_update="true"
@@ -38,14 +49,14 @@
      left_pad="-24"
      mouse_opaque="true"
      name="chat_zone_indicator"
-     top="31"
+     top="4"
      visible="true"
      width="20" />
     <button
      follows="right"
      is_toggle="true"
      width="20"
-     top="27"
+     top="0"
      layout="topleft"
      left_pad="12"
      image_disabled="ComboButton_UpOff"
@@ -56,8 +67,6 @@
      height="23"
      name="show_nearby_chat"
      tool_tip="Shows/hides nearby chat log">
-        <button.init_callback
-           function="Button.SetDockableFloaterToggle"
-           parameter="nearby_chat" />
     </button>
+    </panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f766236b2e9c1f945562ff672212ead91eb9cf6f
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel
+ height="300"
+ follows="all"
+ layout="topleft"
+ name="nearby_chat"
+ help_topic="nearby_chat"
+ width="320">
+            <check_box
+             bottom_delta="36"
+             control_name="TranslateChat"
+             enabled="true"
+             height="16"
+             label="Translate chat (powered by Google)"
+             layout="topleft"
+             left="5"
+             name="translate_chat_checkbox"
+             width="230" />
+  <chat_history
+    parse_urls="true"
+    bg_readonly_color="ChatHistoryBgColor"
+    bg_writeable_color="ChatHistoryBgColor"
+    follows="all"
+    left="5"
+    top_delta="17"
+    layout="topleft"
+    height="260"
+    name="chat_history"
+    parse_highlights="true"
+    text_color="ChatHistoryTextColor"
+    text_readonly_color="ChatHistoryTextColor"
+    right_widget_pad="5"
+    left_widget_pad="0"
+    width="315" />
+</panel>