diff --git a/doc/contributions.txt b/doc/contributions.txt
index 2d3fa99c8b65c1d901a3f431d9ea680bba1c5dc6..897977cb9ab2485860a871a968b1333f96a03ee7 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -31,6 +31,9 @@ Alissa Sabre
 	VWR-1353
 	VWR-1410
 	VWR-2116
+	VWR-2826
+Angus Boyd
+	VWR-592
 Argent Stonecutter
 	VWR-68
 Benja Kepler
@@ -149,6 +152,8 @@ Matthew Dowd
 	VWR-1761
 McCabe Maxsted
 	VWR-1318
+Michelle2 Zenovka
+	VWR-2834
 Mr Greggan
 	VWR-445
 Nicholaz Beresford
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 71b7347c4aeaa752d4f17e165bb0f71a713d0400..e3a4df190ec2a70d2844dab9409e97ca6149523f 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -34,8 +34,8 @@
 
 const S32 LL_VERSION_MAJOR = 1;
 const S32 LL_VERSION_MINOR = 18;
-const S32 LL_VERSION_PATCH = 4;
-const S32 LL_VERSION_BUILD = 3;
+const S32 LL_VERSION_PATCH = 5;
+const S32 LL_VERSION_BUILD = 1;
 
 const char * const LL_CHANNEL = "Second Life Release";
 
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 0a63ebbe74fe83482a23892d4bf0235c817bbad0..420970a38aeca9097d5d8d5158570cc3cc02f89d 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1637,6 +1637,9 @@ void LLLineEditor::draw()
 				S32 pixels_after_scroll = findPixelNearestPos();	// RCalculcate for IME position
 				LLRect screen_pos = getScreenRect();
 				LLCoordGL ime_pos( screen_pos.mLeft + pixels_after_scroll, screen_pos.mTop - UI_LINEEDITOR_V_PAD );
+
+				ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]);
+				ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]);
 				getWindow()->setLanguageTextInput( ime_pos );
 			}
 		}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 8ec5656e189a4b59d2739e048e4666edcee0cd94..d150f8954ef262d365b79a77ceabd6ae26bd9fb6 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1421,6 +1421,7 @@ void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility )
 	{
 		mBranch->setVisible(FALSE);
 	}
+	LLMenuItemGL::onVisibilityChange(new_visibility);
 }
 
 BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index af1813a429a361e9ddcda95c257a0b256996ce11..fa1181a866f65a51db7fd7a9e2ba19d3122e231a 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2816,6 +2816,9 @@ void LLTextEditor::drawCursor()
 				// Make sure the IME is in the right place
 				LLRect screen_pos = getScreenRect();
 				LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_left), screen_pos.mBottom + llfloor(cursor_top) );
+
+				ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]);
+				ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]);
 				getWindow()->setLanguageTextInput( ime_pos );
 			}
 		}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 4d3bdaed9891cd3912d1e3c4a1293a6524b8d29b..a047f9912e8330ae23b347806bce5b7ba5374bb7 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -797,6 +797,7 @@ BOOL LLView::setLabelArg(const LLString& key, const LLStringExplicit& text)
 	return FALSE;
 }
 
+// virtual
 void LLView::onVisibilityChange ( BOOL new_visibility )
 {
 	for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 0286623662edb14353425352496772f8ebdd2e55..e5fd0f7360809f66c2f6b178e435a008bfaa8ba8 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -89,6 +89,7 @@ void show_window_creation_error(const char* title)
 BOOL LLWindowWin32::sIsClassRegistered = FALSE;
 
 BOOL	LLWindowWin32::sLanguageTextInputAllowed = TRUE;
+BOOL	LLWindowWin32::sWinIMEOpened = FALSE;
 HKL		LLWindowWin32::sWinInputLocale = 0;
 DWORD	LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE;
 DWORD	LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC;
@@ -3325,7 +3326,7 @@ void LLWindowWin32::focusClient()
 
 void LLWindowWin32::allowLanguageTextInput(BOOL b)
 {
-	if ( !LLWinImm::isAvailable() )
+	if (b == sLanguageTextInputAllowed || !LLWinImm::isAvailable())
 	{
 		return;
 	}
@@ -3336,14 +3337,13 @@ void LLWindowWin32::allowLanguageTextInput(BOOL b)
 		// Allowing: Restore the previous IME status, so that the user has a feeling that the previous 
 		// text input continues naturally.  Be careful, however, the IME status is meaningful only during the user keeps 
 		// using same Input Locale (aka Keyboard Layout).
-		HIMC himc = LLWinImm::getContext(mWindowHandle);
-		LLWinImm::setOpenStatus(himc, TRUE);
-		if (GetKeyboardLayout(0) == sWinInputLocale && sWinIMEConversionMode != IME_CMODE_RESERVED)
+		if (sWinIMEOpened && GetKeyboardLayout(0) == sWinInputLocale)
 		{
+			HIMC himc = LLWinImm::getContext(mWindowHandle);
+			LLWinImm::setOpenStatus(himc, TRUE);
 			LLWinImm::setConversionStatus(himc, sWinIMEConversionMode, sWinIMESentenceMode);
-			sWinIMEConversionMode = IME_CMODE_RESERVED;		// Set saved state so we won't do this repeatedly
+			LLWinImm::releaseContext(mWindowHandle, himc);
 		}
-		LLWinImm::releaseContext(mWindowHandle, himc);
 	}
 	else
 	{
@@ -3351,10 +3351,12 @@ void LLWindowWin32::allowLanguageTextInput(BOOL b)
 		// However, do it after saving the current IME  status.  We need to restore the status when
 		//   allowing language text input again.
 		sWinInputLocale = GetKeyboardLayout(0);
-		if ( LLWinImm::isIME(sWinInputLocale) )
+		sWinIMEOpened = LLWinImm::isIME(sWinInputLocale);
+		if (sWinIMEOpened)
 		{
 			HIMC himc = LLWinImm::getContext(mWindowHandle);
-			if ( LLWinImm::getOpenStatus(himc) )
+			sWinIMEOpened = LLWinImm::getOpenStatus(himc);
+			if (sWinIMEOpened)
 			{
 				LLWinImm::getConversionStatus(himc, &sWinIMEConversionMode, &sWinIMESentenceMode);
 
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 62b1f73cedeec8f7caa64b12a5052ceec79b25d0..602e06600f25159cac347247aa669d59d7507097 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -184,6 +184,7 @@ class LLWindowWin32 : public LLWindow
 	// They are all static, since one context is shared by all LLWindowWin32
 	// instances.
 	static BOOL		sLanguageTextInputAllowed;
+	static BOOL		sWinIMEOpened;
 	static HKL		sWinInputLocale;
 	static DWORD	sWinIMEConversionMode;
 	static DWORD	sWinIMESentenceMode;
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings
index 8929cb42261586c76f06b21f80f13ee25d600b3a..a25f97768a28df012df5bd98f8a1120817fe7bcf 100644
--- a/indra/newview/English.lproj/InfoPlist.strings
+++ b/indra/newview/English.lproj/InfoPlist.strings
@@ -1,5 +1,5 @@
 /* Localized versions of Info.plist keys */
 
 CFBundleName = "Second Life";
-CFBundleShortVersionString = "Second Life version 1.18.4.3";
-CFBundleGetInfoString = "Second Life version 1.18.4.3, Copyright 2004-2007 Linden Research, Inc.";
+CFBundleShortVersionString = "Second Life version 1.18.5.1";
+CFBundleGetInfoString = "Second Life version 1.18.5.1, Copyright 2004-2007 Linden Research, Inc.";
diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist
index 077849439419df897ce613eefbe2a727171f20a5..2c9f58a0c01da8a166d34e1efbd1e2a504a1d290 100644
--- a/indra/newview/Info-SecondLife.plist
+++ b/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1.18.4.3</string>
+	<string>1.18.5.1</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 </dict>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index d7e316438c9ec8001faaaadeeec764cfe4dd5efc..39d4a3fc158424777148db3e1f495c78823ff2cc 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2954,6 +2954,7 @@ void LLAgent::endAnimationUpdateUI()
 	// Don't let this be called more than once if the camera
 	// mode hasn't changed.  --JC
 	mLastCameraMode = mCameraMode;
+
 }
 
 
@@ -4214,15 +4215,22 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)
 	if (animate && !mAvatarObject.isNull())
 	{
 		sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START);
+		mAvatarObject->startMotion(ANIM_AGENT_CUSTOMIZE);
 		LLMotion* turn_motion = mAvatarObject->findMotion(ANIM_AGENT_CUSTOMIZE);
+
 		if (turn_motion)
 		{
 			mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP;
+
 		}
 		else
 		{
 			mAnimationDuration = gSavedSettings.getF32("ZoomTime");
 		}
+
+
+
+
 		gAgent.setFocusGlobal(LLVector3d::zero);
 	}
 	else
diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp
index 3a31074ed0219f837c13b4b52dec52b268ed80fd..7a575ca5fda8873ebb53bf8534116c2c7e83cc4f 100644
--- a/indra/newview/llclassifiedstatsresponder.cpp
+++ b/indra/newview/llclassifiedstatsresponder.cpp
@@ -19,14 +19,14 @@
 #include "llview.h"
 #include "message.h"
 
-LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLViewHandle classified_panel_handle)
-: mClassifiedPanelHandle(classified_panel_handle)
+LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLViewHandle classified_panel_handle, LLUUID classified_id)
+: mClassifiedPanelHandle(classified_panel_handle),
+mClassifiedID(classified_id)
 {
 }
 /*virtual*/
 void LLClassifiedStatsResponder::result(const LLSD& content)
 {
-	LLUUID classified_id = content["classified_id"];
 	S32 teleport = content["teleport_clicks"].asInteger();
 	S32 map = content["map_clicks"].asInteger();
 	S32 profile = content["profile_clicks"].asInteger();
@@ -34,16 +34,15 @@ void LLClassifiedStatsResponder::result(const LLSD& content)
 	S32 search_map = content["search_map_clicks"].asInteger();
 	S32 search_profile = content["search_profile_clicks"].asInteger();
 
-	std::string msg = llformat("Clicks: %d teleport, %d map, %d profile",
-									teleport + search_teleport,
-									map + search_map,
-									profile + search_profile);
-
 	LLPanelClassified* classified_panelp = (LLPanelClassified*)LLPanel::getPanelByHandle(mClassifiedPanelHandle);
 
 	if(classified_panelp)
 	{
-		classified_panelp->setClickThroughText(msg);
+		classified_panelp->setClickThrough(mClassifiedID, 
+											teleport + search_teleport, 
+											map + search_map,
+											profile + search_profile,
+											true);
 	}
 
 }
@@ -55,3 +54,4 @@ void LLClassifiedStatsResponder::error(U32 status, const std::string& reason)
 		<< status << ": " << reason << ")" << llendl;
 }
 
+
diff --git a/indra/newview/llclassifiedstatsresponder.h b/indra/newview/llclassifiedstatsresponder.h
index 25ae67141c4f89f07cf892ea195a45a6a3ef9133..ed19311a9a07c057f228612a13d2a6d674ec4aec 100644
--- a/indra/newview/llclassifiedstatsresponder.h
+++ b/indra/newview/llclassifiedstatsresponder.h
@@ -11,11 +11,12 @@
 
 #include "llhttpclient.h"
 #include "llview.h"
+#include "lluuid.h"
 
 class LLClassifiedStatsResponder : public LLHTTPClient::Responder
 {
 public:
-	LLClassifiedStatsResponder(LLViewHandle classified_panel_handle);
+	LLClassifiedStatsResponder(LLViewHandle classified_panel_handle, LLUUID classified_id);
 	//If we get back a normal response, handle it here
 	virtual void result(const LLSD& content);
 	//If we get back an error (not found, etc...), handle it here
@@ -23,6 +24,7 @@ class LLClassifiedStatsResponder : public LLHTTPClient::Responder
 
 protected:
 	LLViewHandle mClassifiedPanelHandle;
+	LLUUID mClassifiedID;
 };
 
 #endif // LL_LLCLASSIFIEDSTATSRESPONDER_H
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index b435ada46303c8bfd5233238dd23ed3226e891fd..5fdbf7d4084f45759f0e6d33dadd0a28e45f836c 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -164,6 +164,7 @@ void LLFloaterChat::onVisibilityChange(BOOL new_visibility)
 {
 	// Hide the chat overlay when our history is visible.
 	gConsole->setVisible( !new_visibility );
+	LLFloater::onVisibilityChange(new_visibility);
 }
 
 
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 821eaf1a72bff13737fda783ed26d291e278b66c..04fb54b0a7efd363c32d854c22a76e059eff84d0 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -91,7 +91,8 @@ class LLDispatchClassifiedClickThrough : public LLDispatchHandler
 		S32 profile_clicks = atoi(strings[3].c_str());
 		LLPanelClassified::setClickThrough(classified_id, teleport_clicks,
 										   map_clicks,
-										   profile_clicks);
+										   profile_clicks,
+										   false);
 		return true;
 	}
 };
@@ -127,7 +128,14 @@ LLPanelClassified::LLPanelClassified(BOOL in_finder, bool from_search)
 	mProfileBtn(NULL),
 	mInfoText(NULL),
 	mSetBtn(NULL),
-	mClickThroughText(NULL)
+	mClickThroughText(NULL),
+	mTeleportClicksOld(0),
+	mMapClicksOld(0),
+	mProfileClicksOld(0),
+	mTeleportClicksNew(0),
+	mMapClicksNew(0),
+	mProfileClicksNew(0)
+
 {
     sAllPanels.push_back(this);
 
@@ -368,16 +376,12 @@ void LLPanelClassified::setClassifiedID(const LLUUID& id)
 	mClassifiedID = id;
 }
 
-void LLPanelClassified::setClickThroughText(const std::string& text)
-{
-	if(mClickThroughText)
-		this->mClickThroughText->setText(text);
-}
 //static
 void LLPanelClassified::setClickThrough(const LLUUID& classified_id,
 										S32 teleport,
 										S32 map,
-										S32 profile)
+										S32 profile,
+										bool from_new_table)
 {
 	for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
 	{
@@ -388,22 +392,29 @@ void LLPanelClassified::setClickThrough(const LLUUID& classified_id,
 			continue;
 		}
 
-		// We need to see if we should use the new stat table or the old.  
-		// If the SearchStatRequest capability exists, then the data will come
-		// from the new table.
-		std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
+		// We need to check to see if the data came from the new stat_table 
+		// or the old classified table. We also need to cache the data from 
+		// the two separate sources so as to display the aggregate totals.
 
-		if (!url.empty())
+		if (from_new_table)
 		{
-			return;
+			self->mTeleportClicksNew = teleport;
+			self->mMapClicksNew = map;
+			self->mProfileClicksNew = profile;
+		}
+		else
+		{
+			self->mTeleportClicksOld = teleport;
+			self->mMapClicksOld = map;
+			self->mProfileClicksOld = profile;
 		}
 
 		if (self->mClickThroughText)
 		{
 			std::string msg = llformat("Clicks: %d teleport, %d map, %d profile",
-									teleport,
-									map,
-									profile);
+									self->mTeleportClicksNew + self->mTeleportClicksOld,
+									self->mMapClicksNew + self->mMapClicksOld,
+									self->mProfileClicksNew + self->mProfileClicksOld);
 			self->mClickThroughText->setText(msg);
 		}
 	}
@@ -449,7 +460,7 @@ void LLPanelClassified::sendClassifiedInfoRequest()
 		if (!url.empty())
 		{
 			llinfos << "Classified stat request via capability" << llendl;
-			LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle()));
+			LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle(), mClassifiedID));
 		}
 	}
 }
@@ -929,7 +940,6 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type)
 	strings.push_back(mClassifiedID.asString());
 	strings.push_back(type);
 	LLUUID no_invoice;
-	send_generic_message("classifiedclick", strings, no_invoice);
 
 	// New classified click-through handling
 	LLSD body;
@@ -938,11 +948,16 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type)
 	body["classified_id"] = mClassifiedID;
 	std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
 
+	// If the capability exists send to the new database, otherwise send to the old one.
 	if (!url.empty())
 	{
 		llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl;
 		LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
 	}
+	else
+	{
+		send_generic_message("classifiedclick", strings, no_invoice);
+	}
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h
index 6ebac4c98a0db04fabd5d1bcce7cb9a36a5ecf9f..a2bb29b2242ac5904f8b55119d49b485e08d0885 100644
--- a/indra/newview/llpanelclassified.h
+++ b/indra/newview/llpanelclassified.h
@@ -81,7 +81,7 @@ class LLPanelClassified : public LLPanel
 	void setClassifiedID(const LLUUID& id);
 	void setClickThroughText(const std::string& text);
 	static void setClickThrough(const LLUUID& classified_id,
-								S32 teleport, S32 map, S32 profile);
+								S32 teleport, S32 map, S32 profile, bool from_new_table);
 
 	// check that the title is valid (E.G. starts with a number or letter)
 	BOOL titleIsValid();
@@ -129,6 +129,14 @@ class LLPanelClassified : public LLPanel
 	LLUUID mParcelID;
 	S32 mPriceForListing;
 
+	// Needed for stat tracking
+	S32 mTeleportClicksOld;
+	S32 mMapClicksOld;
+	S32 mProfileClicksOld;
+	S32 mTeleportClicksNew;
+	S32 mMapClicksNew;
+	S32 mProfileClicksNew;
+
 	// Data will be requested on first draw
 	BOOL mDataRequested;
 
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 923f4b31156ea0370faff381e6d23a661cb83fb7..7beba92ebb552f866f7807c8bf8ba1b8230d8f47 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -741,17 +741,17 @@ void LLPanelPermissions::refresh()
 		}
 	}
 
-	if (is_for_sale)
+	childSetValue("checkbox for sale", is_for_sale);
+
+	// HACK: There are some old objects in world that are set for sale,
+	// but are no-transfer.  We need to let users turn for-sale off, but only
+	// if for-sale is set.
+	bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY);
+	if (is_for_sale && has_change_sale_ability && cannot_actually_sell)
 	{
-		childSetValue("checkbox for sale",TRUE);
-		childSetTentative("checkbox for sale",!can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY));
+		childSetEnabled("checkbox for sale", true);
 	}
-	else
-	{
-		childSetValue("checkbox for sale",FALSE);
-		childSetTentative("checkbox for sale",false);
-	}
-
+		
 	// Check search status of objects
 	BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME );
 	bool include_in_search;
diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp
index 459e726f87bb0daae7c8e983d16fc7a139f52a3a..8825ce71fcaa8def17fb9259963af3484992586b 100644
--- a/indra/newview/llpanelplace.cpp
+++ b/indra/newview/llpanelplace.cpp
@@ -89,6 +89,9 @@ BOOL LLPanelPlace::postBuild()
 	mSnapshotCtrl->setEnabled(FALSE);
 
     mNameEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "name_editor");
+	// Text boxes appear to have a " " in them by default.  This breaks the
+	// emptiness test for filling in data from the network.  Slam to empty.
+	mNameEditor->setText( LLString::null );
 
     mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor");
 
@@ -127,6 +130,26 @@ void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem)
 	mDescEditor->setText(pItem->getDescription());
 }
 
+// Use this for search directory clicks, because we are totally
+// recycling the panel and don't need to use what's there.
+//
+// For SLURL clicks, don't call this, because we need to cache
+// the location info from the user.
+void LLPanelPlace::resetLocation()
+{
+	mParcelID.setNull();
+	mRequestedID.setNull();
+	mRegionID.setNull();
+	mLandmarkAssetID.setNull();
+	mPosGlobal.clearVec();
+	mPosRegion.clearVec();
+	mAuctionID = 0;
+	mNameEditor->setText( LLString::null );
+	mDescEditor->setText( LLString::null );
+	mInfoEditor->setText( LLString::null );
+	mLocationEditor->setText( LLString::null );
+}
+
 void LLPanelPlace::setParcelID(const LLUUID& parcel_id)
 {
 	mParcelID = parcel_id;
@@ -138,10 +161,6 @@ void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id)
 	mSnapshotCtrl->setImageAssetID(snapshot_id);
 }
 
-void LLPanelPlace::setName(const std::string& name)
-{
-	mNameEditor->setText(name);
-}
 
 void LLPanelPlace::setLocationString(const std::string& location)
 {
@@ -240,11 +259,17 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
 		std::string name_str(name);
 		std::string desc_str(desc);
 
-		if(! name_str.empty() && ! self->mNameEditor->getText().empty())
+		if( !name_str.empty()
+			&& self->mNameEditor->getText().empty())
+		{
 			self->mNameEditor->setText(name_str);
+		}
 
-		if(! desc_str.empty() && ! self->mDescEditor->getText().empty())
+		if( !desc_str.empty()
+			&& self->mDescEditor->getText().empty())
+		{
 			self->mDescEditor->setText(desc_str);
+		}
 
 		LLString info_text;
 		LLUIString traffic = self->getUIString("traffic_text");
@@ -280,6 +305,19 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
 		S32 region_y = llround(self->mPosRegion.mV[1]);
 		S32 region_z = llround(self->mPosRegion.mV[2]);
 
+		// If the region position is zero, grab position from the global
+		if(self->mPosRegion.isExactlyZero())
+		{
+			region_x = llround(global_x) % REGION_WIDTH_UNITS;
+			region_y = llround(global_y) % REGION_WIDTH_UNITS;
+			region_z = llround(global_z);
+		}
+
+		if(self->mPosGlobal.isExactlyZero())
+		{
+			self->mPosGlobal.setVec(global_x, global_y, global_z);
+		}
+
 		LLString location = llformat("%s %d, %d, %d (%s)",
 			sim_name, region_x, region_y, region_z, rating);
 		self->mLocationEditor->setText(location);
diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h
index 8f56eda729e319e490ee5679f468666a6ba83e42..c47390069312d106c60279e0d80b8f513cab9fe4 100644
--- a/indra/newview/llpanelplace.h
+++ b/indra/newview/llpanelplace.h
@@ -53,11 +53,17 @@ class LLPanelPlace : public LLPanel
 
 	/*virtual*/ BOOL postBuild();
 
-	void displayItemInfo(const LLInventoryItem* pItem);
+	void resetLocation();
+		// Ignore all old location information, useful if you are 
+		// recycling an existing dialog and need to clear it.
+
 	void setParcelID(const LLUUID& parcel_id);
+		// Sends a request for data about the given parcel, which will
+		// only update the location if there is none already available.
+
+	void displayItemInfo(const LLInventoryItem* pItem);
 	void setRegionID(const LLUUID& region_id) { mRegionID = region_id; }
 	void setSnapshot(const LLUUID& snapshot_id);
-	void setName(const std::string& name);
 	void setLocationString(const std::string& location);
 	void setErrorStatus(U32 status, const std::string& reason);
 
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index c6d9b2fbe2229cfc77934939bb9b46ef43cc73b2..51b9505980f0e7bcd41fe70ff818c4208bd7490c 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -154,7 +154,9 @@ bool LLURLDispatcherImpl::dispatchHelp(const std::string& url, BOOL right_mouse)
 {
 	if (matchPrefix(url, SLURL_SL_HELP_PREFIX))
 	{
+#if LL_LIBXUL_ENABLED
 		gViewerHtmlHelp.show();
+#endif // LL_LIBXUL_ENABLED
 		return true;
 	}
 	return false;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 688b2889c8da0bdf975d9732027e77d4f1667881..a6fb7fa0b75afedf30ab5057cf5acaf194d3c290 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5573,7 +5573,7 @@ class LLShowAgentProfile : public view_listener_t
 		LLVOAvatar* avatar = find_avatar_from_object(agent_id);
 		if (avatar)
 		{
-			LLFloaterAvatarInfo::show(agent_id);
+			LLFloaterAvatarInfo::show( avatar->getID() );
 		}
 		return true;
 	}
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 2fdc0406843ae55ff77982263b2a95e3ef31c5d5..2011275bdb2e1365d032e1a8bcde9332da13f5cc 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -132,6 +132,7 @@
 #include "llappviewer.h"
 #include "llfloaterworldmap.h"
 #include "llviewerdisplay.h"
+#include "llkeythrottle.h"
 
 #include <boost/tokenizer.hpp>
 
@@ -145,6 +146,12 @@
 const F32 BIRD_AUDIBLE_RADIUS = 32.0f;
 const F32 SIT_DISTANCE_FROM_TARGET = 0.25f;
 static const F32 LOGOUT_REPLY_TIME = 3.f;	// Wait this long after LogoutReply before quitting.
+
+// Determine how quickly residents' scripts can issue question dialogs
+// Allow bursts of up to 5 dialogs in 10 seconds. 10*2=20 seconds recovery if throttle kicks in
+static const U32 LLREQUEST_PERMISSION_THROTTLE_LIMIT	= 5;     // requests
+static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL	= 10.0f; // seconds
+
 extern BOOL gDebugClicks;
 
 // function prototypes
@@ -4457,6 +4464,27 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
 	// don't display permission requests if this object is muted - JS.
 	if (gMuteListp->isMuted(taskid)) return;
 
+	// throttle excessive requests from any specific user's scripts
+	LLString throttle_owner_name = owner_name;
+	typedef LLKeyThrottle<LLString> LLStringThrottle;
+	static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL );
+
+	switch (question_throttle.noteAction(throttle_owner_name))
+	{
+		case LLStringThrottle::THROTTLE_NEWLY_BLOCKED:
+			llinfos << "process_script_question throttled"
+					<< " owner_name:" << owner_name
+					<< llendl;
+			// Fall through
+
+		case LLStringThrottle::THROTTLE_BLOCKED:
+			// Escape altogether until we recover
+			return;
+
+		case LLStringThrottle::THROTTLE_OK:
+			break;
+	}
+
 	LLString script_question;
 	if (questions)
 	{
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 5bfe023168eeb38f714d4bbc9b88cb7bda5c2e53..00222123992c58dadc8b72cb9f00d92ae22c71fd 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -870,7 +870,7 @@ class CoarseLocationUpdate : public LLHTTPNode
 
 		for(int i=0; 
 			locs_it != locs.endArray(); 
-			i++, locs_it++, agents_it++)
+			i++, locs_it++)
 		{
 			U8 
 				x = locs_it->get("X").asInteger(),
@@ -903,6 +903,10 @@ class CoarseLocationUpdate : public LLHTTPNode
 					avatar_ids->put(agent_id);
 				}
 			}
+			if (has_agent_data)
+			{
+				agents_it++;
+			}
 		}
 	}
 };
diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py
index 8c500e4e081c19e1506fbae938bf81307800b297..d06e475341bcebb3a43df070bccd369522004cc5 100755
--- a/scripts/update_version_files.py
+++ b/scripts/update_version_files.py
@@ -18,6 +18,11 @@ def usage():
 Options:
   --version
    Specify the version string to replace current version.
+  --skip-on-branch
+   Specify a regular expression against which the current branch
+   is matched. If it matches, then leave version strings alone.
+   Use this to avoid changing version strings on release candidate
+   builds.
   --server
    Update llversionserver.h only with new version
   --viewer
@@ -34,6 +39,9 @@ def usage():
    # Update server and viewer build numbers to the current SVN revision:
    update_version_files.py
 
+   # Update build numbers unless we are on a release branch:
+   update_version_files.py --skip-on-branch='^Branch_'
+
    # Update server and viewer version numbers explicitly:
    update_version_files.py --version=1.18.1.6     
                                
@@ -109,8 +117,9 @@ def _getstatusoutput(cmd):
       'CFBundleGetInfoString = "Second Life version %(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s'))
 
 
-version_re = re.compile('(\d+).(\d+).(\d+).(\d+)')
-svn_re = re.compile('Last Changed Rev: (\d+)')
+version_re      = re.compile('(\d+).(\d+).(\d+).(\d+)')
+svn_branch_re   = re.compile('^URL:\s+\S+/([^/\s]+)$', re.MULTILINE)
+svn_revision_re = re.compile('^Last Changed Rev: (\d+)$', re.MULTILINE)
 
 def main():
     script_path = os.path.dirname(__file__)
@@ -119,15 +128,25 @@ def main():
 
     opts, args = getopt.getopt(sys.argv[1:],
                                "",
-                               ['version=', 'channel=', 'server_channel=', 'verbose', 'server', 'viewer', 'help'])
+                               ['version=',
+                                'channel=',
+                                'server_channel=',
+                                'skip-on-branch=',
+                                'verbose',
+                                'server',
+                                'viewer',
+                                'help'])
     update_server = False
     update_viewer = False
     new_version = None
     new_viewer_channel = None
     new_server_channel = None
+    skip_on_branch_re = None
     for o,a in opts:
         if o in ('--version'):
             new_version = a
+        if o in ('--skip-on-branch'):
+            skip_on_branch_re = re.compile(a)
         if o in ('--channel'):
             new_viewer_channel = a
         if o in ('--server_channel'):
@@ -193,16 +212,23 @@ def main():
         # Assume we're updating just the build number
         cl = 'svn info "%s"' % src_root
         status, output = _getstatusoutput(cl)
-        #print
-        #print "svn info output:"
-        #print "----------------"
-        #print output
-        m = svn_re.search(output)
-        if not m:
+        if verbose:
+            print
+            print "svn info output:"
+            print "----------------"
+            print output
+
+        branch_match = svn_branch_re.search(output)
+        revision_match = svn_revision_re.search(output)
+        if not branch_match or not revision_match:
             print "Failed to execute svn info, output follows:"
             print output
             return -1
-        revision = m.group(1)
+        branch = branch_match.group(1)
+        revision = revision_match.group(1)
+        if skip_on_branch_re and skip_on_branch_re.match(branch):
+            print "Release Candidate Build, leaving version files untouched."
+            return 0
         if update_viewer:
             m = version_re.match(viewer_version)
             viewer_version = m.group(1)+"."+m.group(2)+"."+m.group(3)+"."+revision