diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index cf73a1104d8fc24ee7eb522479dcbb18f43ae795..52ac981909ed06a7c28a376070c8e6309dc9651f 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -240,6 +240,17 @@ void LLFloaterBuyLand::updateEstateOwnerName(const std::string& name)
 	}
 }
 
+// static
+BOOL LLFloaterBuyLand::isOpen()
+{
+	LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE);
+	if (floater)
+	{
+		return floater->getVisible();
+	}
+	return FALSE;
+}
+
 // static
 LLFloaterBuyLandUI* LLFloaterBuyLandUI::sInstance = NULL;
 
@@ -717,10 +728,11 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
 	mParcelBuyInfo = gParcelMgr->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
 						gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
 
-	if (!mSiteMembershipUpgrade
-	&& !mSiteLandUseUpgrade
-	&& mCurrency.getAmount() == 0
-	&& mSiteConfirm != "password")
+	if (mParcelBuyInfo
+		&& !mSiteMembershipUpgrade
+		&& !mSiteLandUseUpgrade
+		&& mCurrency.getAmount() == 0
+		&& mSiteConfirm != "password")
 	{
 		sendBuyLand();
 		return;
@@ -779,10 +791,12 @@ void LLFloaterBuyLandUI::finishWebSitePrep()
 
 void LLFloaterBuyLandUI::sendBuyLand()
 {
-	gParcelMgr->sendParcelBuy(mParcelBuyInfo);
-	gParcelMgr->deleteParcelBuy(mParcelBuyInfo);
-	
-	mBought = true;
+	if (mParcelBuyInfo)
+	{
+		gParcelMgr->sendParcelBuy(mParcelBuyInfo);
+		gParcelMgr->deleteParcelBuy(mParcelBuyInfo);
+		mBought = true;
+	}
 }
 
 void LLFloaterBuyLandUI::updateNames()
diff --git a/indra/newview/llfloaterbuyland.h b/indra/newview/llfloaterbuyland.h
index 092c95802afb2819d3cb6989bceef5ddcca7a74c..22049d97a9748206f89aa993a81100a4e20deee7 100644
--- a/indra/newview/llfloaterbuyland.h
+++ b/indra/newview/llfloaterbuyland.h
@@ -23,6 +23,7 @@ class LLFloaterBuyLand
 	static void updateEstateName(const std::string& name);
 	static void updateLastModified(const std::string& text);
 	static void updateEstateOwnerName(const std::string& name);
+	static BOOL isOpen();
 };
 
 #endif
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 149a5858220986932e68421abbde98bf0a4671d0..c9aa9edebd7ab0ef8f67ed2717c1bbf14d65f94a 100644
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -25,7 +25,6 @@
 #include "llui.h"
 #include "llhttpclient.h"
 #include "llradiogroup.h"
-#include "llwebbrowserctrl.h"
 
 // static 
 LLFloaterTOS* LLFloaterTOS::sInstance = NULL;
@@ -133,12 +132,11 @@ BOOL LLFloaterTOS::postBuild()
 	LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "tos_html");
 	if ( web_browser )
 	{
-		// save the window id for this web browser widget
-		mWebBrowserWindowId = web_browser->getEmbeddedBrowserWindowId();
-
 		// start to observe it so we see navigate complete events
-		if ( mWebBrowserWindowId )
-			LLMozLib::getInstance()->addObserver( mWebBrowserWindowId, this );		
+		if ( web_browser )
+		{
+			web_browser->addObserver( this );		
+		};
 
 		gResponsePtr = LLIamHere::build( this );
 		LLHTTPClient::get( childGetValue( "real_url" ).asString(), gResponsePtr );
@@ -198,8 +196,11 @@ LLFloaterTOS::~LLFloaterTOS()
 {
 #if LL_LIBXUL_ENABLED
 	// stop obsaerving events
-	if ( mWebBrowserWindowId )
-		LLMozLib::getInstance()->addObserver( mWebBrowserWindowId, this );		
+	LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "tos_html");
+	if ( web_browser )
+	{
+		web_browser->addObserver( this );		
+	};
 #endif // LL_LIBXUL_ENABLED
 
 	// tell the responder we're not here anymore
diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h
index 1f504b4edb43d35e526f83fca0d72449eecce51e..b87ab3cad766ba5b64fa65c8542c328c5c52290e 100644
--- a/indra/newview/llfloatertos.h
+++ b/indra/newview/llfloatertos.h
@@ -11,7 +11,7 @@
 
 #include "llmodaldialog.h"
 #include "llassetstorage.h"
-#include "llmozlib.h"
+#include "llwebbrowserctrl.h"
 
 class LLButton;
 class LLRadioGroup;
@@ -21,7 +21,7 @@ class LLUUID;
 
 class LLFloaterTOS : 
 	public LLModalDialog,
-	public LLEmbeddedBrowserWindowObserver
+	public LLWebBrowserCtrlObserver
 {
 public:
 	virtual ~LLFloaterTOS();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index fb8438dc9353aa70da71985404f045513aa55de8..f333f7bb6c0c35e66fa4022e40d1393f7c96dad4 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -55,7 +55,7 @@ static LLString sOfflineMessage;
 //
 
 // returns true if a should appear before b
-BOOL group_dictionary_sort( LLGroupData* a, LLGroupData* b )
+static BOOL group_dictionary_sort( LLGroupData* a, LLGroupData* b )
 {
 	return (LLString::compareDict( a->mName, b->mName ) < 0);
 }
@@ -63,7 +63,7 @@ BOOL group_dictionary_sort( LLGroupData* a, LLGroupData* b )
 
 // the other_participant_id is either an agent_id, a group_id, or an inventory
 // folder item_id (collection of calling cards)
-LLUUID compute_session_id(EInstantMessage dialog, const LLUUID& other_participant_id)
+static LLUUID compute_session_id(EInstantMessage dialog, const LLUUID& other_participant_id)
 {
 	LLUUID session_id;
 	if (IM_SESSION_GROUP_START == dialog)
@@ -95,6 +95,7 @@ LLUUID compute_session_id(EInstantMessage dialog, const LLUUID& other_participan
 
 LLFloaterIM::LLFloaterIM() 
 {
+	gUICtrlFactory->buildFloater(this, "floater_im.xml");
 }
 
 BOOL LLFloaterIM::postBuild()
@@ -266,7 +267,6 @@ LLIMView::LLIMView(const std::string& name, const LLRect& rect) :
 	LLAvatarTracker::instance().addObserver(mFriendObserver);
 
 	mTalkFloater = new LLFloaterIM();
-	gUICtrlFactory->buildFloater(mTalkFloater, "floater_im.xml");
 
 	// New IM Panel
 	mNewIMFloater = new LLFloaterNewIM();
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 6f812e9e35d91e1d59cb80c9bd6c42302f90887d..f671d6355765458dee86d74b9a9b526d8f8c88c7 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -52,7 +52,6 @@
 #include "llinventorymodel.h"
 #include "viewer.h"				// for gUserServer
 #include "roles_constants.h"
-#include "llwebbrowserctrl.h"
 
 #define	kArraySize( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) )
 
@@ -449,7 +448,7 @@ BOOL LLPanelAvatarWeb::postBuild(void)
 	mWebBrowser->setOpenInExternalBrowser( false );
 
 	// observe browser events
-	LLMozLib::getInstance()->addObserver( mWebBrowser->getEmbeddedBrowserWindowId(), this );
+	mWebBrowser->addObserver( this );
 #endif // LL_LIBXUL_ENABLED
 
 	return TRUE;
@@ -508,7 +507,10 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb()
 {
 #if LL_LIBXUL_ENABLED
 	// stop observing browser events
-	LLMozLib::getInstance()->remObserver( mWebBrowser->getEmbeddedBrowserWindowId(), this );
+	if  ( mWebBrowser )
+	{
+		mWebBrowser->remObserver( this );
+	};
 #endif
 }
 
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index a17dc69cfc04e22da0d3ccf3e8bde24d66dde43b..0cdcdf938b313a49879dd07efc05cfa1b4877c6c 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -13,7 +13,7 @@
 #include "v3dmath.h"
 #include "lluuid.h"
 #include "linked_lists.h"
-#include "llmozlib.h"
+#include "llwebbrowserctrl.h"
 
 class LLButton;
 class LLCheckBoxCtrl;
@@ -89,7 +89,7 @@ class LLPanelAvatarSecondLife
 class LLPanelAvatarWeb : 
 	public LLPanel
 #if LL_LIBXUL_ENABLED
-	, public LLEmbeddedBrowserWindowObserver
+	, public LLWebBrowserCtrlObserver
 #endif
 {
 public:
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index e1ed7a0df7971db13c7904d16811c457e29728f3..dfaf872d92f4c637e1b3ff0d1554accf60e102c3 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -9,6 +9,7 @@
 #include "llviewerprecompiledheaders.h"
 
 #include "llpanellogin.h"
+#include "llpanelgeneral.h"
 
 #include "indra_constants.h"		// for key and mask constants
 #include "llfontgl.h"
@@ -34,7 +35,6 @@
 #include "llviewermenu.h"			// for handle_preferences()
 #include "llviewernetwork.h"
 #include "llviewerwindow.h"			// to link into child list
-#include "llmozlib.h"
 #include "llnotify.h"
 #include "viewer.h"					// for gHideLinks
 #include "llvieweruictrlfactory.h"
@@ -170,6 +170,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 		{
 			combo->setCurrentByIndex( 0 );
 		}
+
+		combo->setCommitCallback( &LLPanelGeneral::set_start_location );
 	}
 	
 	// Specific servers added later.
@@ -228,9 +230,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 		// make links open in external browser
 		web_browser->setOpenInExternalBrowser( true );
 
-		// force the size to be correct (XML doesn't seem to be sufficient to do this)
+		// force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through)
 		LLRect htmlRect = mRect;
-		htmlRect.setCenterAndSize( mRect.getCenterX(), mRect.getCenterY() + 40, mRect.getWidth(), mRect.getHeight() - 80 );
+		htmlRect.setCenterAndSize( mRect.getCenterX() - 2, mRect.getCenterY() + 40, mRect.getWidth() + 6, mRect.getHeight() - 78 );
 		web_browser->setRect( htmlRect );
 		web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
 		reshape( mRect.getWidth(), mRect.getHeight(), 1 );
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8eae25fa63bf89d9b51425b4020b6cd6b440d100..689dcee663b4d903b22940a28aa1ae6a440af969 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6479,7 +6479,14 @@ class LLShowFloater : public view_listener_t
 		{
 			if (gParcelMgr->selectionEmpty())
 			{
-				gParcelMgr->selectParcelAt(gAgent.getPositionGlobal());
+				if (gLastHitPosGlobal.isExactlyZero())
+				{
+					gParcelMgr->selectParcelAt(gAgent.getPositionGlobal());
+				}
+				else
+				{
+					gParcelMgr->selectParcelAt( gLastHitPosGlobal );
+				}
 			}
 
 			LLFloaterLand::show();
@@ -6488,7 +6495,14 @@ class LLShowFloater : public view_listener_t
 		{
 			if (gParcelMgr->selectionEmpty())
 			{
-				gParcelMgr->selectParcelAt(gAgent.getPositionGlobal());
+				if (gLastHitPosGlobal.isExactlyZero())
+				{
+					gParcelMgr->selectParcelAt(gAgent.getPositionGlobal());
+				}
+				else
+				{
+					gParcelMgr->selectParcelAt( gLastHitPosGlobal );
+				}
 			}
 			
 			gParcelMgr->startBuyLand();
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index b29b49b39961aeb3c61ed50281229aaa068f0d12..e3d462bb3b7de2743b23c84384d7f5d0aeb3d0f5 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1949,7 +1949,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void
 	if (parcel_id != parcel->getLocalID())
 	{
 		llwarns << "processParcelAccessListReply for parcel " << parcel_id
-			<< " which isn't the selected parcel" << llendl;
+			<< " which isn't the selected parcel " << parcel->getLocalID()<< llendl;
 		return;
 	}
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 331502c28adb1c590a56784772a23fd3ce58f749..8920d09fa6af816881e03f004e245f5f21102a83 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -69,6 +69,7 @@
 #include "llfilepicker.h"
 #include "llfloater.h"
 #include "llfloaterbuildoptions.h"
+#include "llfloaterbuyland.h"
 #include "llfloaterchat.h"
 #include "llfloatercustomize.h"
 #include "llfloatereditui.h" // HACK JAMESDEBUG for ui editor
@@ -2661,7 +2662,10 @@ BOOL LLViewerWindow::handlePerFrameHover()
 	}
 
 	// sync land selection with edit and about land dialogs
-	if (gParcelMgr && !LLFloaterLand::floaterVisible() && (!gFloaterTools || !gFloaterTools->getVisible()))
+	if (gParcelMgr
+		&& !LLFloaterLand::floaterVisible()
+		&& !LLFloaterBuyLand::isOpen()
+		&& (!gFloaterTools || !gFloaterTools->getVisible()))
 	{
 		gParcelMgr->deselectLand();
 	}