diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 3ca05ff0ff43c9306c514c9a71c5f2ce12c6e0f5..732c01614bc35798b752d2dba2ca8b3d502e7b30 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -105,6 +105,15 @@ struct LLPlaceHolderPanel : public LLPanel
 static LLDefaultChildRegistry::Register<LLPlaceHolderPanel> r1("placeholder");
 static LLDefaultChildRegistry::Register<LLTabContainer> r2("tab_container");
 
+LLTabContainer::TabParams::TabParams()
+:	tab_top_image_unselected("tab_top_image_unselected"),
+	tab_top_image_selected("tab_top_image_selected"),
+	tab_bottom_image_unselected("tab_bottom_image_unselected"),
+	tab_bottom_image_selected("tab_bottom_image_selected"),
+	tab_left_image_unselected("tab_left_image_unselected"),
+	tab_left_image_selected("tab_left_image_selected")
+{}
+
 LLTabContainer::Params::Params()
 :	tab_width("tab_width"),
 	tab_min_width("tab_min_width"),
@@ -113,12 +122,9 @@ LLTabContainer::Params::Params()
 	tab_position("tab_position"),
 	hide_tabs("hide_tabs", false),
 	tab_padding_right("tab_padding_right"),
-	tab_top_image_unselected("tab_top_image_unselected"),
-	tab_top_image_selected("tab_top_image_selected"),
-	tab_bottom_image_unselected("tab_bottom_image_unselected"),
-	tab_bottom_image_selected("tab_bottom_image_selected"),
-	tab_left_image_unselected("tab_left_image_unselected"),
-	tab_left_image_selected("tab_left_image_selected")
+	first_tab("first_tab"),
+	middle_tab("middle_tab"),
+	last_tab("last_tab")
 {
 	name(std::string("tab_container"));
 	mouse_opaque = false;
@@ -147,12 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
 	mRightTabBtnOffset(p.tab_padding_right),
 	mTotalTabWidth(0),
 	mTabPosition(p.tab_position),
-	mImageTopUnselected(p.tab_top_image_unselected),
-	mImageTopSelected(p.tab_top_image_selected),
-	mImageBottomUnselected(p.tab_bottom_image_unselected),
-	mImageBottomSelected(p.tab_bottom_image_selected),
-	mImageLeftUnselected(p.tab_left_image_unselected),
-	mImageLeftSelected(p.tab_left_image_selected)
+	mFirstTabParams(p.first_tab),
+	mMiddleTabParams(p.middle_tab),
+	mLastTabParams(p.last_tab)
 {
 	static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0);
 
@@ -791,6 +794,29 @@ void LLTabContainer::addTabPanel(LLPanel* panelp)
 	addTabPanel(TabPanelParams().panel(panelp));
 }
 
+// function to update images
+void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos)
+{
+	if (tuple && tuple->mButton)
+	{
+		if (pos == LLTabContainer::TOP)
+		{
+			tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_top_image_unselected));
+			tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_top_image_selected));
+		}
+		else if (pos == LLTabContainer::BOTTOM)
+		{
+			tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_bottom_image_unselected));
+			tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_bottom_image_selected));
+		}
+		else if (pos == LLTabContainer::LEFT)
+		{
+			tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_left_image_unselected));
+			tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_left_image_selected));
+		}
+	}
+}
+
 void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 {
 	LLPanel* child = panel.panel();
@@ -888,14 +914,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 	else if( getTabPosition() == LLTabContainer::TOP )
 	{
 		btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, mTabHeight);
-		tab_img = mImageTopUnselected.get();
-		tab_selected_img = mImageTopSelected.get();
+		tab_img = mMiddleTabParams.tab_top_image_unselected;
+		tab_selected_img = mMiddleTabParams.tab_top_image_selected; 
 	}
 	else
 	{
 		btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, mTabHeight);
-		tab_img = mImageBottomUnselected.get();
-		tab_selected_img = mImageBottomSelected.get();
+		tab_img = mMiddleTabParams.tab_bottom_image_unselected;
+		tab_selected_img = mMiddleTabParams.tab_bottom_image_selected;
 	}
 
 	LLTextBox* textbox = NULL;
@@ -926,8 +952,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 			p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
 			p.font(font);
 			p.label(trimmed_label);
-			p.image_unselected(mImageLeftUnselected);
-			p.image_selected(mImageLeftSelected);
+			p.image_unselected(mMiddleTabParams.tab_left_image_unselected);
+			p.image_selected(mMiddleTabParams.tab_left_image_selected);
 			p.scale_image(true);
 			p.font_halign = LLFontGL::LEFT;
 			p.tab_stop(false);
@@ -983,6 +1009,31 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 	LLTabTuple* tuple = new LLTabTuple( this, child, btn, textbox );
 	insertTuple( tuple, insertion_point );
 
+	// if new tab was added as a first or last tab, update button image 
+	// and update button image of any tab it may have affected
+	if (tuple == mTabList.front())
+	{  
+		update_images(tuple, mFirstTabParams, getTabPosition());
+
+		if (mTabList.size() == 2) 
+		{		
+			update_images(mTabList[1], mLastTabParams, getTabPosition());
+		}
+		else if (mTabList.size() > 2) 
+		{
+			update_images(mTabList[1], mMiddleTabParams, getTabPosition());
+		}
+	}
+	else if (tuple == mTabList.back())
+	{
+		update_images(tuple, mLastTabParams, getTabPosition());
+
+		if (mTabList.size() > 2)
+		{
+			update_images(mTabList[mTabList.size()-2], mMiddleTabParams, getTabPosition());
+		}
+	}
+
 	//Don't add button and textbox if tab buttons are invisible(EXT - 576)
 	if (!getTabsHidden())
 	{
@@ -1064,7 +1115,17 @@ void LLTabContainer::removeTabPanel(LLPanel* child)
 		LLTabTuple* tuple = *iter;
 		if( tuple->mTabPanel == child )
 		{
- 			removeChild( tuple->mButton );
+			// update tab button images if removing the first or last tab
+			if ((tuple == mTabList.front()) && (mTabList.size() > 1))
+			{
+				update_images(mTabList[1], mFirstTabParams, getTabPosition());
+			}
+			else if ((tuple == mTabList.back()) && (mTabList.size() > 2))
+			{
+				update_images(mTabList[mTabList.size()-2], mLastTabParams, getTabPosition());
+			}
+
+			removeChild( tuple->mButton );
  			delete tuple->mButton;
 
  			removeChild( tuple->mTabPanel );
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index e3af5384b18e224948cb7947cbaa428429d7fae5..a81974cd4226b826cbf8094d5875793c67280860 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -61,6 +61,17 @@ class LLTabContainer : public LLPanel
 		static void declareValues();
 	};
 
+	struct TabParams : public LLInitParam::Block<TabParams>
+	{
+		Optional<LLUIImage*>				tab_top_image_unselected,
+											tab_top_image_selected,
+											tab_bottom_image_unselected,
+											tab_bottom_image_selected,
+											tab_left_image_unselected,
+											tab_left_image_selected;		
+		TabParams();
+	};
+
 	struct Params
 	:	public LLInitParam::Block<Params, LLPanel::Params>
 	{
@@ -73,12 +84,9 @@ class LLTabContainer : public LLPanel
 		Optional<bool>						hide_tabs;
 		Optional<S32>						tab_padding_right;
 
-		Optional<LLUIImage*>				tab_top_image_unselected,
-											tab_top_image_selected,
-											tab_bottom_image_unselected,
-											tab_bottom_image_selected,
-											tab_left_image_unselected,
-											tab_left_image_selected;
+		Optional<TabParams>					first_tab,
+											middle_tab,
+											last_tab;
 
 		Params();
 	};
@@ -215,6 +223,9 @@ class LLTabContainer : public LLPanel
 	void updateMaxScrollPos();
 	void commitHoveredButton(S32 x, S32 y);
 
+	// updates tab button images given the tuple, tab position and the corresponding params
+	void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos);
+
 	// Variables
 	
 	typedef std::vector<LLTabTuple*> tuple_list_t;
@@ -252,12 +263,9 @@ class LLTabContainer : public LLPanel
 
 	LLFrameTimer					mDragAndDropDelayTimer;
 
-	LLPointer<LLUIImage>			mImageTopUnselected;
-	LLPointer<LLUIImage>			mImageTopSelected;
-	LLPointer<LLUIImage>			mImageBottomUnselected;
-	LLPointer<LLUIImage>			mImageBottomSelected;
-	LLPointer<LLUIImage>			mImageLeftUnselected;
-	LLPointer<LLUIImage>			mImageLeftSelected;
+	TabParams						mFirstTabParams;
+	TabParams						mMiddleTabParams;
+	TabParams						mLastTabParams;
 };
 
 #endif  // LL_TABCONTAINER_H
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 5827c0d627bdd3277f5fbc52e698da0314ae86ca..851091f0ca2ecc64f57175b430d5f39f6a534bed 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -3,7 +3,30 @@
  * @brief brief LLUIColorTable class implementation file
  *
  * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
  * Copyright (c) 2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */
 
diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h
index f102a573b84928c18aabe79def3e2791eeec9478..59be0c4f9a4d9a35597fef9700a4fd68df3c9927 100644
--- a/indra/llui/lluicolortable.h
+++ b/indra/llui/lluicolortable.h
@@ -3,7 +3,30 @@
  * @brief brief LLUIColorTable class header file
  *
  * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
  * Copyright (c) 2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index bb00468d40c0c5eaae18c5e6e96f5bd4557668b7..c1866c36a2436cfcc793011d628265b434c6a01d 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1310,6 +1310,11 @@ void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_a
 		// TODO: enable the removing of a single undershirt/underpants if multiple are worn. - Nyx
 		return;
 	}
+	if (getWearableCount(type) == 0)
+	{
+		// no wearables to remove
+		return;
+	}
 
 	if (do_remove_all)
 	{
@@ -1431,6 +1436,9 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
 	wearables_to_remove[WT_UNDERSHIRT]	= (!gAgent.isTeen()) & remove;
 	wearables_to_remove[WT_UNDERPANTS]	= (!gAgent.isTeen()) & remove;
 	wearables_to_remove[WT_SKIRT]		= remove;
+	wearables_to_remove[WT_ALPHA]		= remove;
+	wearables_to_remove[WT_TATTOO]		= remove;
+
 
 	S32 count = wearables.count();
 	llassert(items.count() == count);
@@ -1743,6 +1751,8 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed)
 		gAgentWearables.removeWearable(WT_UNDERSHIRT,true,0);
 		gAgentWearables.removeWearable(WT_UNDERPANTS,true,0);
 		gAgentWearables.removeWearable(WT_SKIRT,true,0);
+		gAgentWearables.removeWearable(WT_ALPHA,true,0);
+		gAgentWearables.removeWearable(WT_TATTOO,true,0);
 	}
 }
 
diff --git a/indra/newview/llcapabilitylistener.cpp b/indra/newview/llcapabilitylistener.cpp
index 785a647fa2901e099b4cfc926164167a0a5e8812..ed9613c1bccf2c69039490edfb700abf93874888 100644
--- a/indra/newview/llcapabilitylistener.cpp
+++ b/indra/newview/llcapabilitylistener.cpp
@@ -5,7 +5,30 @@
  * @brief  Implementation for llcapabilitylistener.
  * 
  * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
  * Copyright (c) 2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llcapabilitylistener.h b/indra/newview/llcapabilitylistener.h
index ce16b7da5daa7be22354392c815d92f54f3b0209..be51cf1b8cae1b9d8e541ef02ca3771493f52517 100644
--- a/indra/newview/llcapabilitylistener.h
+++ b/indra/newview/llcapabilitylistener.h
@@ -5,7 +5,30 @@
  * @brief  Provide an event-based API for capability requests
  * 
  * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
  * Copyright (c) 2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llcapabilityprovider.h b/indra/newview/llcapabilityprovider.h
index 0ddb2b6cb9d675214ca78a8b808518cf5c11d53c..3d07904775740cee7f95e24670c3047c21d9262c 100644
--- a/indra/newview/llcapabilityprovider.h
+++ b/indra/newview/llcapabilityprovider.h
@@ -6,7 +6,30 @@
  *         capability.
  * 
  * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * 
  * Copyright (c) 2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llface.inl b/indra/newview/llface.inl
index 38f38f5466e0a03ce94b3ec8e71d221ae71154bc..176c73e38e541cfc92fd9006fbfaf7506b0cc472 100644
--- a/indra/newview/llface.inl
+++ b/indra/newview/llface.inl
@@ -4,7 +4,7 @@
  *
  * $LicenseInfo:firstyear=2001&license=viewergpl$
  * 
- * Copyright (c) 2001-2007, Linden Research, Inc.
+ * Copyright (c) 2001-2009, Linden Research, Inc.
  * 
  * Second Life Viewer Source Code
  * The source code in this file ("Source Code") is provided by Linden Lab
@@ -12,12 +12,13 @@
  * ("GPL"), unless you have obtained a separate licensing agreement
  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  * 
  * There are special exceptions to the terms and conditions of the GPL as
  * it is applied to this Source Code. View the full text of the exception
  * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  * 
  * By copying, modifying or distributing this software, you acknowledge
  * that you have read and understood your obligations described above,
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index ab5d8601d05c1354e1a29ddca840233442f3db70..f9dde034513b93388dcaa63b7c4ec463229ce854 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -68,15 +68,11 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
 	mHeightPixels( NULL ),
 	mHomeURL( NULL ),
 	mCurrentURL( NULL ),
-	mAltImageEnable( NULL ),
 	mParent( NULL ),
 	mMediaEditable(false)
 {
 	// build dialog from XML
 	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_general.xml");
-//	mCommitCallbackRegistrar.add("Media.ResetCurrentUrl",		boost::bind(&LLPanelMediaSettingsGeneral::onBtnResetCurrentUrl, this));
-//	mCommitCallbackRegistrar.add("Media.CommitHomeURL",			boost::bind(&LLPanelMediaSettingsGeneral::onCommitHomeURL, this));	
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -84,7 +80,6 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
 BOOL LLPanelMediaSettingsGeneral::postBuild()
 {
 	// connect member vars with UI widgets
-    mAltImageEnable = getChild< LLCheckBoxCtrl >( LLMediaEntry::ALT_IMAGE_ENABLE_KEY );
 	mAutoLoop = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_LOOP_KEY );
 	mAutoPlay = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_PLAY_KEY );
 	mAutoScale = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_SCALE_KEY );
@@ -192,7 +187,6 @@ void LLPanelMediaSettingsGeneral::draw()
 void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
 {	
 	LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
-	self->mAltImageEnable ->clear();
 	self->mAutoLoop->clear();
 	self->mAutoPlay->clear();
 	self->mAutoScale->clear();
@@ -203,7 +197,6 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
 	self->mHeightPixels->clear();
 	self->mHomeURL->clear();
 	self->mWidthPixels->clear();
-	self->mAltImageEnable ->setEnabled(editable);
 	self->mAutoLoop ->setEnabled(editable);
 	self->mAutoPlay ->setEnabled(editable);
 	self->mAutoScale ->setEnabled(editable);
@@ -272,7 +265,6 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_
 		{ LLMediaEntry::HOME_URL_KEY,				self->mHomeURL,			"LLLineEditor" },
 		{ LLMediaEntry::FIRST_CLICK_INTERACT_KEY,	self->mFirstClick,		"LLCheckBoxCtrl" },
 		{ LLMediaEntry::WIDTH_PIXELS_KEY,			self->mWidthPixels,		"LLSpinCtrl" },
-		{ LLMediaEntry::ALT_IMAGE_ENABLE_KEY,		self->mAltImageEnable,	"LLCheckBoxCtrl" },
 		{ "", NULL , "" }
 	};
 
@@ -393,7 +385,6 @@ void LLPanelMediaSettingsGeneral::apply( void* userdata )
 //
 void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in )
 {
-    fill_me_in[LLMediaEntry::ALT_IMAGE_ENABLE_KEY] = mAltImageEnable->getValue();
     fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = mAutoLoop->getValue();
     fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = mAutoPlay->getValue();
     fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue();
diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h
index 5eb42ffaf484c259d12e63d2e6de7b8b3bf1e66e..e82a31382ef6226e23da4513fe0b09d5a1959877 100644
--- a/indra/newview/llpanelmediasettingsgeneral.h
+++ b/indra/newview/llpanelmediasettingsgeneral.h
@@ -85,7 +85,6 @@ class LLPanelMediaSettingsGeneral : public LLPanel
 	LLSpinCtrl* mHeightPixels;
 	LLLineEditor* mHomeURL;
 	LLLineEditor* mCurrentURL;
-	LLCheckBoxCtrl* mAltImageEnable;
 	LLMediaCtrl* mPreviewMedia;
 };
 
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index d1ad89442c5f63f4fc5249bf5f03e5c2709bbaf1..b219081cb8c55995aaebc386cb9e2ed41bfed5a4 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -408,9 +408,10 @@ BOOL LLWearable::importFile( LLFILE* file )
 		{
 			delete mSavedTEMap[te];
 		}
-		
-		mTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer));
-		mSavedTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer));
+
+		LLUUID textureid(text_buffer);
+		mTEMap[te] = new LLLocalTextureObject(image, textureid);
+		mSavedTEMap[te] = new LLLocalTextureObject(image, textureid);
 		createLayers(te);
 	}
 
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index b898fd7c938a7ba2a969f4b8eab6d9eb7ef42720..8cdcee69277fe5e0bf5d1adbb8ee61a9f1e079bb 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -247,7 +247,7 @@
          name="radio stretch" />
         <radio_item
 		 top_pad="6"
-         label="Select Texture"
+         label="Select Face"
          layout="topleft"
          name="radio select face" />
 			<radio_group.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
index c725334fc016278b4d1319d2fe898156724f6048..7e8b553644fc39afda59fd51966e1bef556f52ec 100644
--- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
@@ -135,7 +135,8 @@
 
   <check_box 
    bottom_delta="-25" 
-   enabled="true" 
+   visible="false" 
+   enabled="false" 
    follows="left|top" 
    font="SansSerifSmall"
    height="16" 
@@ -148,7 +149,7 @@
    width="150" />
 
   <check_box 
-   bottom_delta="-25" 
+   bottom_delta="0" 
    enabled="true" 
    follows="left|top"
    font="SansSerifSmall"
@@ -161,20 +162,6 @@
    radio_style="false" 
    width="150" />
 
-  <check_box 
-   bottom_delta="-25" 
-   enabled="true" 
-   follows="left|top" 
-   font="SansSerifSmall"
-   height="16" 
-   initial_value="false"
-   label="Use Default Alternative Image" 
-   left="10" 
-   mouse_opaque="true"
-   name="alt_image_enable" 
-   radio_style="false" 
-   width="150" />
-
   <check_box 
    bottom_delta="-25" 
    enabled="true" 
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index 25d85899a1943bb6cbcfd169593f227a803269f5..2fe5f517a2359240686231248ce45d9752b8f735 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -1,10 +1,23 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <tab_container tab_min_width="60"
                tab_max_width="150"
-               tab_height="16"
-               tab_top_image_unselected="TabTop_Middle_Off"
-               tab_top_image_selected="TabTop_Middle_Selected"
+               tab_height="16">
+  <first_tab tab_top_image_unselected="TabTop_Left_Off"
+               tab_top_image_selected="TabTop_Left_Selected"
                tab_bottom_image_unselected="Toolbar_Left_Off"
                tab_bottom_image_selected="Toolbar_Left_Selected"
-               tab_left_image_unselected="TabTop_Left_Off"
-               tab_left_image_selected="TabTop_Left_Selected"/>
\ No newline at end of file
+               tab_left_image_unselected="TabTop_Middle_Off"
+               tab_left_image_selected="TabTop_Middle_Selected"/>
+  <middle_tab tab_top_image_unselected="TabTop_Middle_Off"
+               tab_top_image_selected="TabTop_Middle_Selected"
+               tab_bottom_image_unselected="Toolbar_Middle_Off"
+               tab_bottom_image_selected="Toolbar_Middle_Selected"
+               tab_left_image_unselected="TabTop_Middle_Off"
+               tab_left_image_selected="TabTop_Middle_Selected"/>
+  <last_tab tab_top_image_unselected="TabTop_Right_Off"
+               tab_top_image_selected="TabTop_Right_Selected"
+               tab_bottom_image_unselected="Toolbar_Right_Off"
+               tab_bottom_image_selected="Toolbar_Right_Selected"
+               tab_left_image_unselected="TabTop_Middle_Off"
+               tab_left_image_selected="TabTop_Middle_Selected"/>
+</tab_container>
\ No newline at end of file
diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp
index b965379c9c02f19c7d7abbea951ae080795c476b..4759c7dc912189b401ebcf9217eb3ce971de2aef 100644
--- a/indra/newview/tests/llcapabilitylistener_test.cpp
+++ b/indra/newview/tests/llcapabilitylistener_test.cpp
@@ -5,7 +5,30 @@
  * @brief  Test for llcapabilitylistener.cpp.
  * 
  * $LicenseInfo:firstyear=2008&license=viewergpl$
- * Copyright (c) 2008, Linden Research, Inc.
+ * 
+ * Copyright (c) 2008-2009, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
  * $/LicenseInfo$
  */