diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index eaf128423731da22add5a012daaaea3dd4acfe71..1034a219052f29b45ba4be46885f837573ec7c5d 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -977,7 +977,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
 		LLRect screen_rect;
 		localRectToScreen(child->getRect(),&screen_rect);
 		
-		if ( root_rect.overlaps(screen_rect)  && LLUI::sDirtyRect.overlaps(screen_rect))
+		if ( root_rect.overlaps(screen_rect)  && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect))
 		{
 			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 6b7a8a8b860021a83a474a34944bb4aebf0ca257..27444b7f5b961c127558f9f124cd9c6de9689494 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -90,8 +90,8 @@ LLButton::Params::Params()
 	image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f),
 	image_overlay_selected_color("image_overlay_selected_color", LLColor4::white),
 	flash_color("flash_color"),
-	pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")),
-	pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")),
+	pad_right("pad_right", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")),
+	pad_left("pad_left", LLUI::getInstance()->mSettingGroups["config"]->getS32("ButtonHPad")),
 	pad_bottom("pad_bottom"),
 	click_callback("click_callback"),
 	mouse_down_callback("mouse_down_callback"),
@@ -614,7 +614,7 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
 // virtual
 void LLButton::draw()
 {
-	static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);
+	static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::getInstance()->mSettingGroups["config"], "EnableButtonFlashing", true);
 	F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
 
 	bool pressed_by_keyboard = FALSE;
@@ -628,7 +628,7 @@ void LLButton::draw()
 	{
 		S32 local_mouse_x ;
 		S32 local_mouse_y;
-		LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
+		LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
 		mouse_pressed_and_over = pointInView(local_mouse_x, local_mouse_y);
 	}
 
@@ -1261,10 +1261,10 @@ void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname)
 	// search back through the button's parents for a panel
 	// with a help_topic string defined
 	std::string help_topic;
-	if (LLUI::sHelpImpl &&
+	if (LLUI::getInstance()->mHelpImpl &&
 	    ctrl->findHelpTopic(help_topic))
 	{
-		LLUI::sHelpImpl->showTopic(help_topic);
+		LLUI::getInstance()->mHelpImpl->showTopic(help_topic);
 		return; // success
 	}
 
diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp
index dac001afabcf757be529aa00b85cd4b0491f021e..c50657612621d16b94134f7c49e1315eb0b019ee 100644
--- a/indra/llui/llchatentry.cpp
+++ b/indra/llui/llchatentry.cpp
@@ -201,7 +201,7 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
@@ -225,7 +225,7 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index b2ad38bddfb8e278112e0aaa2798eb763b29660e..c7f0326ed49f324b6d95187a444c365df1fc4489 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -668,7 +668,7 @@ void LLComboBox::showList()
 	mButton->setToggleState(TRUE);
 	mList->setVisible(TRUE);
 	
-	LLUI::addPopup(this);
+	LLUI::getInstance()->addPopup(this);
 
 	setUseBoundingRect(TRUE);
 //	updateBoundingRect();
@@ -694,7 +694,7 @@ void LLComboBox::hideList()
 		mList->mouseOverHighlightNthItem(-1);
 
 		setUseBoundingRect(FALSE);
-		LLUI::removePopup(this);
+		LLUI::getInstance()->removePopup(this);
 //		updateBoundingRect();
 	}
 }
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index 26ae31cac660fbe4c0c1ef4909f2392bf00181a7..5f50e462336424cc88dfcf0473d9a09f01c3c7dc 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -68,7 +68,7 @@ LLConsole::LLConsole(const LLConsole::Params& p)
 		setFontSize(p.font_size_index);
 	}
 	mFadeTime = mLinePersistTime - FADE_DURATION;
-	setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines"));
+	setMaxLines(LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines"));
 }
 
 void LLConsole::setLinePersistTime(F32 seconds)
@@ -180,7 +180,7 @@ void LLConsole::draw()
 
 	LLUIImagePtr imagep = LLUI::getUIImage("transparent");
 
-	F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);
+	F32 console_opacity = llclamp(LLUI::getInstance()->mSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);
 	LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground");
 	color.mV[VALPHA] *= console_opacity;
 
diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h
index 5ff05698b05b39cf5d95b463c56ef0071cae6e4f..04f5e716099335bf0495e1a0cf482116ef46f8ec 100644
--- a/indra/llui/llconsole.h
+++ b/indra/llui/llconsole.h
@@ -51,7 +51,7 @@ class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracke
 		Optional<F32>	persist_time;
 		Optional<S32>	font_size_index;
 		Params()
-		:	max_lines("max_lines", LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")),
+		:	max_lines("max_lines", LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines")),
 			persist_time("persist_time", 0.f), // forever
 			font_size_index("font_size_index")
 		{
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index 6d9c429b083b0775a3a3bc8d0d8f01fb8f734a6b..39793316f438db32e90ebaf0fcd3fba7b982e4d3 100644
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -40,10 +40,10 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
 	// By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
 	// Due to Timer is implemented as derived class from EventTimer it is impossible to change period
 	// in runtime. So, both settings are made as required restart.
-	mFlashCount = 2 * ((count > 0) ? count : LLUI::sSettingGroups["config"]->getS32("FlashCount"));
+	mFlashCount = 2 * ((count > 0) ? count : LLUI::getInstance()->mSettingGroups["config"]->getS32("FlashCount"));
 	if (mPeriod <= 0)
 	{
-		mPeriod = LLUI::sSettingGroups["config"]->getF32("FlashPeriod");
+		mPeriod = LLUI::getInstance()->mSettingGroups["config"]->getF32("FlashPeriod");
 	}
 }
 
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a245dd8f78b61aff032d15744d9496b237ccb92a..42802cd339cfece764cf1f62079919bcef0ebb86 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -215,14 +215,14 @@ void LLFloater::initClass()
 		sButtonToolTips[i] = LLTrans::getString( sButtonToolTipsIndex[i] );
 	}
 
-	LLControlVariable* ctrl = LLUI::sSettingGroups["config"]->getControl("ActiveFloaterTransparency").get();
+    LLControlVariable* ctrl = LLUI::getInstance()->mSettingGroups["config"]->getControl("ActiveFloaterTransparency").get();
 	if (ctrl)
 	{
 		ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency));
 		updateActiveFloaterTransparency();
 	}
 
-	ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get();
+    ctrl = LLUI::getInstance()->mSettingGroups["config"]->getControl("InactiveFloaterTransparency").get();
 	if (ctrl)
 	{
 		ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency));
@@ -374,13 +374,13 @@ void LLFloater::layoutDragHandle()
 // static
 void LLFloater::updateActiveFloaterTransparency()
 {
-	sActiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
+    sActiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("ActiveFloaterTransparency");
 }
 
 // static
 void LLFloater::updateInactiveFloaterTransparency()
 {
-	sInactiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
+    sInactiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("InactiveFloaterTransparency");
 }
 
 void LLFloater::addResizeCtrls()
@@ -579,7 +579,7 @@ std::string LLFloater::getControlName(const std::string& name, const LLSD& key)
 LLControlGroup*	LLFloater::getControlGroup()
 {
 	// Floater size, position, visibility, etc are saved in per-account settings.
-	return LLUI::sSettingGroups["account"];
+	return LLUI::getInstance()->mSettingGroups["account"];
 }
 
 void LLFloater::setVisible( BOOL visible )
@@ -592,7 +592,7 @@ void LLFloater::setVisible( BOOL visible )
 
 	if( !visible )
 	{
-		LLUI::removePopup(this);
+		LLUI::getInstance()->removePopup(this);
 
 		if( gFocusMgr.childHasMouseCapture( this ) )
 		{
@@ -818,7 +818,7 @@ void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
 
 void LLFloater::releaseFocus()
 {
-	LLUI::removePopup(this);
+	LLUI::getInstance()->removePopup(this);
 
 	setFocus(FALSE);
 
@@ -1771,13 +1771,13 @@ void LLFloater::onClickDock(LLFloater* self)
 // static
 void LLFloater::onClickHelp( LLFloater* self )
 {
-	if (self && LLUI::sHelpImpl)
+	if (self && LLUI::getInstance()->mHelpImpl)
 	{
 		// find the current help context for this floater
 		std::string help_topic;
 		if (self->findHelpTopic(help_topic))
 		{
-			LLUI::sHelpImpl->showTopic(help_topic);
+			LLUI::getInstance()->mHelpImpl->showTopic(help_topic);
 		}
 	}
 }
@@ -2931,7 +2931,7 @@ void LLFloaterView::syncFloaterTabOrder()
 	if (modal_dialog)
 	{
 		// If we have a visible modal dialog, make sure that it has focus
-		LLUI::addPopup(modal_dialog);
+		LLUI::getInstance()->addPopup(modal_dialog);
 		
 		if( !gFocusMgr.childHasKeyboardFocus( modal_dialog ) )
 		{
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 9ef290abc024cd6629c876d12bad94ad768611b2..85e07fc6a6a0f2a3dd2a41c61e4bae891db5422b 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -445,7 +445,7 @@ void LLFloaterReg::registerControlVariables()
 		}
 	}
 
-	const LLSD& exclude_list = LLUI::sSettingGroups["config"]->getLLSD("always_showable_floaters");
+	const LLSD& exclude_list = LLUI::getInstance()->mSettingGroups["config"]->getLLSD("always_showable_floaters");
 	for (LLSD::array_const_iterator iter = exclude_list.beginArray();
 		iter != exclude_list.endArray();
 		iter++)
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 1b213c34186e7ee4d08ba30d5a04a3eab24d1877..7b0a6cbdaeb4124a93c19a3d534dfbc428737b54 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -183,7 +183,7 @@ void LLFocusMgr::releaseFocusIfNeeded( LLView* view )
 		}
 	}
 
-	LLUI::removePopup(view);
+	LLUI::getInstance()->removePopup(view);
 }
 
 void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL keystrokes_only)
@@ -481,7 +481,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus)
 	// release focus from "top ctrl"s, which generally hides them
 	if (!focus)
 	{
-		LLUI::clearPopups();
+		LLUI::getInstance()->clearPopups();
 	}
 	mAppHasFocus = focus; 
 }
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 895753aeae6394edc6e1383db58065a2ae593873..b05a9807d0801f8af5747d14fe07ea1d39e5aa8e 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -338,7 +338,7 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
 void LLFolderView::filter( LLFolderViewFilter& filter )
 {
 	LL_RECORD_BLOCK_TIME(FTM_FILTER);
-    filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
+    filter.resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
 
     // Note: we filter the model, not the view
 	getViewModelItem()->filter(filter);
@@ -657,7 +657,7 @@ void LLFolderView::draw()
 		closeAutoOpenedFolders();
 	}
 
-	if (mSearchTimer.getElapsedTimeF32() > LLUI::sSettingGroups["config"]->getF32("TypeAheadTimeout") || !mSearchString.size())
+	if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout") || !mSearchString.size())
 	{
 		mSearchString.clear();
 	}
@@ -733,7 +733,7 @@ void LLFolderView::closeRenamer( void )
 	if (mRenamer && mRenamer->getVisible())
 	{
 		// Triggers onRenamerLost() that actually closes the renamer.
-		LLUI::removePopup(mRenamer);
+		LLUI::getInstance()->removePopup(mRenamer);
 	}
 }
 
@@ -1064,7 +1064,7 @@ void LLFolderView::startRenamingSelectedItem( void )
 		// set focus will fail unless item is visible
 		mRenamer->setFocus( TRUE );
 		mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this));
-		LLUI::addPopup(mRenamer);
+		LLUI::getInstance()->addPopup(mRenamer);
 	}
 }
 
@@ -1321,7 +1321,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
 		}
 
 		//do text search
-		if (mSearchTimer.getElapsedTimeF32() > LLUI::sSettingGroups["config"]->getF32("TypeAheadTimeout"))
+		if (mSearchTimer.getElapsedTimeF32() > LLUI::getInstance()->mSettingGroups["config"]->getF32("TypeAheadTimeout"))
 		{
 			mSearchString.clear();
 		}
@@ -1803,7 +1803,7 @@ void LLFolderView::updateRenamerPosition()
 		screenPointToLocal( x, y, &x, &y );
 		mRenamer->setOrigin( x, y );
 
-		LLRect scroller_rect(0, 0, (S32)LLUI::getWindowSize().mV[VX], 0);
+		LLRect scroller_rect(0, 0, (S32)LLUI::getInstance()->getWindowSize().mV[VX], 0);
 		if (mScrollContainer)
 		{
 			scroller_rect = mScrollContainer->getContentWindowRect();
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 0510e472c53da52dc8101da82ce3ecea17e01618..2de47f1a19152f0417b4b35f4ab6713ccaca55ec 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -548,7 +548,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
 
 BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
 {
-	static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold", 3);
+	static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::getInstance()->mSettingGroups["config"],"DragAndDropDistanceThreshold", 3);
 
 	mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight));
 
diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp
index 3363dc531652b54c66fb332efea086d20f928450..3b45fb53a2183ebfa99ea982aeae816e929dbe8e 100644
--- a/indra/llui/llfolderviewmodel.cpp
+++ b/indra/llui/llfolderviewmodel.cpp
@@ -48,7 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText()
 
 void LLFolderViewModelCommon::filter()
 {
-    getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100));
+    getFilter().resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100));
 	mFolderView->getViewModelItem()->filter(getFilter());
 }
 
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 955e7089f464d5b9ef43eab2dfcc9d58cb5e87d8..4a464b3507ccbd79c1b9cbf6099200ed5a7aa344 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -209,7 +209,7 @@ LLLayoutStack::Params::Params()
 	open_time_constant("open_time_constant", 0.02f),
 	close_time_constant("close_time_constant", 0.03f),
 	resize_bar_overlap("resize_bar_overlap", 1),
-	border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)),
+	border_size("border_size", LLCachedControl<S32>(*LLUI::getInstance()->mSettingGroups["config"], "UIResizeBarHeight", 0)),
 	show_drag_handle("show_drag_handle", false),
 	drag_handle_first_indent("drag_handle_first_indent", 0),
 	drag_handle_second_indent("drag_handle_second_indent", 0),
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index ff8bf3031900bd5b646b4f2bfb9b68f1291b307c..3ad504d68da3b88647774489ca83a45b83fbaae0 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -941,7 +941,7 @@ void LLLineEditor::removeChar()
 	}
 	else
 	{
-		LLUI::reportBadKeystroke();
+		LLUI::getInstance()->reportBadKeystroke();
 	}
 }
 
@@ -992,7 +992,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
 	}
 	else
 	{
-		LLUI::reportBadKeystroke();
+		LLUI::getInstance()->reportBadKeystroke();
 	}
 
 	getWindow()->hideCursorUntilMouseMove();
@@ -1088,7 +1088,7 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			break;
 
@@ -1104,7 +1104,7 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			break;
 
@@ -1184,7 +1184,7 @@ void LLLineEditor::cut()
 		if( need_to_rollback )
 		{
 			rollback.doRollback( this );
-			LLUI::reportBadKeystroke();
+			LLUI::getInstance()->reportBadKeystroke();
 		}
 		else
 		{
@@ -1288,7 +1288,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
 				}
 				// Truncate the clean string at the limit of what will fit
 				clean_string = clean_string.substr(0, wchars_that_fit);
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 
 			if (mMaxLengthChars)
@@ -1300,7 +1300,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
 					clean_string = clean_string.substr(0, available_chars);
 				}
 
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 
 			mText.insert(getCursor(), clean_string);
@@ -1312,7 +1312,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
 			if( need_to_rollback )
 			{
 				rollback.doRollback( this );
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			else
 			{
@@ -1376,7 +1376,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 		}
 		handled = TRUE;
@@ -1425,7 +1425,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
@@ -1452,7 +1452,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
@@ -1469,7 +1469,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
@@ -1486,7 +1486,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			}
 			else
 			{
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 			handled = TRUE;
 		}
@@ -1567,7 +1567,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask )
 			{
 				rollback.doRollback(this);
 
-				LLUI::reportBadKeystroke();
+				LLUI::getInstance()->reportBadKeystroke();
 			}
 
 			// Notify owner if requested
@@ -1623,7 +1623,7 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char)
 		{
 			rollback.doRollback( this );
 
-			LLUI::reportBadKeystroke();
+			LLUI::getInstance()->reportBadKeystroke();
 		}
 
 		// Notify owner if requested
@@ -1674,7 +1674,7 @@ void LLLineEditor::doDelete()
 		if( need_to_rollback )
 		{
 			rollback.doRollback( this );
-			LLUI::reportBadKeystroke();
+			LLUI::getInstance()->reportBadKeystroke();
 		}
 		else
 		{
@@ -2478,7 +2478,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 	{
 		LLRect control_rect_screen;
 		localRectToScreen(getRect(), &control_rect_screen);
-		LLUI::screenRectToGL(control_rect_screen, control);
+		LLUI::getInstance()->screenRectToGL(control_rect_screen, control);
 	}
 
 	S32 preedit_left_column, preedit_right_column;
@@ -2508,7 +2508,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 		S32 query_local = findPixelNearestPos(query - getCursor());
 		S32 query_screen_x, query_screen_y;
 		localPointToScreen(query_local, getRect().getHeight() / 2, &query_screen_x, &query_screen_y);
-		LLUI::screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY);
+		LLUI::getInstance()->screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY);
 	}
 
 	if (bounds)
@@ -2524,7 +2524,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 		LLRect preedit_rect_local(preedit_left_local, getRect().getHeight(), preedit_right_local, 0);
 		LLRect preedit_rect_screen;
 		localRectToScreen(preedit_rect_local, &preedit_rect_screen);
-		LLUI::screenRectToGL(preedit_rect_screen, bounds);
+		LLUI::getInstance()->screenRectToGL(preedit_rect_screen, bounds);
 	}
 
 	return TRUE;
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 92543b952e8f7cfbaccb002595a3e1bb10ee2640..200dd2fdca6498230d441daad8aa5f1aa5ce1c6f 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3263,7 +3263,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
 	menu->needsArrange();
 	menu->arrangeAndClear();
 
-	LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
+	LLUI::getInstance()->getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
 	LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y);
 
 	const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect();
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 8cf88ad5ebceba80d90c123bdb081925a4b7e2eb..5cfa8ea9738cbe7ac36678a57fd8edbca6946685 100644
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -105,7 +105,7 @@ void LLModalDialog::onOpen(const LLSD& key)
 	
 		// This is a modal dialog.  It sucks up all mouse and keyboard operations.
 		gFocusMgr.setMouseCapture( this );
-		LLUI::addPopup(this);
+		LLUI::getInstance()->addPopup(this);
 		setFocus(TRUE);
 
 		sModalStack.push_front( this );
@@ -147,7 +147,7 @@ void LLModalDialog::setVisible( BOOL visible )
 			gFocusMgr.setMouseCapture( this );
 
 			// The dialog view is a root view
-			LLUI::addPopup(this);
+			LLUI::getInstance()->addPopup(this);
 			setFocus( TRUE );
 		}
 		else
@@ -165,7 +165,7 @@ BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask)
 	if (popup_menu != NULL)
 	{
 		S32 mx, my;
-		LLUI::getMousePositionScreen(&mx, &my);
+		LLUI::getInstance()->getMousePositionScreen(&mx, &my);
 		LLRect menu_screen_rc = popup_menu->calcScreenRect();
 		if(!menu_screen_rc.pointInRect(mx, my))
 		{
@@ -202,7 +202,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask)
 	if (popup_menu != NULL)
 	{
 		S32 mx, my;
-		LLUI::getMousePositionScreen(&mx, &my);
+		LLUI::getInstance()->getMousePositionScreen(&mx, &my);
 		LLRect menu_screen_rc = popup_menu->calcScreenRect();
 		if(menu_screen_rc.pointInRect(mx, my))
 		{
@@ -286,7 +286,7 @@ void LLModalDialog::draw()
 
 void LLModalDialog::centerOnScreen()
 {
-	LLVector2 window_size = LLUI::getWindowSize();
+	LLVector2 window_size = LLUI::getInstance()->getWindowSize();
 	centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
 }
 
@@ -316,7 +316,7 @@ void LLModalDialog::onAppFocusGained()
 		// This is a modal dialog.  It sucks up all mouse and keyboard operations.
 		gFocusMgr.setMouseCapture( instance );
 		instance->setFocus(TRUE);
-		LLUI::addPopup(instance);
+		LLUI::getInstance()->addPopup(instance);
 
 		instance->centerOnScreen();
 	}
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7bafd711cb0223849f1936e823f092275c4ab2ec..9fc6c05ead9d5a70dcf1a52ff6c396432e2c1826 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -130,7 +130,7 @@ bool handleIgnoredNotification(const LLSD& payload)
 			response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON);
 			break;
 		case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE:
-			response = LLUI::sSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName());
+			response = LLUI::getInstance()->mSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName());
 			break;
 		case LLNotificationForm::IGNORE_SHOW_AGAIN:
 			break;
@@ -197,6 +197,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
 	{
 		mIgnoreMsg = p.ignore.text;
 
+		LLUI *ui_inst = LLUI::getInstance();
 		if (!p.ignore.save_option)
 		{
 			mIgnore = p.ignore.session_only ? IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY : IGNORE_WITH_DEFAULT_RESPONSE;
@@ -205,19 +206,19 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
 		{
 			// remember last option chosen by user and automatically respond with that in the future
 			mIgnore = IGNORE_WITH_LAST_RESPONSE;
-			LLUI::sSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name));
+			ui_inst->mSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name));
 		}
 
 		BOOL show_notification = TRUE;
 		if (p.ignore.control.isProvided())
 		{
-			mIgnoreSetting = LLUI::sSettingGroups["config"]->getControl(p.ignore.control);
+			mIgnoreSetting = ui_inst->mSettingGroups["config"]->getControl(p.ignore.control);
 			mInvertSetting = p.ignore.invert_control;
 		}
 		else
 		{
-			LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT);
-			mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name);
+			ui_inst->mSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT);
+			mIgnoreSetting = ui_inst->mSettingGroups["ignores"]->getControl(name);
 		}
 	}
 
@@ -432,7 +433,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
     mSoundName("")
 {
 	if (p.sound.isProvided()
-		&& LLUI::sSettingGroups["config"]->controlExists(p.sound))
+		&& LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound))
 	{
 		mSoundName = p.sound;
 	}
@@ -700,7 +701,7 @@ void LLNotification::respond(const LLSD& response)
 		mForm->setIgnored(mIgnored);
 		if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
 		{
-			LLUI::sSettingGroups["ignores"]->setLLSD("Default" + getName(), response);
+			LLUI::getInstance()->mSettingGroups["ignores"]->setLLSD("Default" + getName(), response);
 		}
 	}
 
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index ee905741617a9b7c95138b2971a97916e223664a..00da0f5fec5075786163aecff9bffa7b0066fdbc 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -609,7 +609,7 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form
 		return formatted_string.getString();
 	}
 	std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate
-	if(LLUI::sSettingGroups["config"]->getBOOL("QAMode"))
+	if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode"))
 	{
 		LL_ERRS() << err_str << LL_ENDL;
 	}
@@ -628,7 +628,7 @@ std::string LLPanel::getString(const std::string& name) const
 		return found_it->second;
 	}
 	std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate
-	if(LLUI::sSettingGroups["config"]->getBOOL("QAMode"))
+	if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode"))
 	{
 		LL_ERRS() << err_str << LL_ENDL;
 	}
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 76134144a0538f73ed8b384167dff0cc52532f21..b3a79bc1ebf4475549c522d1c26a92aaed4f2a2d 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -84,7 +84,7 @@ LLScrollbar::LLScrollbar(const Params & p)
 		mThumbImageH(p.thumb_image_horizontal),
 		mTrackImageV(p.track_image_vertical),
 		mTrackImageH(p.track_image_horizontal),
-		mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")),
+		mThickness(p.thickness.isProvided() ? p.thickness : LLUI::getInstance()->mSettingGroups["config"]->getS32("UIScrollbarSize")),
 		mBGVisible(p.bg_visible),
 		mBGColor(p.bg_color)
 {
@@ -488,7 +488,7 @@ void LLScrollbar::draw()
 
 	S32 local_mouse_x;
 	S32 local_mouse_y;
-	LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
+	LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
 	BOOL other_captor = gFocusMgr.getMouseCapture() && gFocusMgr.getMouseCapture() != this;
 	BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y));
 	if (hovered)
@@ -645,5 +645,5 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data )
 
 void LLScrollbar::setThickness(S32 thickness)
 {
-	mThickness = thickness < 0 ? LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize") : thickness;
+	mThickness = thickness < 0 ? LLUI::getInstance()->mSettingGroups["config"]->getS32("UIScrollbarSize") : thickness;
 }
diff --git a/indra/llui/llstatview.cpp b/indra/llui/llstatview.cpp
index eda2d6047f4c755686eaf954801692fd1a5bd35e..bb4969c81f1d74c2f86c206b909f6fc6872225d7 100644
--- a/indra/llui/llstatview.cpp
+++ b/indra/llui/llstatview.cpp
@@ -43,7 +43,7 @@ LLStatView::LLStatView(const LLStatView::Params& p)
 	BOOL isopen = getDisplayChildren();
 	if (mSetting.length() > 0)
 	{
-		isopen = LLUI::sSettingGroups["config"]->getBOOL(mSetting);
+		isopen = LLUI::getInstance()->mSettingGroups["config"]->getBOOL(mSetting);
 	}
 	setDisplayChildren(isopen);
 }
@@ -54,7 +54,7 @@ LLStatView::~LLStatView()
 	if (mSetting.length() > 0)
 	{
 		BOOL isopen = getDisplayChildren();
-		LLUI::sSettingGroups["config"]->setBOOL(mSetting, isopen);
+		LLUI::getInstance()->mSettingGroups["config"]->setBOOL(mSetting, isopen);
 	}
 }
 
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index a23741b6dd6d17f600579bce9f34285e98ea3c3c..22635f734e6fa213dd09751a672e7b802161a1ec 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3246,7 +3246,7 @@ BOOL LLNormalTextSegment::handleHover(S32 x, S32 y, MASK mask)
 		// Only process the click if it's actually in this segment, not to the right of the end-of-line.
 		if(mEditor.getSegmentAtLocalPos(x, y, false) == this)
 		{
-			LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
+			LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
 			return TRUE;
 		}
 	}
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index 01fe82e45d555c7a15a9a44047aaa0e2d0a09915..41c7d67f24a6e215863484b516bba715becd40d2 100644
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -107,7 +107,7 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask)
 	if (!handled && mClickedCallback && mShowCursorHand)
 	{
 		// Clickable text boxes change the cursor to a hand
-		LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
+		LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
 		return TRUE;
 	}
 	return handled;
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 137167db2adcdc75db2cf7a1f5b3f3cc769b5fe5..b1f8b00cab18a9f09d7b634239bc87f6111c73c2 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1045,7 +1045,7 @@ void LLTextEditor::removeCharOrTab()
 	}
 	else
 	{
-		LLUI::reportBadKeystroke();
+		LLUI::getInstance()->reportBadKeystroke();
 	}
 }
 
@@ -1068,7 +1068,7 @@ void LLTextEditor::removeChar()
 	}
 	else
 	{
-		LLUI::reportBadKeystroke();
+		LLUI::getInstance()->reportBadKeystroke();
 	}
 }
 
@@ -1315,7 +1315,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask)
 				}
 				else
 				{
-					LLUI::reportBadKeystroke();
+					LLUI::getInstance()->reportBadKeystroke();
 				}
 			}
 			break;
@@ -1333,7 +1333,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask)
 				}
 				else
 				{
-					LLUI::reportBadKeystroke();
+					LLUI::getInstance()->reportBadKeystroke();
 				}
 			}	
 			break;
@@ -1665,7 +1665,7 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask)
 		}
 		else
 		{
-			LLUI::reportBadKeystroke();
+			LLUI::getInstance()->reportBadKeystroke();
 		}
 		break;
 
@@ -2750,7 +2750,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 	{
 		LLRect control_rect_screen;
 		localRectToScreen(mVisibleTextRect, &control_rect_screen);
-		LLUI::screenRectToGL(control_rect_screen, control);
+		LLUI::getInstance()->screenRectToGL(control_rect_screen, control);
 	}
 
 	S32 preedit_left_position, preedit_right_position;
@@ -2804,7 +2804,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 		const S32 query_y = mVisibleTextRect.mTop - (current_line - first_visible_line) * line_height - line_height / 2;
 		S32 query_screen_x, query_screen_y;
 		localPointToScreen(query_x, query_y, &query_screen_x, &query_screen_y);
-		LLUI::screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY);
+		LLUI::getInstance()->screenPointToGL(query_screen_x, query_screen_y, &coord->mX, &coord->mY);
 	}
 
 	if (bounds)
@@ -2831,7 +2831,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 		const LLRect preedit_rect_local(preedit_left, preedit_top, preedit_right, preedit_bottom);
 		LLRect preedit_rect_screen;
 		localRectToScreen(preedit_rect_local, &preedit_rect_screen);
-		LLUI::screenRectToGL(preedit_rect_screen, bounds);
+		LLUI::getInstance()->screenRectToGL(preedit_rect_screen, bounds);
 	}
 
 	return TRUE;
diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp
index f6b2ee1dc0942676a7aff18d3ca8037021f6913e..538508b856d98dcd29c7b8288d83f9935a117665 100644
--- a/indra/llui/lltextutil.cpp
+++ b/indra/llui/lltextutil.cpp
@@ -78,7 +78,7 @@ void LLTextUtil::textboxSetGreyedVal(LLTextBox *txtbox, const LLStyle::Params& n
 
 const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str)
 {
-	static const std::string PHONE_SEPARATOR = LLUI::sSettingGroups["config"]->getString("AvalinePhoneSeparator");
+	static const std::string PHONE_SEPARATOR = LLUI::getInstance()->mSettingGroups["config"]->getString("AvalinePhoneSeparator");
 	static const S32 PHONE_PART_LEN = 2;
 
 	static std::string formatted_phone_str;
diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp
index ccb92ffbb2a6a944660b7cb8b52f0b949df25bba..3e56e0a589c7b7a27ae419e01ea820d2ff1080e3 100644
--- a/indra/llui/lltoggleablemenu.cpp
+++ b/indra/llui/lltoggleablemenu.cpp
@@ -55,7 +55,7 @@ boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const
 void LLToggleableMenu::onVisibilityChange (BOOL curVisibilityIn)
 {
 	S32 x,y;
-	LLUI::getMousePositionLocal(LLUI::getRootView(), &x, &y);
+	LLUI::getInstance()->getMousePositionLocal(LLUI::getInstance()->getRootView(), &x, &y);
 
 	// STORM-1879: also check MouseCapture to see if the button was really
         // clicked (otherwise the VisibilityChange was triggered via keyboard shortcut)
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index abc2b6e9cac2025efa9983566c81e7d9a81d99d1..e6f466ec784b9f1c5dbf90ede4a64d17dfd6f820 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -1125,7 +1125,7 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)
 	BOOL handled = FALSE;
 		
 	S32 mouse_distance_squared = (x - mMouseDownX) * (x - mMouseDownX) + (y - mMouseDownY) * (y - mMouseDownY);
-	S32 drag_threshold = LLUI::sSettingGroups["config"]->getS32("DragAndDropDistanceThreshold");
+	S32 drag_threshold = LLUI::getInstance()->mSettingGroups["config"]->getS32("DragAndDropDistanceThreshold");
 	if (mouse_distance_squared > drag_threshold * drag_threshold
 		&& hasMouseCapture() && 
 		mStartDragItemCallback && mHandleDragItemCallback)
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 698b128d45d079c8d7633bd38977c480000835a2..422534b781125bb4dbc0abd3b26e497c4d212476 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -145,10 +145,10 @@ LLToolTip::Params::Params()
 	wrap("wrap", true),
 	pos("pos"),
 	message("message"),
-	delay_time("delay_time", LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" )),
-	visible_time_over("visible_time_over", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeOver" )),
-	visible_time_near("visible_time_near", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )),
-	visible_time_far("visible_time_far", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeFar" )),
+	delay_time("delay_time", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" )),
+	visible_time_over("visible_time_over", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeOver" )),
+	visible_time_near("visible_time_near", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )),
+	visible_time_far("visible_time_far", LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipVisibleTimeFar" )),
 	sticky_rect("sticky_rect"),
 	image("image"),
 	text_color("text_color"),
@@ -358,7 +358,7 @@ void LLToolTip::draw()
 
 	if (mFadeTimer.getStarted())
 	{
-		F32 tool_tip_fade_time = LLUI::sSettingGroups["config"]->getF32("ToolTipFadeTime");
+		F32 tool_tip_fade_time = LLUI::getInstance()->mSettingGroups["config"]->getF32("ToolTipFadeTime");
 		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, 1.f, 0.f);
 		if (alpha == 0.f)
 		{
@@ -436,12 +436,12 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
 	{
 		LLCoordGL pos = params.pos;
 		// try to spawn at requested position
-		LLUI::positionViewNearMouse(mToolTip, pos.mX, pos.mY);
+		LLUI::getInstance()->positionViewNearMouse(mToolTip, pos.mX, pos.mY);
 	}
 	else
 	{
 		// just spawn at mouse location
-		LLUI::positionViewNearMouse(mToolTip);
+		LLUI::getInstance()->positionViewNearMouse(mToolTip);
 	}
 
 	//...update "sticky" rect and tooltip position
@@ -453,7 +453,7 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
 	{
 		S32 mouse_x;
 		S32 mouse_y;
-		LLUI::getMousePositionLocal(gToolTipView->getParent(), &mouse_x, &mouse_y);
+		LLUI::getInstance()->getMousePositionLocal(gToolTipView->getParent(), &mouse_x, &mouse_y);
 
 		// allow mouse a little bit of slop before changing tooltips
 		mMouseNearRect.setCenterAndSize(mouse_x, mouse_y, 3, 3);
@@ -491,7 +491,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params)
 	
 	// are we ready to show the tooltip?
 	if (!mToolTipsBlocked									// we haven't hit a key, moved the mouse, etc.
-		&& LLUI::getMouseIdleTime() > params_with_defaults.delay_time)	// the mouse has been still long enough
+		&& LLUI::getInstance()->getMouseIdleTime() > params_with_defaults.delay_time)	// the mouse has been still long enough
 	{
 		bool tooltip_changed = mLastToolTipParams.message() != params_with_defaults.message()
 								|| mLastToolTipParams.pos() != params_with_defaults.pos()
@@ -563,7 +563,7 @@ void LLToolTipMgr::updateToolTipVisibility()
 	}
 
 	// hide tooltips when mouse cursor is hidden
-	if (LLUI::getWindow()->isCursorHidden())
+	if (LLUI::getInstance()->getWindow()->isCursorHidden())
 	{
 		blockToolTips();
 		return;
@@ -574,7 +574,7 @@ void LLToolTipMgr::updateToolTipVisibility()
 	if (toolTipVisible())
 	{
 		S32 mouse_x, mouse_y;
-		LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y);
+		LLUI::getInstance()->getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y);
 		
 		// mouse far away from tooltip
 		tooltip_timeout = mLastToolTipParams.visible_time_far;
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index b5c4ca1d9f7356f3db2a85a340fb836d30a41e45..5d4ec3a54dad083bc76dab918749ae9775abb1c9 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -75,19 +75,6 @@
 // Language for UI construction
 std::map<std::string, std::string> gTranslation;
 std::list<std::string> gUntranslated;
-/*static*/ LLUI::settings_map_t LLUI::sSettingGroups;
-/*static*/ LLUIAudioCallback LLUI::sAudioCallback = NULL;
-/*static*/ LLUIAudioCallback LLUI::sDeferredAudioCallback = NULL;
-/*static*/ LLWindow*		LLUI::sWindow = NULL;
-/*static*/ LLView*			LLUI::sRootView = NULL;
-/*static*/ BOOL                         LLUI::sDirty = FALSE;
-/*static*/ LLRect                       LLUI::sDirtyRect;
-/*static*/ LLHelp*			LLUI::sHelpImpl = NULL;
-/*static*/ std::vector<std::string> LLUI::sXUIPaths;
-/*static*/ LLFrameTimer		LLUI::sMouseIdleTimer;
-/*static*/ LLUI::add_popup_t	LLUI::sAddPopupFunc;
-/*static*/ LLUI::remove_popup_t	LLUI::sRemovePopupFunc;
-/*static*/ LLUI::clear_popups_t	LLUI::sClearPopupsFunc;
 
 // register filter editor here
 static LLDefaultChildRegistry::Register<LLFilterEditor> register_filter_editor("filter_editor");
@@ -106,18 +93,19 @@ LLUUID find_ui_sound(const char * namep)
 {
 	std::string name = ll_safe_string(namep);
 	LLUUID uuid = LLUUID(NULL);
-	if (!LLUI::sSettingGroups["config"]->controlExists(name))
+	LLUI *ui_inst = LLUI::getInstance();
+	if (!ui_inst->mSettingGroups["config"]->controlExists(name))
 	{
 		LL_WARNS() << "tried to make UI sound for unknown sound name: " << name << LL_ENDL;	
 	}
 	else
 	{
-		uuid = LLUUID(LLUI::sSettingGroups["config"]->getString(name));
+		uuid = LLUUID(ui_inst->mSettingGroups["config"]->getString(name));
 		if (uuid.isNull())
 		{
-			if (LLUI::sSettingGroups["config"]->getString(name) == LLUUID::null.asString())
+			if (ui_inst->mSettingGroups["config"]->getString(name) == LLUUID::null.asString())
 			{
-				if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
+				if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
 				{
 					LL_INFOS() << "UI sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL;	
 				}				
@@ -127,9 +115,9 @@ LLUUID find_ui_sound(const char * namep)
 				LL_WARNS() << "UI sound named: " << name << " does not translate to a valid uuid" << LL_ENDL;	
 			}
 		}
-		else if (LLUI::sAudioCallback != NULL)
+		else if (ui_inst->mAudioCallback != NULL)
 		{
-			if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
+			if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
 			{
 				LL_INFOS() << "UI sound name: " << name << LL_ENDL;	
 			}
@@ -144,7 +132,7 @@ void make_ui_sound(const char* namep)
 	LLUUID soundUUID = find_ui_sound(namep);
 	if(soundUUID.notNull())
 	{
-		LLUI::sAudioCallback(soundUUID);
+		LLUI::getInstance()->mAudioCallback(soundUUID);
 	}
 }
 
@@ -153,28 +141,31 @@ void make_ui_sound_deferred(const char* namep)
 	LLUUID soundUUID = find_ui_sound(namep);
 	if(soundUUID.notNull())
 	{
-		LLUI::sDeferredAudioCallback(soundUUID);
+		LLUI::getInstance()->mDeferredAudioCallback(soundUUID);
 	}
 }
 
-void LLUI::initClass(const settings_map_t& settings,
-					 LLImageProviderInterface* image_provider,
-					 LLUIAudioCallback audio_callback,
-					 LLUIAudioCallback deferred_audio_callback)
+LLUI::LLUI(const settings_map_t& settings,
+				 LLImageProviderInterface* image_provider,
+				 LLUIAudioCallback audio_callback,
+				 LLUIAudioCallback deferred_audio_callback)
+: mSettingGroups(settings),
+mAudioCallback(audio_callback),
+mDeferredAudioCallback(deferred_audio_callback),
+mWindow(NULL), // set later in startup
+mRootView(NULL),
+mDirty(FALSE),
+mHelpImpl(NULL)
 {
 	LLRender2D::initParamSingleton(image_provider);
-	sSettingGroups = settings;
 
-	if ((get_ptr_in_map(sSettingGroups, std::string("config")) == NULL) ||
-		(get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) ||
-		(get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL))
+	if ((get_ptr_in_map(mSettingGroups, std::string("config")) == NULL) ||
+		(get_ptr_in_map(mSettingGroups, std::string("floater")) == NULL) ||
+		(get_ptr_in_map(mSettingGroups, std::string("ignores")) == NULL))
 	{
 		LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL;
 	}
 
-	sAudioCallback = audio_callback;
-	sDeferredAudioCallback = deferred_audio_callback;
-	sWindow = NULL; // set later in startup
 	LLFontGL::sShadowColor = LLUIColorTable::instance().getColor("ColorDropShadow");
 
 	LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar();
@@ -207,26 +198,24 @@ void LLUI::initClass(const settings_map_t& settings,
 
 void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& remove_popup,  const clear_popups_t& clear_popups)
 {
-	sAddPopupFunc = add_popup;
-	sRemovePopupFunc = remove_popup;
-	sClearPopupsFunc = clear_popups;
+	mAddPopupFunc = add_popup;
+	mRemovePopupFunc = remove_popup;
+	mClearPopupsFunc = clear_popups;
 }
 
-//static
 void LLUI::dirtyRect(LLRect rect)
 {
-	if (!sDirty)
+	if (!mDirty)
 	{
-		sDirtyRect = rect;
-		sDirty = TRUE;
+		mDirtyRect = rect;
+		mDirty = TRUE;
 	}
 	else
 	{
-		sDirtyRect.unionWith(rect);
-	}		
+		mDirtyRect.unionWith(rect);
+	}
 }
- 
-//static 
+
 void LLUI::setMousePositionScreen(S32 x, S32 y)
 {
 	S32 screen_x, screen_y;
@@ -240,7 +229,6 @@ void LLUI::setMousePositionScreen(S32 x, S32 y)
 	LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
 }
 
-//static 
 void LLUI::getMousePositionScreen(S32 *x, S32 *y)
 {
 	LLCoordWindow cursor_pos_window;
@@ -250,7 +238,6 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
 	*y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VY]);
 }
 
-//static 
 void LLUI::setMousePositionLocal(const LLView* viewp, S32 x, S32 y)
 {
 	S32 screen_x, screen_y;
@@ -259,7 +246,6 @@ void LLUI::setMousePositionLocal(const LLView* viewp, S32 x, S32 y)
 	setMousePositionScreen(screen_x, screen_y);
 }
 
-//static 
 void LLUI::getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y)
 {
 	S32 screen_x, screen_y;
@@ -273,20 +259,19 @@ void LLUI::getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y)
 // or on Windows if the SecondLife.exe executable is run directly, the 
 // language follows the OS language.  In all cases the user can override
 // the language manually in preferences. JC
-// static
-std::string LLUI::getLanguage()
+std::string LLUI::getUILanguage()
 {
 	std::string language = "en";
-	if (sSettingGroups["config"])
+	if (mSettingGroups["config"])
 	{
-		language = sSettingGroups["config"]->getString("Language");
+		language = mSettingGroups["config"]->getString("Language");
 		if (language.empty() || language == "default")
 		{
-			language = sSettingGroups["config"]->getString("InstallLanguage");
+			language = mSettingGroups["config"]->getString("InstallLanguage");
 		}
 		if (language.empty() || language == "default")
 		{
-			language = sSettingGroups["config"]->getString("SystemLanguage");
+			language = mSettingGroups["config"]->getString("SystemLanguage");
 		}
 		if (language.empty() || language == "default")
 		{
@@ -296,6 +281,13 @@ std::string LLUI::getLanguage()
 	return language;
 }
 
+// static
+std::string LLUI::getLanguage()
+{
+    // Note: lldateutil_test redefines this function
+    return LLUI::getInstance()->getUILanguage();
+}
+
 struct SubDir : public LLInitParam::Block<SubDir>
 {
 	Mandatory<std::string> value;
@@ -355,37 +347,32 @@ std::string LLUI::locateSkin(const std::string& filename)
 	return "";
 }
 
-//static
 LLVector2 LLUI::getWindowSize()
 {
 	LLCoordWindow window_rect;
-	sWindow->getSize(&window_rect);
+	mWindow->getSize(&window_rect);
 
 	return LLVector2(window_rect.mX / getScaleFactor().mV[VX], window_rect.mY / getScaleFactor().mV[VY]);
 }
 
-//static
 void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y)
 {
 	*gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]);
 	*gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]);
 }
 
-//static
 void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y)
 {
 	*screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]);
 	*screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]);
 }
 
-//static
 void LLUI::screenRectToGL(const LLRect& screen, LLRect *gl)
 {
 	screenPointToGL(screen.mLeft, screen.mTop, &gl->mLeft, &gl->mTop);
 	screenPointToGL(screen.mRight, screen.mBottom, &gl->mRight, &gl->mBottom);
 }
 
-//static
 void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
 {
 	glPointToScreen(gl.mLeft, gl.mTop, &screen->mLeft, &screen->mTop);
@@ -395,8 +382,8 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
 
 LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname)
 {
-	for (settings_map_t::iterator itor = sSettingGroups.begin();
-		 itor != sSettingGroups.end(); ++itor)
+	for (settings_map_t::iterator itor = mSettingGroups.begin();
+		 itor != mSettingGroups.end(); ++itor)
 	{
 		LLControlGroup* control_group = itor->second;
 		if(control_group != NULL)
@@ -406,43 +393,38 @@ LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname)
 		}
 	}
 
-	return *sSettingGroups["config"]; // default group
+	return *mSettingGroups["config"]; // default group
 }
 
-//static 
 void LLUI::addPopup(LLView* viewp)
 {
-	if (sAddPopupFunc)
+	if (mAddPopupFunc)
 	{
-		sAddPopupFunc(viewp);
+		mAddPopupFunc(viewp);
 	}
 }
 
-//static 
 void LLUI::removePopup(LLView* viewp)
 {
-	if (sRemovePopupFunc)
+	if (mRemovePopupFunc)
 	{
-		sRemovePopupFunc(viewp);
+		mRemovePopupFunc(viewp);
 	}
 }
 
-//static
 void LLUI::clearPopups()
 {
-	if (sClearPopupsFunc)
+	if (mClearPopupsFunc)
 	{
-		sClearPopupsFunc();
+		mClearPopupsFunc();
 	}
 }
 
-//static
 void LLUI::reportBadKeystroke()
 {
 	make_ui_sound("UISndBadKeystroke");
 }
-	
-//static
+
 // spawn_x and spawn_y are top left corner of view in screen GL coordinates
 void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
 {
@@ -453,7 +435,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
 
 	S32 mouse_x;
 	S32 mouse_y;
-	LLUI::getMousePositionScreen(&mouse_x, &mouse_y);
+	getMousePositionScreen(&mouse_x, &mouse_y);
 
 	// If no spawn location provided, use mouse position
 	if (spawn_x == S32_MAX || spawn_y == S32_MAX)
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index ad32b093aa6ee7a3cd1298bf7afbc9bdf925cc9d..9decaf92cb5817c44235ea3f9b7c49c3a0cc6bda 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -109,8 +109,16 @@ class LLImageProviderInterface;
 
 typedef	void (*LLUIAudioCallback)(const LLUUID& uuid);
 
-class LLUI
+class LLUI : public LLParamSingleton<LLUI>
 {
+public:
+	typedef std::map<std::string, LLControlGroup*> settings_map_t;
+
+private:
+	LLPARAMSINGLETON(LLUI , const settings_map_t &settings,
+						   LLImageProviderInterface* image_provider,
+						   LLUIAudioCallback audio_callback,
+						   LLUIAudioCallback deferred_audio_callback);
 	LOG_CLASS(LLUI);
 public:
 	//
@@ -232,34 +240,24 @@ class LLUI
 	//
 	// Methods
 	//
-	typedef std::map<std::string, LLControlGroup*> settings_map_t;
 	typedef boost::function<void(LLView*)> add_popup_t;
 	typedef boost::function<void(LLView*)> remove_popup_t;
 	typedef boost::function<void(void)> clear_popups_t;
 
-	static void initClass(const settings_map_t& settings,
-						  LLImageProviderInterface* image_provider,
-						  LLUIAudioCallback audio_callback = NULL,
-						  LLUIAudioCallback deferred_audio_callback = NULL);
-
-	static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& );
-
-	static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); }
-	static void popMatrix() { LLRender2D::getInstance()->popMatrix(); }
-	static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); }
-	static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); }
+	void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& );
 
-	static LLRect	sDirtyRect;
-	static BOOL		sDirty;
-	static void		dirtyRect(LLRect rect);
+	LLRect	mDirtyRect;
+	BOOL		mDirty;
+	void		dirtyRect(LLRect rect);
 
 	// Return the ISO639 language name ("en", "ko", etc.) for the viewer UI.
 	// http://www.loc.gov/standards/iso639-2/php/code_list.php
-	static std::string getLanguage();
+	std::string getUILanguage();
+	static std::string getLanguage(); // static for lldateutil_test compatibility
 
 	//helper functions (should probably move free standing rendering helper functions here)
-	static LLView* getRootView() { return sRootView; }
-	static void setRootView(LLView* view) { sRootView = view; }
+	LLView* getRootView() { return mRootView; }
+	void setRootView(LLView* view) { mRootView = view; }
 	/**
 	 * Walk the LLView tree to resolve a path
 	 * Paths can be discovered using Develop > XUI > Show XUI Paths
@@ -285,58 +283,65 @@ class LLUI
 	 *      tree, the first "bar" anywhere under it, and "baz"
 	 *      as a direct child of that
 	 */
-	static const LLView* resolvePath(const LLView* context, const std::string& path);
-	static LLView* resolvePath(LLView* context, const std::string& path);
+	const LLView* resolvePath(const LLView* context, const std::string& path);
+	LLView* resolvePath(LLView* context, const std::string& path);
 	static std::string locateSkin(const std::string& filename);
-	static void setMousePositionScreen(S32 x, S32 y);
-	static void getMousePositionScreen(S32 *x, S32 *y);
-	static void setMousePositionLocal(const LLView* viewp, S32 x, S32 y);
-	static void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y);
-	static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; }
-	static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); }
-	static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); }
-	static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0)
-		{ return LLRender2D::getInstance()->getUIImageByID(image_id, priority); }
-	static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0)
-		{ return LLRender2D::getInstance()->getUIImage(name, priority); }
-	static LLVector2 getWindowSize();
-	static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
-	static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
-	static void screenRectToGL(const LLRect& screen, LLRect *gl);
-	static void glRectToScreen(const LLRect& gl, LLRect *screen);
+	void setMousePositionScreen(S32 x, S32 y);
+	void getMousePositionScreen(S32 *x, S32 *y);
+	void setMousePositionLocal(const LLView* viewp, S32 x, S32 y);
+	void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y);
+	LLVector2 getWindowSize();
+	void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
+	void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
+	void screenRectToGL(const LLRect& screen, LLRect *gl);
+	void glRectToScreen(const LLRect& gl, LLRect *screen);
 	// Returns the control group containing the control name, or the default group
-	static LLControlGroup& getControlControlGroup (const std::string& controlname);
-	static F32 getMouseIdleTime() { return sMouseIdleTimer.getElapsedTimeF32(); }
-	static void resetMouseIdleTimer() { sMouseIdleTimer.reset(); }
-	static LLWindow* getWindow() { return sWindow; }
+	LLControlGroup& getControlControlGroup (const std::string& controlname);
+	F32 getMouseIdleTime() { return mMouseIdleTimer.getElapsedTimeF32(); }
+	void resetMouseIdleTimer() { mMouseIdleTimer.reset(); }
+	LLWindow* getWindow() { return mWindow; }
 
-	static void addPopup(LLView*);
-	static void removePopup(LLView*);
-	static void clearPopups();
+	void addPopup(LLView*);
+	void removePopup(LLView*);
+	void clearPopups();
 
-	static void reportBadKeystroke();
+	void reportBadKeystroke();
 
 	// Ensures view does not overlap mouse cursor, but is inside
 	// the view's parent rectangle.  Used for tooltips, inspectors.
 	// Optionally override the view's default X/Y, which are relative to the
 	// view's parent.
-	static void positionViewNearMouse(LLView* view,	S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX);
+	void positionViewNearMouse(LLView* view,	S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX);
+
+	// LLRender2D wrappers
+	static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); }
+	static void popMatrix() { LLRender2D::getInstance()->popMatrix(); }
+	static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); }
+	static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); }
+
+	static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; }
+	static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); }
+	static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); }
+	static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0)
+		{ return LLRender2D::getInstance()->getUIImageByID(image_id, priority); }
+	static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0)
+		{ return LLRender2D::getInstance()->getUIImage(name, priority); }
 
 	//
 	// Data
 	//
-	static settings_map_t sSettingGroups;
-	static LLUIAudioCallback sAudioCallback;
-	static LLUIAudioCallback sDeferredAudioCallback;
-	static LLWindow*		sWindow;
-	static LLView*			sRootView;
-	static LLHelp*			sHelpImpl;
+	settings_map_t mSettingGroups;
+	LLUIAudioCallback mAudioCallback;
+	LLUIAudioCallback mDeferredAudioCallback;
+	LLWindow*		mWindow;
+	LLView*			mRootView;
+	LLHelp*			mHelpImpl;
 private:
-	static std::vector<std::string> sXUIPaths;
-	static LLFrameTimer		sMouseIdleTimer;
-	static add_popup_t		sAddPopupFunc;
-	static remove_popup_t	sRemovePopupFunc;
-	static clear_popups_t	sClearPopupsFunc;
+	std::vector<std::string> mXUIPaths;
+	LLFrameTimer		mMouseIdleTimer;
+	add_popup_t		mAddPopupFunc;
+	remove_popup_t	mRemovePopupFunc;
+	clear_popups_t	mClearPopupsFunc;
 };
 
 
@@ -361,7 +366,7 @@ class LLUICachedControl : public LLCachedControl<T>
 	LLUICachedControl(const std::string& name,
 					  const T& default_value,
 					  const std::string& comment = "Declared In Code")
-	:	LLCachedControl<T>(LLUI::getControlControlGroup(name), name, default_value, comment)
+	:	LLCachedControl<T>(LLUI::getInstance()->getControlControlGroup(name), name, default_value, comment)
 	{}
 };
 
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index cd9b52d1641380735c13e1093adebc749d3a0ac9..63ed427ab582334d7c8fe2f94c1466c6ec7f1179 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -176,7 +176,7 @@ void LLUrlEntryBase::callObservers(const std::string &id,
 bool LLUrlEntryBase::isLinkDisabled() const
 {
 	// this allows us to have a global setting to turn off text hyperlink highlighting/action
-	bool globally_disabled = LLUI::sSettingGroups["config"]->getBOOL("DisableTextHyperlinkActions");
+	bool globally_disabled = LLUI::getInstance()->mSettingGroups["config"]->getBOOL("DisableTextHyperlinkActions");
 
 	return globally_disabled;
 }
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 89ad8138d89749cdbee477ef540f98edf7f1ec57..2a190365b3e4d94a6230af95ba6a3ebe8aa31cf4 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -816,7 +816,7 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
 		}
 
 		// This call differentiates this method from childrenHandleMouseEvent().
-		LLUI::sWindow->setCursor(viewp->getHoverCursor());
+		LLUI::getInstance()->mWindow->setCursor(viewp->getHoverCursor());
 
 		if (viewp->handleHover(local_x, local_y, mask)
 			|| viewp->blockMouseEvent(local_x, local_y))
@@ -873,8 +873,8 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask)
 		// allow "scrubbing" over ui by showing next tooltip immediately
 		// if previous one was still visible
 		F32 timeout = LLToolTipMgr::instance().toolTipVisible() 
-		              ? LLUI::sSettingGroups["config"]->getF32( "ToolTipFastDelay" )
-		              : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" );
+		              ? LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipFastDelay" )
+		              : LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" );
 		LLToolTipMgr::instance().show(LLToolTip::Params()
 		                              .message(tooltip)
 		                              .sticky_rect(calcScreenRect())
@@ -1142,7 +1142,7 @@ void LLView::drawChildren()
 {
 	if (!mChildList.empty())
 	{
-		LLView* rootp = LLUI::getRootView();		
+		LLView* rootp = LLUI::getInstance()->getRootView();		
 		++sDepth;
 
 		for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();)  // ++child_iter)
@@ -1158,7 +1158,7 @@ void LLView::drawChildren()
 			if (viewp->getVisible() && viewp->getRect().isValid())
 			{
 				LLRect screen_rect = viewp->calcScreenRect();
-				if ( rootp->getLocalRect().overlaps(screen_rect)  && LLUI::sDirtyRect.overlaps(screen_rect))
+				if ( rootp->getLocalRect().overlaps(screen_rect)  && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect))
 				{
 					LLUI::pushMatrix();
 					{
@@ -1200,7 +1200,7 @@ void LLView::dirtyRect()
 		parent = parent->getParent();
 	}
 
-	LLUI::dirtyRect(cur->calcScreenRect());
+	LLUI::getInstance()->dirtyRect(cur->calcScreenRect());
 }
 
 //Draw a box for debugging.
@@ -2223,9 +2223,9 @@ LLControlVariable *LLView::findControl(const std::string& name)
 		std::string control_group_key = name.substr(0, key_pos);
 		LLControlVariable* control;
 		// check if it's in the control group that name indicated
-		if(LLUI::sSettingGroups[control_group_key])
+		if(LLUI::getInstance()->mSettingGroups[control_group_key])
 		{
-			control = LLUI::sSettingGroups[control_group_key]->getControl(name);
+			control = LLUI::getInstance()->mSettingGroups[control_group_key]->getControl(name);
 			if (control)
 			{
 				return control;
@@ -2233,7 +2233,7 @@ LLControlVariable *LLView::findControl(const std::string& name)
 		}
 	}
 	
-	LLControlGroup& control_group = LLUI::getControlControlGroup(name);
+	LLControlGroup& control_group = LLUI::getInstance()->getControlControlGroup(name);
 	return control_group.getControl(name);	
 }
 
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 8494bb338adfa4e9e2dbc19821177089280e11d0..e36ca7c8c691a4abb83d92677bc678d8e7012de7 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -498,7 +498,7 @@ class LLView
 	// return query for iterating over focus roots in tab order
 	static const LLViewQuery & getFocusRootsQuery();
 
-	static LLWindow*	getWindow(void) { return LLUI::sWindow; }
+	static LLWindow*	getWindow(void) { return LLUI::getInstance()->mWindow; }
 
 	// Set up params after XML load before calling new(),
 	// usually to adjust layout.
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index 8754cfebbb466a7b193e956eb88417c87c908ad5..cb000aef74fd8166189431f35a18e0231c69e0bf 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -44,7 +44,7 @@ LLViewerEventRecorder::LLViewerEventRecorder() {
 
 
 bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() {
-  return LLUI::sSettingGroups["config"]->getBOOL("ShowEventRecorderMenuItems");
+  return LLUI::getInstance()->mSettingGroups["config"]->getBOOL("ShowEventRecorderMenuItems");
 }
 
 
@@ -99,7 +99,7 @@ void LLViewerEventRecorder::setMouseGlobalCoords(S32 x, S32 y) {
 
 void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 global_x, S32 global_y, std::string mName) {
 
-  LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), xui);
+  LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), xui);
   if (! target_view) {
     LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << LL_ENDL;
     return;
@@ -216,7 +216,7 @@ void LLViewerEventRecorder::playbackRecording() {
   LLSD LeapCommand;
 
   // ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer
-  LeapCommand =LLUI::sSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand");
+  LeapCommand =LLUI::getInstance()->mSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand");
   
   LL_DEBUGS() << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << LL_ENDL;
   LLLeap::create("", LeapCommand, false); // exception=false
diff --git a/indra/llui/llviewinject.h b/indra/llui/llviewinject.h
index 0de3d155c41ba819b491ac4d93e1ed894e587c04..7f18ec6fbe8fce6fbc9ecb2d92992f59bf3625fe 100644
--- a/indra/llui/llviewinject.h
+++ b/indra/llui/llviewinject.h
@@ -32,7 +32,7 @@ namespace llview
     public:
         /**
          * Construct TargetEvent with the desired target LLView*. (See
-         * LLUI::resolvePath() to obtain an LLView* given a string pathname.)
+         * LLUI::getInstance()->resolvePath() to obtain an LLView* given a string pathname.)
          * This sets up for operator().
          */
         TargetEvent(LLView* view);
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index f377cf2cb4a3537ad700234edcb50359f58f1566..0b4b848014e400fe14b882f4caa619f64c3e280f 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -2046,7 +2046,7 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate)
 
 	// Menus should not remain open on switching to mouselook...
 	LLMenuGL::sMenuContainer->hideMenus();
-	LLUI::clearPopups();
+	LLUI::getInstance()->clearPopups();
 
 	// unpause avatar animation
 	gAgent.unpauseAnimation();
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 22bcbad7da211e8c054e6bcc17cf12bae798d023..7325ec598a17ed1977a8b49b8694c7056569da69 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -148,7 +148,7 @@ class LLAppearanceHandler : public LLCommandHandler
 	{
 		// support secondlife:///app/appearance/show, but for now we just
 		// make all secondlife:///app/appearance SLapps behave this way
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAppearance"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAppearance"))
 		{
 			LLNotificationsUtil::add("NoAppearance", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 12aadd852dd38451dca58bb62ac24048d1615fa3..de707126274206b26d37210b33402471c41faf86 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -844,7 +844,7 @@ bool LLAppViewer::init()
 	settings_map["floater"] = &gSavedSettings; // *TODO: New settings file
 	settings_map["account"] = &gSavedPerAccountSettings;
 
-	LLUI::initClass(settings_map,
+	LLUI::initParamSingleton(settings_map,
 		LLUIImageList::getInstance(),
 		ui_audio_callback,
 		deferred_ui_audio_callback);
@@ -898,7 +898,7 @@ bool LLAppViewer::init()
 	LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor);
 
 	// Let code in llui access the viewer help floater
-	LLUI::sHelpImpl = LLViewerHelp::getInstance();
+	LLUI::getInstance()->mHelpImpl = LLViewerHelp::getInstance();
 
 	LL_INFOS("InitInfo") << "UI initialization is done." << LL_ENDL ;
 
@@ -3033,7 +3033,7 @@ bool LLAppViewer::initWindow()
 		gViewerWindow->getWindow()->maximize();
 	}
 
-	LLUI::sWindow = gViewerWindow->getWindow();
+	LLUI::getInstance()->mWindow = gViewerWindow->getWindow();
 
 	// Show watch cursor
 	gViewerWindow->setCursor(UI_CURSOR_WAIT);
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index d657f04457ab937c3070a1a41e703099d847af82..3395777aab42424db453fa9314140951e6814f46 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -97,7 +97,7 @@ class LLExpanderSegment : public LLTextSegment
 	/*virtual*/ BOOL	handleMouseUp(S32 x, S32 y, MASK mask) { mEditor.onCommit(); return TRUE; }
 	/*virtual*/ BOOL	handleHover(S32 x, S32 y, MASK mask) 
 	{
-		LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
+		LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
 		return TRUE; 
 	}
 private:
diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp
index 776bbf78c2a8dd2ce28d27551c742df42e559207..b66eb754a48c684aea5279944b89106b18a0e326 100644
--- a/indra/newview/llexternaleditor.cpp
+++ b/indra/newview/llexternaleditor.cpp
@@ -184,9 +184,9 @@ std::string LLExternalEditor::findCommand(
 		cmd = override;
 		LL_INFOS() << "Using override" << LL_ENDL;
 	}
-	else if (!LLUI::sSettingGroups["config"]->getString(sSetting).empty())
+	else if (!LLUI::getInstance()->mSettingGroups["config"]->getString(sSetting).empty())
 	{
-		cmd = LLUI::sSettingGroups["config"]->getString(sSetting);
+		cmd = LLUI::getInstance()->mSettingGroups["config"]->getString(sSetting);
 		LL_INFOS() << "Using setting" << LL_ENDL;
 	}
 	else                    // otherwise use the path specified by the environment variable
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 080d0ed8ea914b30ee3697c176fc8a2eabad8338..ee7e6f85621d745265b972d1c41b0c4d6d582164 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -527,7 +527,7 @@ BOOL LLFloaterBvhPreview::handleHover(S32 x, S32 y, MASK mask)
 
 		mAnimPreview->requestUpdate();
 
-		LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY);
+		LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY);
 	}
 
 	if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview)
diff --git a/indra/newview/llfloaterchatvoicevolume.cpp b/indra/newview/llfloaterchatvoicevolume.cpp
index 3c76a3a43cdfc1627d748cbef99e5b78a99ec603..45aea00a49e3a31f5fe1ef65b836e0ece56e88f1 100644
--- a/indra/newview/llfloaterchatvoicevolume.cpp
+++ b/indra/newview/llfloaterchatvoicevolume.cpp
@@ -35,7 +35,7 @@ LLFloaterChatVoiceVolume::LLFloaterChatVoiceVolume(const LLSD& key)
 void LLFloaterChatVoiceVolume::onOpen(const LLSD& key)
 {
 	LLInspect::onOpen(key);
-	LLUI::positionViewNearMouse(this);
+	LLUI::getInstance()->positionViewNearMouse(this);
 }
 
 LLFloaterChatVoiceVolume::~LLFloaterChatVoiceVolume()
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 3c428a70f30b86bdf5abaa6f7062ada259560005..d4b0fa85ab71162c9549f4777a98cdf9fa52f2ce 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -503,7 +503,7 @@ BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask)
 			mSculptedPreview->refresh();
 		}
 
-		LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY);
+		LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY);
 	}
 
 	if (!mPreviewRect.pointInRect(x, y) || !mAvatarPreview || !mSculptedPreview)
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 4f1ea4a89ea008cc830b7b0c294736beae50fc01..5a27f3c3250529e90bfe83c70a5bfc89f91e0242 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -794,7 +794,7 @@ BOOL LLFloaterModelPreview::handleHover	(S32 x, S32 y, MASK mask)
 
 		mModelPreview->refresh();
 
-		LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY);
+		LLUI::getInstance()->setMousePositionLocal(this, mLastMouseX, mLastMouseY);
 	}
 
 	if (!mPreviewRect.pointInRect(x, y) || !mModelPreview)
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 64a71c502de43f2eea571debf4ff684cb18d0cd9..5e8b7556e271c79b301d5f05c944c230be18edf7 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1234,7 +1234,7 @@ void LLFloaterPreference::buildPopupLists()
 		{
 			if (ignore == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
 			{
-				LLSD last_response = LLUI::sSettingGroups["config"]->getLLSD("Default" + templatep->mName);
+				LLSD last_response = LLUI::getInstance()->mSettingGroups["config"]->getLLSD("Default" + templatep->mName);
 				if (!last_response.isUndefined())
 				{
 					for (LLSD::map_const_iterator it = last_response.beginMap();
@@ -1739,7 +1739,7 @@ void LLFloaterPreference::onClickEnablePopup()
 		LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
 		//gSavedSettings.setWarning(templatep->mName, TRUE);
 		std::string notification_name = templatep->mName;
-		LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE);
+		LLUI::getInstance()->mSettingGroups["ignores"]->setBOOL(notification_name, TRUE);
 	}
 	
 	buildPopupLists();
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp
index 66e832111b6132195beb281cbfbc449a5c77e4b7..f52aebc1addc01fd68d38c41fea99a2a3612d052 100644
--- a/indra/newview/llfloatersearch.cpp
+++ b/indra/newview/llfloatersearch.cpp
@@ -48,7 +48,7 @@ class LLSearchHandler : public LLCommandHandler
 	LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { }
 	bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableSearch"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableSearch"))
 		{
 			LLNotificationsUtil::add("NoSearch", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index db5a1922870c2768ecdc4cf214c36344451322ca..e67c79a3a0f54f33a27d767c8d78cff4ec5e5a5c 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -291,8 +291,8 @@ bool LLPreviewedFloater::sShowRectangles = false;
 // Changes are made here
 LLLocalizationResetForcer::LLLocalizationResetForcer(LLFloaterUIPreview* floater, S32 ID)
 {
-	mSavedLocalization = LLUI::sSettingGroups["config"]->getString("Language");				// save current localization setting
-	LLUI::sSettingGroups["config"]->setString("Language", floater->getLocStr(ID));// hack language to be the one we want to preview floaters in
+	mSavedLocalization = LLUI::getInstance()->mSettingGroups["config"]->getString("Language");				// save current localization setting
+	LLUI::getInstance()->mSettingGroups["config"]->setString("Language", floater->getLocStr(ID));// hack language to be the one we want to preview floaters in
 	// forcibly reset XUI paths with this new language
 	gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), floater->getLocStr(ID));
 }
@@ -301,7 +301,7 @@ LLLocalizationResetForcer::LLLocalizationResetForcer(LLFloaterUIPreview* floater
 // Changes are reversed here
 LLLocalizationResetForcer::~LLLocalizationResetForcer()
 {
-	LLUI::sSettingGroups["config"]->setString("Language", mSavedLocalization);	// reset language to what it was before we changed it
+	LLUI::getInstance()->mSettingGroups["config"]->setString("Language", mSavedLocalization);	// reset language to what it was before we changed it
 	// forcibly reset XUI paths with this new language
 	gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), mSavedLocalization);
 }
diff --git a/indra/newview/llfloatervoicevolume.cpp b/indra/newview/llfloatervoicevolume.cpp
index 38446e46df8979e73f8ce826ce476f4fe37dfdb7..59e1f49f81d7895c4ab39813a350a5ffa1b81308 100644
--- a/indra/newview/llfloatervoicevolume.cpp
+++ b/indra/newview/llfloatervoicevolume.cpp
@@ -127,7 +127,7 @@ void LLFloaterVoiceVolume::onOpen(const LLSD& data)
 	// Extract appropriate avatar id
 	mAvatarID = data["avatar_id"];
 
-	LLUI::positionViewNearMouse(this);
+	LLUI::getInstance()->positionViewNearMouse(this);
 
 	getChild<LLUICtrl>("avatar_name")->setValue("");
 	updateVolumeControls();
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 1e9c9ce5e0407c1f33521064e664d2d4a05c3782..27197f0b065075055cef8c772c0a6f82247027a1 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -122,7 +122,7 @@ class LLWorldMapHandler : public LLCommandHandler
 	bool handle(const LLSD& params, const LLSD& query_map,
 				LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap"))
 		{
 			LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
@@ -160,7 +160,7 @@ class LLMapTrackAvatarHandler : public LLCommandHandler
 	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap"))
 		{
 			LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp
index 913efd643426aa50e727377a6d9987095cd206ae..599790d2bb8e0d3591d488ddb0c6f8b71f21ec59 100644
--- a/indra/newview/llgroupactions.cpp
+++ b/indra/newview/llgroupactions.cpp
@@ -55,7 +55,7 @@ class LLGroupHandler : public LLCommandHandler
 	bool handle(const LLSD& tokens, const LLSD& query_map,
 				LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableGroupInfo"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableGroupInfo"))
 		{
 			LLNotificationsUtil::add("NoGroupInfo", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index fc2f50b3f6608505941fe1520fc8a2eb3da0c5fa..e331a51bda76220197e21dc08c9078fce942c966 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1937,7 +1937,7 @@ LLCallDialog::LLCallDialog(const LLSD& payload)
 
 LLCallDialog::~LLCallDialog()
 {
-	LLUI::removePopup(this);
+	LLUI::getInstance()->removePopup(this);
 }
 
 BOOL LLCallDialog::postBuild()
@@ -2014,7 +2014,7 @@ void LLCallDialog::onOpen(const LLSD& key)
 	LLDockableFloater::onOpen(key);
 
 	// it should be over the all floaters. EXT-5116
-	LLUI::addPopup(this);
+	LLUI::getInstance()->addPopup(this);
 }
 
 void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id)
diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp
index e6cb068613c8bb1e1d6cd253d16e332fd39c0f81..479e8f9abf96bf65ffe9c3dec18e4e83786567a4 100644
--- a/indra/newview/llinspect.cpp
+++ b/indra/newview/llinspect.cpp
@@ -28,7 +28,7 @@
 
 #include "lltooltip.h"
 #include "llcontrol.h"	// LLCachedControl
-#include "llui.h"		// LLUI::sSettingsGroups
+#include "llui.h"		// LLUI::getInstance()->mSettingsGroups
 #include "llviewermenu.h"
 
 LLInspect::LLInspect(const LLSD& key)
@@ -45,8 +45,8 @@ LLInspect::~LLInspect()
 // virtual
 void LLInspect::draw()
 {
-	static LLCachedControl<F32> FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f);
-	static LLCachedControl<F32> STAY_TIME(*LLUI::sSettingGroups["config"], "InspectorShowTime", 1.f);
+	static LLCachedControl<F32> FADE_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorFadeTime", 1.f);
+	static LLCachedControl<F32> STAY_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorShowTime", 1.f);
 	if (mOpenTimer.getStarted())
 	{
 		LLFloater::draw();
@@ -113,7 +113,7 @@ BOOL LLInspect::handleToolTip(S32 x, S32 y, MASK mask)
 		params.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());
 		params.message = child_handler->getToolTip();
 		//set up delay if there is no visible tooltip at this moment
-		params.delay_time =  LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" );
+		params.delay_time =  LLToolTipMgr::instance().toolTipVisible() ? 0.f : LLUI::getInstance()->mSettingGroups["config"]->getF32( "ToolTipDelay" );
 		LLToolTipMgr::instance().show(params);
 		handled = TRUE;
 	}
@@ -137,7 +137,7 @@ bool LLInspect::childHasVisiblePopupMenu()
 		LLRect floater_rc = calcScreenRect();
 		LLRect menu_screen_rc = child_menu->calcScreenRect();
 		S32 mx, my;
-		LLUI::getMousePositionScreen(&mx, &my);
+		LLUI::getInstance()->getMousePositionScreen(&mx, &my);
 
 		// This works wrong if we spawn a menu near Inspector and menu overlaps Inspector.
 		if(floater_rc.overlaps(menu_screen_rc) && menu_screen_rc.pointInRect(mx, my))
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 88e7ad1b71b7f99ef77c64dc48946b978b1e3cc0..10814ac0769db1f3675c36211e83774d3a9eb84f 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -207,11 +207,11 @@ void LLInspectAvatar::onOpen(const LLSD& data)
 	// See LLToolTipMgr::createToolTip
 	if (data.has("pos"))
 	{
-		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
+		LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
 	}
 	else
 	{
-		LLUI::positionViewNearMouse(this);
+		LLUI::getInstance()->positionViewNearMouse(this);
 	}
 
 	// Generate link to avatar profile.
diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp
index 8332443162add399e0c24916f6cc70618a662e8d..fa8a53c5466db45f0bb051f6a2680db36b512f00 100644
--- a/indra/newview/llinspectgroup.cpp
+++ b/indra/newview/llinspectgroup.cpp
@@ -129,11 +129,11 @@ void LLInspectGroup::onOpen(const LLSD& data)
 	// See LLToolTipMgr::createToolTip
 	if (data.has("pos"))
 	{
-		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
+		LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
 	}
 	else
 	{
-		LLUI::positionViewNearMouse(this);
+		LLUI::getInstance()->positionViewNearMouse(this);
 	}
 
 	// can't call from constructor as widgets are not built yet
diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp
index bde7b1a12e49781e332efd6d40f6c50892a62ddc..f78a5cc64e0c2b9a3b65a39f6e9a5517c30403f8 100644
--- a/indra/newview/llinspectobject.cpp
+++ b/indra/newview/llinspectobject.cpp
@@ -202,11 +202,11 @@ void LLInspectObject::onOpen(const LLSD& data)
 	// See LLToolTipMgr::createToolTip
 	if (data.has("pos"))
 	{
-		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
+		LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
 	}
 	else
 	{
-		LLUI::positionViewNearMouse(this);
+		LLUI::getInstance()->positionViewNearMouse(this);
 	}
 
 	// Promote hovered object to a complete selection, which will also force
diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp
index b64df2bd47176affd6fcfc24bb7de8f2f3c24d1f..272c8acbd5b8fc0d683b52d0af7bb00ea1c9f6cc 100644
--- a/indra/newview/llinspectremoteobject.cpp
+++ b/indra/newview/llinspectremoteobject.cpp
@@ -116,11 +116,11 @@ void LLInspectRemoteObject::onOpen(const LLSD& data)
 	// See LLToolTipMgr::createToolTip
 	if (data.has("pos"))
 	{
-		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
+		LLUI::getInstance()->positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger());
 	}
 	else
 	{
-		LLUI::positionViewNearMouse(this);
+		LLUI::getInstance()->positionViewNearMouse(this);
 	}
 }
 
diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp
index 47560341e727c48312d96e4b63e9a0c22e013dec..d0034eff1346ea0bfdc34aef61576cc6251626ad 100644
--- a/indra/newview/llinspecttoast.cpp
+++ b/indra/newview/llinspecttoast.cpp
@@ -110,7 +110,7 @@ void LLInspectToast::onOpen(const LLSD& notification_id)
 	panel_rect = panel->getRect();
 	reshape(panel_rect.getWidth(), panel_rect.getHeight());
 
-	LLUI::positionViewNearMouse(this);
+	LLUI::getInstance()->positionViewNearMouse(this);
 }
 
 // virtual
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 11bc1425f902566721a15e32ec5231fd1fe2d8de..42b5ff38907cced1436c0c22f186c946d8aa1629 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -666,7 +666,7 @@ void LLLocationInputCtrl::onAgentParcelChange()
 
 void LLLocationInputCtrl::onMaturityButtonClicked()
 {
-	LLUI::sHelpImpl->showTopic(mMaturityHelpTopic);
+	LLUI::getInstance()->mHelpImpl->showTopic(mMaturityHelpTopic);
 }
 
 void LLLocationInputCtrl::onRegionBoundaryCrossed()
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 92a09357c8fa5adc77405f2118df0aceb10915db..9248c160c66cca92b2b839a9b6ff31699537dbfe 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -386,7 +386,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
 		}
 		else if (gSavedSettings.getBOOL("SnapToMouseCursor"))
 		{
-			LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY);
+			LLUI::getInstance()->setMousePositionScreen(mouse_pos.mX, mouse_pos.mY);
 			x = mouse_pos.mX;
 			y = mouse_pos.mY;
 		}
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 8fa3b2635df5eab82715b53582e6531ddfbddbec..8fc356c9282045bbe75dded7e944ac2c95aa083d 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -670,7 +670,7 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
 	panel->buildFromFile("panel_stand_stop_flying.xml");
 
 	panel->setVisible(FALSE);
-	//LLUI::getRootView()->addChild(panel);
+	//LLUI::getInstance()->getRootView()->addChild(panel);
 
 	LL_INFOS() << "Build LLPanelStandStopFlying panel" << LL_ENDL;
 
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 62e0e2d077142da7a51e12472a9c84c1c330ba2b..909936d9890cfe25be752537731202184ddab9d8 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -153,7 +153,7 @@ void	LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index )
 		bool is_mouse_over_name_cell = false;
 
 		S32 mouse_x, mouse_y;
-		LLUI::getMousePositionLocal(this, &mouse_x, &mouse_y);
+		LLUI::getInstance()->getMousePositionLocal(this, &mouse_x, &mouse_y);
 
 		S32 column_index = getColumnIndexFromOffset(mouse_x);
 		LLScrollListItem* hit_item = hitItem(mouse_x, mouse_y);
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 248c361ca40eb084f039b0854c5eff292e9d525e..fc1039b37257467074a5dfb53eaf9f5dd6cfe843 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -329,7 +329,7 @@ void LLNetMap::draw()
 		S32 local_mouse_x;
 		S32 local_mouse_y;
 		//localMouse(&local_mouse_x, &local_mouse_y);
-		LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
+		LLUI::getInstance()->getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
 		mClosestAgentToCursor.setNull();
 		F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop
 		F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE);
@@ -835,7 +835,7 @@ BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask )
 			LLRect clip_rect = getRect();
 			clip_rect.stretch(-8);
 			clip_rect.clipPointToRect(mMouseDown.mX, mMouseDown.mY, local_x, local_y);
-			LLUI::setMousePositionLocal(this, local_x, local_y);
+			LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y);
 
 			// finish the pan
 			mPanning = false;
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 77bc99da832c181857448174524e8fae58f040bb..c39df3fe8bbe58a6ffd101afbe975fa883f29ef9 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -84,7 +84,7 @@ class LLPickHandler : public LLCommandHandler,
 	bool handle(const LLSD& params, const LLSD& query_map,
 		LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnablePicks"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnablePicks"))
 		{
 			LLNotificationsUtil::add("NoPicks", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
@@ -198,7 +198,7 @@ class LLClassifiedHandler :
 	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableClassifieds"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableClassifieds"))
 		{
 			LLNotificationsUtil::add("NoClassifieds", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 48dd45480e8d9efa630f7548252fc482cd59e2f6..961e2599472ff47caf1c00aef286dbc41f916319 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -97,7 +97,7 @@ class LLParcelHandler : public LLCommandHandler
 			return false;
 		}
 
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnablePlaceProfile"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnablePlaceProfile"))
 		{
 			LLNotificationsUtil::add("NoPlaceInfo", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 8afa35efa0b4066ab1e10b58d8af234cf792106f..5f13b223fbbf097096a59ff12f4373a27dc1b094 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -110,7 +110,7 @@ class LLAgentHandler : public LLCommandHandler
 
 		if (verb == "pay")
 		{
-			if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarPay"))
+			if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarPay"))
 			{
 				LLNotificationsUtil::add("NoAvatarPay", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 				return true;
diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp
index 153f0930c27ab5ee3b9af6545e9f8ce1fb4307ca..d1a9ca229fdcd067859ede6ccc876000bc323ed6 100644
--- a/indra/newview/llpopupview.cpp
+++ b/indra/newview/llpopupview.cpp
@@ -44,13 +44,13 @@ LLPopupView::LLPopupView(const LLPopupView::Params& p)
 : LLPanel(p)
 {
 	// register ourself as handler of UI popups
-	LLUI::setPopupFuncs(boost::bind(&LLPopupView::addPopup, this, _1), boost::bind(&LLPopupView::removePopup, this, _1), boost::bind(&LLPopupView::clearPopups, this));
+	LLUI::getInstance()->setPopupFuncs(boost::bind(&LLPopupView::addPopup, this, _1), boost::bind(&LLPopupView::removePopup, this, _1), boost::bind(&LLPopupView::clearPopups, this));
 }
 
 LLPopupView::~LLPopupView()
 {
 	// set empty callback function so we can't handle popups anymore
-	LLUI::setPopupFuncs(LLUI::add_popup_t(), LLUI::remove_popup_t(), LLUI::clear_popups_t());
+	LLUI::getInstance()->setPopupFuncs(LLUI::add_popup_t(), LLUI::remove_popup_t(), LLUI::clear_popups_t());
 }
 
 void LLPopupView::draw()
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 9431914ba376f205e8407b8d6726ec88c7e098b4..60099b08b7f63664e461429443c20c80beaf5ed2 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -902,7 +902,7 @@ bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLS
 
 void LLScriptEdCore::onBtnHelp()
 {
-	LLUI::sHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC);
+	LLUI::getInstance()->mHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC);
 }
 
 void LLScriptEdCore::onBtnDynamicHelp()
diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp
index 32295cd96f29b3c5acf352b8accb1e571b4579fa..b1cb6d08d023d4b17dbd00b5c33f7f140bfb1503 100644
--- a/indra/newview/llsaveoutfitcombobtn.cpp
+++ b/indra/newview/llsaveoutfitcombobtn.cpp
@@ -56,7 +56,7 @@ LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAc
 void LLSaveOutfitComboBtn::showSaveMenu()
 {
 	S32 x, y;
-	LLUI::getMousePositionLocal(mParent, &x, &y);
+	LLUI::getInstance()->getMousePositionLocal(mParent, &x, &y);
 
 	mSaveMenu->updateParent(LLMenuGL::sMenuContainer);
 	LLMenuGL::showPopup(mParent, mSaveMenu, x, y);
diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp
index 6b4f1d3dc67859466c6f20cf82d1ad3c23bb293b..142e00c3f7e5203437cc1848cd51e5ccfd49edf7 100644
--- a/indra/newview/llshareavatarhandler.cpp
+++ b/indra/newview/llshareavatarhandler.cpp
@@ -40,7 +40,7 @@ class LLShareWithAvatarHandler : public LLCommandHandler
 	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarShare"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarShare"))
 		{
 			LLNotificationsUtil::add("NoAvatarShare", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 8c741085b8c50003f481d67e9ede3734c9b2606c..9eda33d3d20f22dac2309ffed79e6b1648deb87b 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -503,8 +503,8 @@ void LLStatusBar::onMouseEnterPresets()
 	mPanelPresetsPulldown->setShape(pulldown_rect);
 
 	// show the master presets pull-down
-	LLUI::clearPopups();
-	LLUI::addPopup(mPanelPresetsPulldown);
+	LLUI::getInstance()->clearPopups();
+	LLUI::getInstance()->addPopup(mPanelPresetsPulldown);
 	mPanelNearByMedia->setVisible(FALSE);
 	mPanelVolumePulldown->setVisible(FALSE);
 	mPanelPresetsPulldown->setVisible(TRUE);
@@ -527,8 +527,8 @@ void LLStatusBar::onMouseEnterVolume()
 
 
 	// show the master volume pull-down
-	LLUI::clearPopups();
-	LLUI::addPopup(mPanelVolumePulldown);
+	LLUI::getInstance()->clearPopups();
+	LLUI::getInstance()->addPopup(mPanelVolumePulldown);
 	mPanelPresetsPulldown->setVisible(FALSE);
 	mPanelNearByMedia->setVisible(FALSE);
 	mPanelVolumePulldown->setVisible(TRUE);
@@ -550,8 +550,8 @@ void LLStatusBar::onMouseEnterNearbyMedia()
 	
 	// show the master volume pull-down
 	mPanelNearByMedia->setShape(nearby_media_rect);
-	LLUI::clearPopups();
-	LLUI::addPopup(mPanelNearByMedia);
+	LLUI::getInstance()->clearPopups();
+	LLUI::getInstance()->addPopup(mPanelNearByMedia);
 
 	mPanelPresetsPulldown->setVisible(FALSE);
 	mPanelVolumePulldown->setVisible(FALSE);
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index b9b05966bc9e1ced2babfa6b987963271002c2c9..870e0d94f0c03518b6dda3e5924ea5382afe378a 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -430,7 +430,7 @@ void LLToast::setVisible(BOOL show)
 void LLToast::updateHoveredState()
 {
 	S32 x, y;
-	LLUI::getMousePositionScreen(&x, &y);
+	LLUI::getInstance()->getMousePositionScreen(&x, &y);
 
 	LLRect panel_rc = mWrapperPanel->calcScreenRect();
 	LLRect button_rc;
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index 596951fdfb41d50053cbb0a9883c12fb247908e8..07f46c5fbe07e08669b25992412af8ab4d970162 100644
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -293,12 +293,12 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask)
 				BOOL success = LLViewerCamera::getInstance()->projectPosAgentToScreen(focus_pos, mouse_pos);
 				if (success)
 				{
-					LLUI::setMousePositionScreen(mouse_pos.mX, mouse_pos.mY);
+					LLUI::getInstance()->setMousePositionScreen(mouse_pos.mX, mouse_pos.mY);
 				}
 			}
 			else if (mMouseSteering)
 			{
-				LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY);
+				LLUI::getInstance()->setMousePositionScreen(mMouseDownX, mMouseDownY);
 			}
 			else
 			{
@@ -308,7 +308,7 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask)
 		else
 		{
 			// not a valid zoomable object
-			LLUI::setMousePositionScreen(mMouseDownX, mMouseDownY);
+			LLUI::getInstance()->setMousePositionScreen(mMouseDownX, mMouseDownY);
 		}
 
 		// calls releaseMouse() internally
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index f3e661e71a3007f574e4cd8ed463ee073d91bca2..3831f7d67dae7ab81943e0bde176d5617853d0bc 100644
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -1001,7 +1001,7 @@ void LLToolGrabBase::onMouseCaptureLost()
 			// ...move cursor "naturally", as if it had moved when hidden
 			S32 x = mGrabPick.mMousePt.mX + mAccumDeltaX;
 			S32 y = mGrabPick.mMousePt.mY + mAccumDeltaY;
-			LLUI::setMousePositionScreen(x, y);
+			LLUI::getInstance()->setMousePositionScreen(x, y);
 		}
 		else if (mHasMoved)
 		{
@@ -1011,13 +1011,13 @@ void LLToolGrabBase::onMouseCaptureLost()
 			LLCoordGL gl_point;
 			if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point))
 			{
-				LLUI::setMousePositionScreen(gl_point.mX, gl_point.mY);
+				LLUI::getInstance()->setMousePositionScreen(gl_point.mX, gl_point.mY);
 			}
 		}
 		else
 		{
 			// ...move cursor back to click position
-			LLUI::setMousePositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY);
+			LLUI::getInstance()->setMousePositionScreen(mGrabPick.mMousePt.mX, mGrabPick.mMousePt.mY);
 		}
 
 		gViewerWindow->showCursor();
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 63e84ccbbd3cf69065cb8a334b3f4faecc2ae347..276d24e9ed61afc9e07fb1f6f3ffc237f30a24b3 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -1200,7 +1200,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
 
 BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask)
 {
-	if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE;
+	if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE;
 	if (!mHoverPick.isValid()) return TRUE;
 
 	LLViewerObject* hover_object = mHoverPick.getObject();
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
index 6b2cd71d406ac4a493eb6de9dd66a6b9d2b2d2b5..956f5cf187acecbabdc369c56a9e253dc5f35d9e 100644
--- a/indra/newview/lluilistener.cpp
+++ b/indra/newview/lluilistener.cpp
@@ -84,8 +84,8 @@ void LLUIListener::getValue(const LLSD&event) const
 {
     LLSD reply = LLSD::emptyMap();
 
-    const LLView* root = LLUI::getRootView();
-    const LLView* view = LLUI::resolvePath(root, event["path"].asString());
+    const LLView* root = LLUI::getInstance()->getRootView();
+    const LLView* view = LLUI::getInstance()->resolvePath(root, event["path"].asString());
     const LLUICtrl* ctrl(dynamic_cast<const LLUICtrl*>(view));
 
     if (ctrl) 
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 78268944fc0aa28b1c580f006a4fd94e81bcae82..794326e752f1054714c475d486649f6f65b7d5ab 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -187,7 +187,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string
 	LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(),
 									  LLURLDispatcherImpl::regionNameCallback,
 									  slurl.getSLURLString(),
-									  LLUI::sSettingGroups["config"]->getBOOL("SLURLTeleportDirectly"));	// don't teleport
+									  LLUI::getInstance()->mSettingGroups["config"]->getBOOL("SLURLTeleportDirectly"));	// don't teleport
 	return true;
 }
 
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 8a6111485264b7ea297fab407f3c558365c5c2df..2b7e598a590cea853e8eb30d22efc0a635ac1f61 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -66,7 +66,7 @@ void LLURLLineEditor::cut()
 		if( need_to_rollback )
 		{
 			rollback.doRollback( this );
-			LLUI::reportBadKeystroke();
+			LLUI::getInstance()->reportBadKeystroke();
 		}
 		else
 		if( mKeystrokeCallback )
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 64f6123f5dd5be698c69a4083ba6a3b411e41654..48eed20861d8b705b26690124ef1cbc302f6557c 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1507,9 +1507,10 @@ void render_ui_2d()
 
 	if (gSavedSettings.getBOOL("RenderUIBuffer"))
 	{
-		if (LLUI::sDirty)
+		LLUI* ui_inst = LLUI::getInstance();
+		if (LLUI::getInstance()->mDirty)
 		{
-			LLUI::sDirty = FALSE;
+			LLUI::getInstance()->mDirty = FALSE;
 			LLRect t_rect;
 
 			gPipeline.mUIScreen.bindTarget();
@@ -1517,25 +1518,25 @@ void render_ui_2d()
 			{
 				static const S32 pad = 8;
 
-				LLUI::sDirtyRect.mLeft -= pad;
-				LLUI::sDirtyRect.mRight += pad;
-				LLUI::sDirtyRect.mBottom -= pad;
-				LLUI::sDirtyRect.mTop += pad;
+				ui_inst->mDirtyRect.mLeft -= pad;
+				ui_inst->mDirtyRect.mRight += pad;
+				ui_inst->mDirtyRect.mBottom -= pad;
+				ui_inst->mDirtyRect.mTop += pad;
 
 				LLGLEnable scissor(GL_SCISSOR_TEST);
-				static LLRect last_rect = LLUI::sDirtyRect;
+				static LLRect last_rect = ui_inst->mDirtyRect;
 
 				//union with last rect to avoid mouse poop
-				last_rect.unionWith(LLUI::sDirtyRect);
+				last_rect.unionWith(ui_inst->mDirtyRect);
 								
-				t_rect = LLUI::sDirtyRect;
-				LLUI::sDirtyRect = last_rect;
+				t_rect = ui_inst->mDirtyRect;
+				ui_inst->mDirtyRect = last_rect;
 				last_rect = t_rect;
 			
-				last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::getScaleFactor().mV[0]);
-				last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::getScaleFactor().mV[0]);
-				last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::getScaleFactor().mV[1]);
-				last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::getScaleFactor().mV[1]);
+				last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / ui_inst->getScaleFactor().mV[0]);
+				last_rect.mRight = LLRect::tCoordType(last_rect.mRight / ui_inst->getScaleFactor().mV[0]);
+				last_rect.mTop = LLRect::tCoordType(last_rect.mTop / ui_inst->getScaleFactor().mV[1]);
+				last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / ui_inst->getScaleFactor().mV[1]);
 
 				LLRect clip_rect(last_rect);
 				
@@ -1547,7 +1548,7 @@ void render_ui_2d()
 			gPipeline.mUIScreen.flush();
 			gGL.setColorMask(true, false);
 
-			LLUI::sDirtyRect = t_rect;
+			ui_inst->mDirtyRect = t_rect;
 		}
 
 		LLGLDisable cull(GL_CULL_FACE);
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 1ab7ec0156d56b42020e622c245f45ec96978453..d9998cb7cb96936e8ac1208c7ecc7ac1d9b19a8d 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -237,7 +237,7 @@ class LLInventoryHandler : public LLCommandHandler
 			return false;
 		}
 
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableInventory"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableInventory"))
 		{
 				LLNotificationsUtil::add("NoInventory", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 				return true;
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 1ac313f955cc7fa7cbfb7a7582988d139e71c7a0..f4a64a8e55c41ded10ad734cfd0df3ca5d8833e2 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -339,12 +339,12 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
 			clearFocus();
 		}
 		
-		if ( KEY_F1 == key && LLUI::sHelpImpl && mMediaControls.get())
+		if ( KEY_F1 == key && LLUI::getInstance()->mHelpImpl && mMediaControls.get())
 		{
 			std::string help_topic;
 			if (mMediaControls.get()->findHelpTopic(help_topic))
 			{
-				LLUI::sHelpImpl->showTopic(help_topic);
+				LLUI::getInstance()->mHelpImpl->showTopic(help_topic);
 			}
 		}
 	}
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 7d2d6e25c79ed08d8314408e49bfb49bae9c76a1..0e181bf53d838d8d35190e4a287e5ff4e4ec3594 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -239,7 +239,7 @@ class LLEmbeddedItemSegment : public LLTextSegment
 
 	/*virtual*/ BOOL			handleHover(S32 x, S32 y, MASK mask)
 	{
-		LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
+		LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
 		return TRUE;
 	}
 	virtual BOOL				handleToolTip(S32 x, S32 y, MASK mask )
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5b764f97fb6d046d95fecff988012409bc72229c..b8960d7604b7443c3443d148b735a99cdda6435e 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -960,7 +960,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window,  LLCoordGL pos, MASK
 			mWindow->releaseMouse();
 
 		// Indicate mouse was active
-		LLUI::resetMouseIdleTimer();
+		LLUI::getInstance()->resetMouseIdleTimer();
 
 		// Don't let the user move the mouse out of the window until mouse up.
 		if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() )
@@ -1295,7 +1295,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask
 
 	if (mouse_point != mCurrentMousePoint)
 	{
-		LLUI::resetMouseIdleTimer();
+		LLUI::getInstance()->resetMouseIdleTimer();
 	}
 
 	saveLastMouse(mouse_point);
@@ -1852,7 +1852,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
 	rvp.mouse_opaque(false);
 	rvp.follows.flags(FOLLOWS_NONE);
 	mRootView = LLUICtrlFactory::create<LLRootView>(rvp);
-	LLUI::setRootView(mRootView);
+	LLUI::getInstance()->setRootView(mRootView);
 
 	// Make avatar head look forward at start
 	mCurrentMousePoint.mX = getWindowWidthScaled() / 2;
@@ -2410,7 +2410,7 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible )
 		gStatusBar->setEnabled( visible );	
 	}
 	
-	LLNavigationBar* navbarp = LLUI::getRootView()->findChild<LLNavigationBar>("navigation_bar");
+	LLNavigationBar* navbarp = LLUI::getInstance()->getRootView()->findChild<LLNavigationBar>("navigation_bar");
 	if (navbarp)
 	{
 		// when it's time to show navigation bar we need to ensure that the user wants to see it
@@ -2520,7 +2520,7 @@ void LLViewerWindow::draw()
 
 	if (!gSavedSettings.getBOOL("RenderUIBuffer"))
 	{
-		LLUI::sDirtyRect = getWindowRectScaled();
+		LLUI::getInstance()->mDirtyRect = getWindowRectScaled();
 	}
 
 	// HACK for timecode debugging
@@ -2920,7 +2920,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
 
 void LLViewerWindow::handleScrollWheel(S32 clicks)
 {
-	LLUI::resetMouseIdleTimer();
+	LLUI::getInstance()->resetMouseIdleTimer();
 	
 	LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
 	if( mouse_captor )
@@ -2999,7 +2999,7 @@ void LLViewerWindow::moveCursorToCenter()
 		S32 x = getWorldViewWidthScaled() / 2;
 		S32 y = getWorldViewHeightScaled() / 2;
 	
-		LLUI::setMousePositionScreen(x, y);
+		LLUI::getInstance()->setMousePositionScreen(x, y);
 		
 		//on a forced move, all deltas get zeroed out to prevent jumping
 		mCurrentMousePoint.set(x,y);
diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp
index 2050dab689abd1d2c88cfa2f8a8222abeea04792..1e993d13843aaf3af2c93fa95ebd55508ee0f36b 100644
--- a/indra/newview/llvoicecallhandler.cpp
+++ b/indra/newview/llvoicecallhandler.cpp
@@ -40,7 +40,7 @@ class LLVoiceCallAvatarHandler : public LLCommandHandler
 	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
-		if (!LLUI::sSettingGroups["config"]->getBOOL("EnableVoiceCall"))
+		if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableVoiceCall"))
 		{
 			LLNotificationsUtil::add("NoVoiceCall", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit"));
 			return true;
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index 5367262bb6cfe3094187fffa8868c5393b1d8e52..9e4297baafc13a903d8ae97dc6436cd11d8aed51 100644
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -69,7 +69,7 @@ LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter&
 	std::string buttonExplain =
 		"(button values \"LEFT\", \"MIDDLE\", \"RIGHT\")\n";
 	std::string paramsExplain =
-		"[\"path\"] is as for LLUI::resolvePath(), described in\n"
+		"[\"path\"] is as for LLUI::getInstance()->resolvePath(), described in\n"
 		"http://bitbucket.org/lindenlab/viewer-release/src/tip/indra/llui/llui.h\n"
 		"If you omit [\"path\"], you must specify both [\"x\"] and [\"y\"].\n"
 		"If you specify [\"path\"] without both [\"x\"] and [\"y\"], will synthesize (x, y)\n"
@@ -209,7 +209,7 @@ void LLWindowListener::getInfo(LLSD const & evt)
 	if (evt.has("path"))
 	{
 		std::string path(evt["path"]);
-		LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path);
+		LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path);
 		if (target_view != 0)
 		{
 			response.setResponse(target_view->getInfo());
@@ -230,7 +230,7 @@ void LLWindowListener::getInfo(LLSD const & evt)
 void LLWindowListener::getPaths(LLSD const & request)
 {
 	Response response(LLSD(), request);
-	LLView *root(LLUI::getRootView()), *base(NULL);
+	LLView *root(LLUI::getInstance()->getRootView()), *base(NULL);
 	// Capturing request["under"] as string means we conflate the case in
 	// which there is no ["under"] key with the case in which its value is the
 	// empty string. That seems to make sense to me.
@@ -243,7 +243,7 @@ void LLWindowListener::getPaths(LLSD const & request)
 	}
 	else
 	{
-		base = LLUI::resolvePath(root, under);
+		base = LLUI::getInstance()->resolvePath(root, under);
 		if (! base)
 		{
 			return response.error(STRINGIZE(request["op"].asString() << " request "
@@ -268,7 +268,7 @@ void LLWindowListener::keyDown(LLSD const & evt)
 	if (evt.has("path"))
 	{
 		std::string path(evt["path"]);
-		LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path);
+		LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path);
 		if (target_view == 0) 
 		{
 			response.error(STRINGIZE(evt["op"].asString() << " request "
@@ -303,7 +303,7 @@ void LLWindowListener::keyUp(LLSD const & evt)
 	if (evt.has("path"))
 	{
 		std::string path(evt["path"]);
-		LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path);
+		LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), path);
 		if (target_view == 0 )
 		{
 			response.error(STRINGIZE(evt["op"].asString() << " request "
@@ -407,8 +407,8 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request)
 	}
 	else // ! path.empty()
 	{
-		LLView* root   = LLUI::getRootView();
-		LLView* target = LLUI::resolvePath(root, path);
+		LLView* root   = LLUI::getInstance()->getRootView();
+		LLView* target = LLUI::getInstance()->resolvePath(root, path);
 		if (! target)
 		{
 			return response.error(STRINGIZE(request["op"].asString() << " request "
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 066cb9a0ace352fa61aca7f4204323633b77d652..d65b8dd43d2478cbc480818b08f29eaf601d518a 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -337,14 +337,14 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight)
 	setStarBrightness((1 - weight) * (F32) src.getStarBrightness()
 		+ weight * (F32) dest.getStarBrightness());
 
-	llassert(src.getSunAngle() >= - F_PI && 
+	/*llassert(src.getSunAngle() >= - F_PI && 
 					src.getSunAngle() <= 3 * F_PI);
 	llassert(dest.getSunAngle() >= - F_PI && 
 					dest.getSunAngle() <= 3 * F_PI);
 	llassert(src.getEastAngle() >= 0 && 
 					src.getEastAngle() <= 4 * F_PI);
 	llassert(dest.getEastAngle() >= 0 && 
-					dest.getEastAngle() <= 4 * F_PI);
+					dest.getEastAngle() <= 4 * F_PI);*/
 
 	// sun angle and east angle require some handling to make sure
 	// they go in circles.  Yes quaternions would work better.
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index b27257a2629b41772e0b68347b78f961a1567dc4..a90256fa4bd7488e9606999dce1381de708674ec 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -1628,7 +1628,7 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask )
 			LLRect clip_rect = getRect();
 			clip_rect.stretch(-8);
 			clip_rect.clipPointToRect(mMouseDownX, mMouseDownY, local_x, local_y);
-			LLUI::setMousePositionLocal(this, local_x, local_y);
+			LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y);
 
 			// finish the pan
 			mPanning = FALSE;