diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index 199d3808093ac0d3a7b36b06b5fa5eb73fa6b722..3e9ec14eb387a9c4d3d00826d40f4c520b2ee885 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -27,17 +27,6 @@
 #include <string>
 #include "llfile.h"
 
-#if LL_WINDOWS
-// Limit Windows API to small and manageable set.
-// If you get undefined symbols, find the appropriate
-// Windows header file and include that in your .cpp file.
-// Please don't take this out -- it helps with library
-// compile times. JC
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
-#endif	//	LL_WINDOWS
-
 #include "stdtypes.h"
 #include "lldefs.h"
 #include "llerror.h"
@@ -50,4 +39,4 @@
 #pragma warning (3 : 4702) // we like level 3, not 4
 #endif	//	LL_WINDOWS
 
-#endif	//	not LL_LINDEN_COMMON_H
+#endif
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index fda6d89a72e34247f86921b485f28a24f88b2d7d..87e7016f396ee0f62ec6f3a9d26db7da03073b0f 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -499,6 +499,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
 	switch (signum)
 	{
 	case SIGALRM:
+	case SIGPIPE:
 	case SIGUSR2:
 		// We don't care about these signals, ignore them
 		if (LLApp::sLogInSignal)
@@ -548,7 +549,6 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
 		
 		// Change the signal that we reraise to SIGABRT, so we generate a core dump.
 		signum = SIGABRT;
-	case SIGPIPE:
 	case SIGBUS:
 	case SIGSEGV:
 	case SIGQUIT:
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 829ae0de2108ec1a8f39e3e07df9c081c611ebcc..564c32cb0d2f22632a196187df03c33a96080dda 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -26,15 +26,12 @@
 
 #if LL_DARWIN
 	#define LL_QUICKTIME_ENABLED	1
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		1
 #elif LL_WINDOWS
 	#define LL_QUICKTIME_ENABLED	1
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		1
 #elif LL_LINUX
 	#define LL_QUICKTIME_ENABLED	0
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		0
 #endif
 
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 04e1bc083986ecefd54353b7282ea08195cf7599..64f4875489fa2b5dfb7f5f50124fd14592e52cc2 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -26,10 +26,17 @@
 
 #include "linden_common.h"
 
+#include "processor.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <memory.h>
-#include "processor.h"
+
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#endif
 
 #if !LL_DARWIN
 
diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h
index ad44e2ccb3a12b832f622d2b9674fa585c070f2a..8453263f9d3948aa6f6d6cf4586ded8beab80eaa 100644
--- a/indra/llcommon/llprocessor.h
+++ b/indra/llcommon/llprocessor.h
@@ -11,15 +11,14 @@
 ///////////////////////////////////////////
 
 
-#ifndef PROCESSOR_H
-#define PROCESSOR_H
+#ifndef LLPROCESSOR_H
+#define LLPROCESSOR_H
 
 // Options:
 ///////////
 #if LL_WINDOWS
 #define PROCESSOR_FREQUENCY_MEASURE_AVAILABLE
 #endif
-// Includes <windows.h> --> code gets os-dependend (Win32)
 
 
 typedef struct ProcessorExtensions
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 9305f82e055a859ca896510caebd7a3d85546901..8fe43736e46725497d8ba2f275fe94000c493847 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -8,16 +8,21 @@
  * $License$
  */
 
-#if LL_LINUX
-#include <netinet/in.h>
-#endif
-#if LL_DARWIN
-#include <arpa/inet.h>
-#endif
-
 #include "linden_common.h"
+
 #include "llsdutil.h"
 
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>	// for htonl
+#elif LL_LINUX
+#	include <netinet/in.h>
+#elif LL_DARWIN
+#	include <arpa/inet.h>
+#endif
+
+
+
 // vector3
 LLSD ll_sd_from_vector3(const LLVector3& vec)
 {
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 9c54ddaac1a2faa98673938fe6bad13ec91db58c..b50c0a13ce20c8e9ceb3f51a59d7e4d6afff8660 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -8,15 +8,21 @@
 
 #include "linden_common.h"
 
+#include "llsys.h"
+
 #include <iostream>
 #include <zlib/zlib.h>
 #include "processor.h"
 
-#if LL_DARWIN
-#include <sys/sysctl.h>
-#include <sys/utsname.h>
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#elif LL_DARWIN
+#	include <sys/sysctl.h>
+#	include <sys/utsname.h>
 #elif LL_LINUX
-#include <sys/utsname.h>
+#	include <sys/utsname.h>
 const char MEMINFO_FILE[] = "/proc/meminfo";
 const char CPUINFO_FILE[] = "/proc/cpuinfo";
 #endif
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index bd054f02d8e1c13aba637915ec8748912062cc39..a8118258f99a2eec8eea5492ae513d356fd33a5d 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -8,15 +8,19 @@
 
 #include "linden_common.h"
 
+#include "lltimer.h"
 
-#if LL_WINDOWS
-#include <time.h>
+#include "u64.h"
 
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#	include <time.h>
 #elif LL_LINUX
-#include <time.h>
-#include <sys/time.h>
-#include <sched.h>
-
+#	include <time.h>
+#	include <sys/time.h>
+#	include <sched.h>
 #elif LL_DARWIN
 #	include <time.h>
 #	include <sys/time.h>
@@ -25,9 +29,6 @@
 #endif
 
 
-#include "lltimer.h"
-#include "u64.h"
-
 //
 // Locally used constants
 //
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp
index f4a1740663d409b92d206063cecd3d711d3c65a2..501d9465c237953808ca6933869cba5779c924bf 100644
--- a/indra/llmessage/llhost.cpp
+++ b/indra/llmessage/llhost.cpp
@@ -8,19 +8,21 @@
 
 #include "linden_common.h"
 
-
-#if !LL_WINDOWS
-#include <netdb.h>
-#include <netinet/in.h>	// ntonl()
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#endif
-
 #include "llhost.h"
 
 #include "llerror.h"
 
+#if LL_WINDOWS
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+#else
+	#include <netdb.h>
+	#include <netinet/in.h>	// ntonl()
+	#include <sys/types.h>
+	#include <sys/socket.h>
+	#include <arpa/inet.h>
+#endif
+
 LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
 
 LLHost::LLHost(const std::string& ip_and_port)
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 9fe8e89b200dcd68e133e615f3fb670a85081554..4dd550901e6a428dea089dcb4146478c17f06217 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -8,6 +8,13 @@
 
 #include "linden_common.h"
 
+// APR on Windows needs full windows headers
+#ifdef LL_WINDOWS
+#	undef WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#endif
+
 #include <string>
 #include <sstream>
 #include <boost/regex.hpp>
diff --git a/indra/llmessage/llmail.h b/indra/llmessage/llmail.h
index e34b827f5fce1975eed701d6909e0d41dd25ea63..af0226477653cca762787c1c7c6ba2e4ed0ec007 100644
--- a/indra/llmessage/llmail.h
+++ b/indra/llmessage/llmail.h
@@ -9,7 +9,7 @@
 #ifndef LL_LLMAIL_H
 #define LL_LLMAIL_H
 
-#include "apr-1/apr_pools.h"
+typedef struct apr_pool_t apr_pool_t;
 
 // if hostname is NULL, then the host is resolved as 'mail'
 void init_mail(const std::string& hostname, apr_pool_t* pool);
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index 2b712840d82c50ad189fbf4bd3d3b8d788c1d0e1..bf8927c7b927b435ed769ffadc8bdbcd6dbcab09 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -14,13 +14,17 @@
 #include <stdexcept>
 #include <stdio.h>
 
-#if !LL_WINDOWS					//  Windows Versions 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <fcntl.h>
-#include <errno.h>
+#if LL_WINDOWS
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+	#include <windows.h>
+#else
+	#include <sys/types.h>
+	#include <sys/socket.h>
+	#include <netinet/in.h>
+	#include <arpa/inet.h>
+	#include <fcntl.h>
+	#include <errno.h>
 #endif
 
 // linden library includes
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4e369a8b6b5223df335923f6718660d68ea9c3b2..a52582a3aa410dffe0d6b7b6bdc93bb464d3ae3e 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -113,7 +113,7 @@ void LLFontGL::init()
 		mImageGLp = new LLImageGL(FALSE);
 		//RN: use nearest mipmap filtering to obviate the need to do pixel-accurate positioning
 		mImageGLp->bind();
-		mImageGLp->setMipFilterNearest(TRUE,TRUE);
+		mImageGLp->setMipFilterNearest(TRUE, TRUE);
 	}
 	if (mRawImageGLp.isNull())
 	{
diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp
index 2c61ebb85115dfc890aa99ee6a93b4a4cab2c40c..146560f43dec0463e3c1816fb9cb21b5da46e0a9 100644
--- a/indra/llrender/llgldbg.cpp
+++ b/indra/llrender/llgldbg.cpp
@@ -11,9 +11,10 @@
 
 #include "linden_common.h"
 
-#include "llglheaders.h"
+#include "llgldbg.h"
 
 #include "llgl.h"
+#include "llglheaders.h"
 
 
 //------------------------------------------------------------------------
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index d64abfe6983f0f957268a83d28ac8eecd2a83272..fc7a29887b4deea54fccd4c4d25e3c8c24bb2341 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -747,7 +747,7 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_
 
 	if (LLUI::sShowXUINames)
 	{
-		tool_tip = mName;
+		tool_tip = getShowNamesToolTip();
 	}
 	else
 	{
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 9c356f95246bcf7dc61fa4dc582a6752636c516b..1ba991f9161959001a9bbe213882abc507913a70 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1048,7 +1048,7 @@ BOOL LLTabContainer::selectTab(S32 which)
 // 			tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.
 			tuple->mButton->setToggleState( is_selected );
 			// RN: this limits tab-stops to active button only, which would require arrow keys to switch tabs
-			tuple->mButton->setTabStop( is_selected && mTabList.size() > 1 );
+			tuple->mButton->setTabStop( is_selected );
 			
 			if( is_selected && mMaxScrollPos > 0)
 			{
@@ -1466,4 +1466,3 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,	BOOL drop,	EDrag
 
 	return LLView::handleDragAndDrop(x,	y, mask, drop, type, cargo_data,  accept, tooltip);
 }
-
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 7e286f0bee8f9379ca287d84ae1fae51af263245..7f62194e5889f67815817917c382b9c239b89421 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -385,6 +385,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
 {
 	// TomY TODO: Break this function into buildMenu and buildMenuBar
 	LLXMLNodePtr root;
+	LLMenuGL*    menu;
 
 	if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
 	{
@@ -398,12 +399,23 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
 		return NULL;
 	}
 
+	
+
 	if (root->hasName("menu"))
 	{
-		return (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
+		menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
+	}
+	else
+	{
+		menu = (LLMenuGL*)LLMenuBarGL::fromXML(root, parentp, this);
+	}
+	
+	if (LLUI::sShowXUINames)
+	{
+		menu->mToolTipMsg = filename;
 	}
 
-	return (LLMenuGL*)LLMenuBarGL::fromXML(root, parentp, this);
+    return menu;
 }
 
 //-----------------------------------------------------------------------------
@@ -432,6 +444,12 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren
 	LLPieMenu *menu = new LLPieMenu(name);
 	parentp->addChild(menu);
 	menu->initXML(root, parentp, this);
+
+	if (LLUI::sShowXUINames)
+	{
+		menu->mToolTipMsg = filename;
+	}
+
 	return menu;
 }
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 6323a408bbdf0e6758dfa85c95b1f1ffc642da17..64ba319151cd84ac129820fb27bbd94797d358c2 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -811,6 +811,35 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask)
 	return handled;
 }
 
+LLString LLView::getShowNamesToolTip()
+{
+	LLView* view = getParent();
+	LLString name;
+	LLString tool_tip = mName;
+
+	while (view)
+	{
+		name = view->getName();
+
+		if (name == "root") break;
+
+		if (view->getToolTip().find(".xml") != LLString::npos)
+		{
+			tool_tip = view->getToolTip() + "/" +  tool_tip;
+			break;
+		}
+		else
+		{
+			tool_tip = view->getName() + "/" +  tool_tip;
+		}
+
+		view = view->getParent();
+	}
+
+	return "/" + tool_tip;
+}
+
+
 BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen)
 {
 	BOOL handled = FALSE;
@@ -834,7 +863,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre
 		if (LLUI::sShowXUINames && (mToolTipMsg.find(".xml", 0) == LLString::npos) && 
 			(mName.find("Drag", 0) == LLString::npos))
 		{
-			tool_tip = mName;
+			tool_tip = getShowNamesToolTip();
 		}
 		else
 		{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 63d85fbcdc88681812944a3ab45c68f8e77246ab..9a36c56e3ec160a739b0a530117abb673d64c41e 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -352,6 +352,8 @@ class LLView : public LLMouseHandler, public LLMortician, public LLSimpleListene
 	// then display mToolTipMsg if no child handled it.
 	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect);
 
+	LLString getShowNamesToolTip();
+
 	virtual void	draw();
 
 	void			drawDebugRect();
diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h
index fbeeef2732ae10812249aad50557e38e3397c538..237185b793b07235a5d97cc0e68755285bcb4020 100644
--- a/indra/llvfs/lldir_win32.h
+++ b/indra/llvfs/lldir_win32.h
@@ -17,18 +17,18 @@ class LLDir_Win32 : public LLDir
 	LLDir_Win32();
 	virtual ~LLDir_Win32();
 
-	virtual void initAppDirs(const std::string &app_name);
-public:	
-	virtual std::string getCurPath();
-	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
-	virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
-	virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
+	/*virtual*/ void initAppDirs(const std::string &app_name);
+
+	/*virtual*/ std::string getCurPath();
+	/*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask);
+	/*virtual*/ BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
+	/*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
 	/*virtual*/ BOOL fileExists(const std::string &filename);
 
 private:
 	BOOL LLDir_Win32::getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
 	
-	HANDLE mDirSearch_h;
+	void* mDirSearch_h;
 	llutf16string mCurrentDir;
 };
 
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index 6f5383428e3d64657bf199819f39a9749f992378..ddc099418c2e4c53712023b6e92887ef22c7bd46 100644
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -9,9 +9,15 @@
 #if LL_WINDOWS
 
 #include "linden_common.h"
+
 #include "llkeyboardwin32.h"
+
 #include "llwindow.h"
 
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+
 LLKeyboardWin32::LLKeyboardWin32()
 {
 	// Set up key mapping for windows - eventually can read this from a file?
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 21774fe23339ef04b6f541386a93850af8efac98..d5e1e770530cc6275f446cd389df6ac3c884060f 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -23,6 +23,7 @@
 
 #include "llerror.h"
 #include "llkeyboard.h"
+#include "linked_lists.h"
 
 //static instance for default callbacks
 LLWindowCallbacks	LLWindow::sDefaultCallbacks;
@@ -305,7 +306,8 @@ void LLSplashScreen::hide()
 // LLWindowManager
 //
 
-LLLinkedList<LLWindow> LLWindowManager::sWindowList;
+// TODO: replace with std::set
+static LLLinkedList<LLWindow> sWindowList;
 
 LLWindow* LLWindowManager::createWindow(
 	char *title,
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 703eee32d0475befd76ed528dd7d0e814dc7e114..442f4c9667d9e89b533f10998f135527f35a5953 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -12,7 +12,6 @@
 #include <sys/stat.h>
 
 #include "llrect.h"
-#include "linked_lists.h"
 #include "llcoord.h"
 #include "llstring.h"
 
@@ -272,9 +271,6 @@ const S32 OSBTN_CANCEL = 3;
 
 class LLWindowManager
 {
-private:
-	static LLLinkedList<LLWindow> sWindowList;
-
 public:
 	static LLWindow* createWindow(
 		char *title,
@@ -316,13 +312,4 @@ void shell_open(const char* file_path);
 
 void simpleEscapeString ( std::string& stringIn  );
 
-
-#if LL_WINDOWS
-	// return Win32 specific window handle
-	HWND llwindow_get_hwnd(LLWindow *window);
-
-	// backdoor for special case handling of Win32 messages
-	void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc);
-#endif
-
 #endif // _LL_window_h_
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index ad56b97577889a605c0eec2ee3f57af69aef1693..daa1a26b3d3b7b7975655875d4868fd787f9144e 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -10,6 +10,8 @@
 
 #if LL_WINDOWS && !LL_MESA_HEADLESS
 
+#include "llwindowwin32.h"
+
 #include <commdlg.h>
 #include <WinUser.h>
 #include <mapi.h>
@@ -20,7 +22,7 @@
 #define DIRECTINPUT_VERSION 0x0800
 #include <dinput.h>
 
-#include "llwindowwin32.h"
+
 #include "llkeyboardwin32.h"
 #include "llerror.h"
 #include "llgl.h"
@@ -3023,19 +3025,6 @@ LRESULT CALLBACK LLSplashScreenWin32::windowProc(HWND h_wnd, UINT u_msg,
 // Helper Funcs
 //
 
-HWND llwindow_get_hwnd(LLWindow *window)
-{
-	//assumes we are dealing with a Win32 window
-	return ((LLWindowWin32*)window)->mWindowHandle;
-}
-
-
-void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc)
-{
-	//assumes we are dealing with a Win32 window
-	((LLWindowWin32*)window)->mWndProc = wnd_proc;
-}
-
 S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type)
 {
 	UINT uType;
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 6803ad6f2abba377941e5e9aedaee61f047435cf..0b6fd5157a3613c91e4dca2396b7e9ae21e23721 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -9,6 +9,11 @@
 #ifndef LL_LLWINDOWWIN32_H
 #define LL_LLWINDOWWIN32_H
 
+// Limit Windows API to small and manageable set.
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+
 #include "llwindow.h"
 
 // Hack for async host by name
@@ -152,8 +157,6 @@ class LLWindowWin32 : public LLWindow
 	BOOL		mMousePositionModified;
 	BOOL		mInputProcessingPaused;
 
-	friend HWND llwindow_get_hwnd(LLWindow *window); 
-	friend void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc);
 	friend class LLWindowManager;
 };
 
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index 5a01bfdc84417150a727832110203f51044d3f42..0628d54449255b188cd982a3d2e49ce2ae5cae0a 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -56,7 +56,7 @@ BOOL LLDirPicker::getDir(LLString* filename)
    memset(&bi, 0, sizeof(bi));
 
    bi.ulFlags   = BIF_USENEWUI;
-   bi.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());;
+   bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
    bi.lpszTitle = NULL;
 
    ::OleInitialize(NULL);
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 0ef9eed7a33649544da1dd3ebfc071e367fbd1d6..899d49f380307593a7c810d41fc5ee698bc7c3b1 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -20,7 +20,6 @@
 #include "lldrawpoolbump.h"
 #include "lldrawpoolclouds.h"
 #include "lldrawpoolground.h"
-#include "lldrawpoolmedia.h"
 #include "lldrawpoolsimple.h"
 #include "lldrawpoolsky.h"
 #include "lldrawpoolstars.h"
@@ -93,9 +92,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
 	case POOL_BUMP:
 		poolp = new LLDrawPoolBump(tex0);
 		break;
-	case POOL_MEDIA:
-		poolp = new LLDrawPoolMedia(tex0);
-		break;
 	case POOL_HUD:
 		poolp = new LLDrawPoolHUD();
 		break;
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index a66d7d14c7d1ca8d530dc8f97d140fd9169a5c67..c00cbf14e4a38eb8a9081175286007ab47f305b7 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -163,7 +163,7 @@ class LLDrawPool
 		POOL_GROUND,
 		POOL_TERRAIN,	
 		POOL_SIMPLE,
-		POOL_MEDIA,
+		POOL_MEDIA,		// unused
 		POOL_BUMP,
 		POOL_AVATAR,
 		POOL_TREE,
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 776a2e4dc257d8e62e7b8df6343ba37c51596ce1..587f1eb2530ae34b5cadce72f8735374f6407c01 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -130,7 +130,7 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter)
 	// don't provide default file selection
 	mFilesW[0] = '\0';
 
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 	mOFN.lpstrFile = mFilesW;
 	mOFN.nMaxFile = SINGLE_FILENAME_BUFFER_SIZE;
 	mOFN.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR ;
@@ -167,7 +167,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter)
 	// don't provide default file selection
 	mFilesW[0] = '\0';
 
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 	mOFN.lpstrFile = mFilesW;
 	mOFN.nFilterIndex = 1;
 	mOFN.nMaxFile = FILENAME_BUFFER_SIZE;
@@ -238,7 +238,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
 	{
 		mFilesW[0] = '\0';
 	}
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 
 	switch( filter )
 	{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
index ed99cbe85598e3cefe38332b140eaa6eb64f8553..32ae42363bff9bbb66ddbd1d38e3b31643d6795a 100644
--- a/indra/newview/lloverlaybar.cpp
+++ b/indra/newview/lloverlaybar.cpp
@@ -534,16 +534,8 @@ void LLOverlayBar::onPlayButtonPressed( const LLMediaRemoteCtrlObserver::EventTy
 		LLParcel* parcel = gParcelMgr->getAgentParcel();
 		if (parcel)
 		{
-			bool web_url = (parcel->getParcelFlag(PF_URL_WEB_PAGE) || parcel->getParcelFlag(PF_URL_RAW_HTML));
 			LLString path( "" );
-			#if LL_MOZILLA_ENABLED
-			LLString mozilla_subdir;
-			if (web_url)
-			{
-				path = get_mozilla_path();
-			}
-			#endif
-			LLMediaEngine::getInstance ()->convertImageAndLoadUrl( true, web_url, path );
+			LLMediaEngine::getInstance ()->convertImageAndLoadUrl( true, false, path );
 			mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Play, TRUE );
 		}
 	};
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index b013befca56c62b712a41fd804262e173fe2effd..6f812e9e35d91e1d59cb80c9bd6c42302f90887d 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -824,6 +824,20 @@ void LLPanelAvatarClassified::enableControls(BOOL self)
 {
 }
 
+BOOL LLPanelAvatarClassified::titleIsValid()
+{
+	LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab");
+	for (S32 i = 0; i < tabs->getTabCount(); i++)
+	{
+		LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i);
+		if ( ! panel->titleIsValid() )
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
 
 void LLPanelAvatarClassified::apply()
 {
@@ -1624,12 +1638,15 @@ void LLPanelAvatar::onClickOK(void *userdata)
 	{
 		self->sendAvatarPropertiesUpdate();
 
-		self->mPanelClassified->apply();
-
-		LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID);
-		if (infop)
+		if ( self->mPanelClassified->titleIsValid() )
 		{
-			infop->close();
+			self->mPanelClassified->apply();
+
+			LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID);
+			if (infop)
+			{
+				infop->close();
+			}
 		}
 	}
 }
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index d6b0d235b0dd849ed67bed22c33bb5be5478cd38..a17dc69cfc04e22da0d3ccf3e8bde24d66dde43b 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -176,6 +176,8 @@ class LLPanelAvatarClassified : public LLPanel
 	void apply();
 	void enableControls(BOOL own_avatar);
 
+	BOOL titleIsValid();
+
 	// Delete all the classified sub-panels from the tab container
 	void deleteClassifiedPanels();
 
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 7c84d0f6a5ae93ccdf9d64b3e5862f5ddc0398af..dbd97fc7d162a2dc1ac3afa3c0d97137d39cf874 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -224,6 +224,24 @@ BOOL LLPanelClassified::postBuild()
     return TRUE;
 }
 
+BOOL LLPanelClassified::titleIsValid()
+{
+	// Disallow leading spaces, punctuation, etc. that screw up
+	// sort order.
+	const LLString& name = mNameEditor->getText();
+	if (name.empty())
+	{
+		gViewerWindow->alertXml("BlankClassifiedName");
+		return FALSE;
+	}
+	if (!isalnum(name[0]))
+	{
+		gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
+		return FALSE;
+	}
+
+	return TRUE;
+}
 
 void LLPanelClassified::apply()
 {
@@ -602,17 +620,10 @@ void LLPanelClassified::onClickUpdate(void* data)
 
 	// Disallow leading spaces, punctuation, etc. that screw up
 	// sort order.
-	const LLString& name = self->mNameEditor->getText();
-	if (name.empty())
+	if ( ! self->titleIsValid() )
 	{
-		gViewerWindow->alertXml("BlankClassifiedName");
 		return;
-	}
-	if (!isalnum(name[0]))
-	{
-		gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
-		return;
-	}
+	};
 
 	// if already paid for, just do the update
 	if (self->mPaidFor)
diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h
index e3e7a299bfadfcfc4cdf0dd798322a0583f3cc56..6d5be1df0956fa91ee4a19854a1b4f1700f2be63 100644
--- a/indra/newview/llpanelclassified.h
+++ b/indra/newview/llpanelclassified.h
@@ -55,6 +55,9 @@ class LLPanelClassified : public LLPanel
 	static void setClickThrough(const LLUUID& classified_id,
 								S32 teleport, S32 map, S32 profile);
 
+	// check that the title is valid (E.G. starts with a number or letter)
+	BOOL titleIsValid();
+
 	// Schedules the panel to request data
 	// from the server next time it is drawn.
 	void markForServerRequest();
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d023be66f2598cf53511d3e74d48015a6cae64ae..d9ef9e4c133aa071cd06bca6ae9f15a0a6ea62bc 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -51,13 +51,6 @@ BOOL	LLPanelFace::postBuild()
 	LLTextureCtrl*	mTextureCtrl;
 	LLColorSwatchCtrl*	mColorSwatch;
 
-	#if LL_MOZILLA_ENABLED
-	LLTextBox*		mLabelMediaType;
-	LLComboBox*		mComboMediaType;
-	LLTextBox*		mLabelMediaURL;
-	LLLineEditor*	mLineMediaURL;
-	#endif
-
 	LLTextBox*		mLabelTexGen;
 	LLComboBox*		mComboTexGen;
 
@@ -111,36 +104,6 @@ BOOL	LLPanelFace::postBuild()
 		mColorSwatch->setCanApplyImmediately(TRUE);
 	}
 
-#if LL_MOZILLA_ENABLED
-	mLabelMediaType = LLUICtrlFactory::getTextBoxByName(this,"web_label");
-	if(mLabelMediaType)
-		mLabelMediaType->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-
-	mComboMediaType = LLUICtrlFactory::getComboBoxByName(this,"web_type_combo");
-	if(mComboMediaType)
-	{
-		mComboMediaType->setCommitCallback(onCommitMediaInfo);
-		mComboMediaType->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-		mComboMediaType->setCallbackUserData( this );
-		mComboMediaType->add("None");
-		mComboMediaType->add("Web page");
-	}
-	
-	mLabelMediaURL = LLUICtrlFactory::getTextBoxByName(this,"url_label");
-	if(mLabelMediaURL)
-	{
-		mLabelMediaURL->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-	}
-
-	mLineMediaURL = LLUICtrlFactory::getLineEditorByName(this,"url_line");
-	if(mLineMediaURL)
-	{
-		mLineMediaURL->setCommitCallback(onCommitMediaInfo);
-		mLineMediaURL->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-		mLineMediaURL->setCommitOnFocusLost(TRUE);
-		mLineMediaURL->setCallbackUserData( this );
-	}
-#endif
 	mLabelColorTransp = LLUICtrlFactory::getTextBoxByName(this,"color trans");
 	if(mLabelColorTransp)
 	{
@@ -250,19 +213,6 @@ void LLPanelFace::sendFullbright()
 	gSelectMgr->selectionSetFullbright( fullbright );
 }
 
-#if LL_MOZILLA_ENABLED
-void LLPanelFace::sendMediaInfo()
-{
-	if (mComboMediaType)
-	{
-		U8 media_type = (U8) mComboMediaType->getCurrentIndex();
-		std::string media_url = mLineMediaURL->getText();
-
-		gSelectMgr->selectionSetMediaTypeAndURL( media_type, media_url );
-	}
-}
-#endif
-
 void LLPanelFace::sendColor()
 {
 	
@@ -397,48 +347,6 @@ void LLPanelFace::getState()
 				//mBtnAutoFix->setEnabled ( editable );
 			}
 		childSetEnabled("button apply",editable);
-		//mBtnApply->setEnabled( editable );
-
-		#if LL_MOZILLA_ENABLED
-		if (gSavedSettings.getBOOL("UseWebPagesOnPrims"))
-		{
-			// Web page selection
-			mLabelMediaType->setEnabled(editable);
-			mLabelMediaType->setToolTip("Experimental");
-
-			// JAMESDEBUG - use viewerobject mMedia->mMediaType when transmission is wired in
-			U8 media_type = LLViewerObject::MEDIA_TYPE_NONE;
-			bool same = gSelectMgr->selectionGetMediaType( &media_type );
-			mComboMediaType->setTentative( !same );
-			mComboMediaType->setEnabled( editable );
-			mComboMediaType->setCurrentByIndex( (S32)media_type );
-			mComboMediaType->setToolTip("Experimental");
-
-			mLabelMediaURL->setEnabled(editable);
-			mLabelMediaURL->setToolTip("Experimental");
-
-			const std::string& media_url = objectp->getMediaURL();
-			mLineMediaURL->setEnabled( editable );
-			mLineMediaURL->setText( media_url );
-			mLineMediaURL->setToolTip("Experimental");
-		}
-		else
-		{
-			mLabelMediaType->setEnabled(FALSE);
-			mLabelMediaType->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mComboMediaType->setEnabled( FALSE );
-			mComboMediaType->setCurrentByIndex( LLViewerObject::MEDIA_TYPE_NONE );
-			mComboMediaType->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mLabelMediaURL->setEnabled(FALSE);
-			mLabelMediaURL->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mLineMediaURL->setEnabled( FALSE );
-			mLineMediaURL->setText( "" );
-			mLineMediaURL->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-		}
-		#endif
 
 		// Texture
 		LLUUID id;
@@ -895,15 +803,6 @@ void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata )
 	self->sendTextureInfo();
 }
 
-#if LL_MOZILLA_ENABLED
-// static
-void LLPanelFace::onCommitMediaInfo(LLUICtrl* ctrl, void* data)
-{
-	LLPanelFace* self = (LLPanelFace*) data;
-	self->sendMediaInfo();
-}
-#endif
-
 // Commit the number of repeats per meter
 // static
 void LLPanelFace::onClickApply(void* userdata)
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 03f361d23cfb0e1a71a40f9f08944bf337a358c9..dc58caff2aa0d7d546dfc9f30da4a5655354ca4c 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -49,9 +49,6 @@ class LLPanelFace : public LLPanel
 	void			sendTexGen();				// applies and sends bump map
 	void			sendShiny();			// applies and sends shininess
 	void			sendFullbright();		// applies and sends full bright
-	#if LL_MOZILLA_ENABLED
-	void			sendMediaInfo();		// web page settings and URL
-	#endif
 
 	// this function is to return TRUE if the dra should succeed.
 	static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
@@ -68,9 +65,6 @@ class LLPanelFace : public LLPanel
 	static void		onCommitTexGen(			LLUICtrl* ctrl, void* userdata);
 	static void		onCommitShiny(			LLUICtrl* ctrl, void* userdata);
 	static void		onCommitFullbright(		LLUICtrl* ctrl, void* userdata);
-	#if LL_MOZILLA_ENABLED
-	static void		onCommitMediaInfo(		LLUICtrl* ctrl, void* data);
-	#endif
 
 	static void		onClickApply(void*);
 	static void		onClickAutoFix(void*);
@@ -85,52 +79,6 @@ class LLPanelFace : public LLPanel
 	static F32		valueTexGen(LLViewerObject* object, S32 face);
 	static F32		valueShiny(LLViewerObject* object, S32 face);
 	static F32		valueFullbright(LLViewerObject* object, S32 face);
-
-protected:
-	//LLTextureCtrl*	mTextureCtrl;
-	//LLColorSwatchCtrl*	mColorSwatch;
-
-	//#if LL_MOZILLA_ENABLED
-	//LLTextBox*		mLabelMediaType;
-	//LLComboBox*		mComboMediaType;
-	//LLTextBox*		mLabelMediaURL;
-	//LLLineEditor*	mLineMediaURL;
-	//#endif
-
-	//LLTextBox		*mLabelTexScale;
-	//LLSpinCtrl		*mCtrlTexScaleS;
-	//LLSpinCtrl		*mCtrlTexScaleT;
-
-	//LLCheckBoxCtrl	*mCheckFlipScaleS;
-	//LLCheckBoxCtrl	*mCheckFlipScaleT;
-
-	//LLTextBox		*mLabelTexOffset;
-	//LLSpinCtrl		*mCtrlTexOffsetS;
-	//LLSpinCtrl		*mCtrlTexOffsetT;
-
-	//LLTextBox		*mLabelTexRotation;
-	//LLSpinCtrl		*mCtrlTexRotation;
-
-	//LLTextBox*		mLabelTexGen;
-	//LLComboBox*		mComboTexGen;
-
-	//LLTextBox*		mLabelShininess;
-	//LLComboBox*		mComboShininess;
-
-	//LLTextBox*		mLabelBumpiness;
-	//LLComboBox*		mComboBumpiness;
-
-	//LLCheckBoxCtrl	*mCheckFullbright;
-	//
-	//LLTextBox*		mLabelColorTransp;
-	//LLSpinCtrl*		mCtrlColorTransp;		// transparency = 1 - alpha
-
-	//LLTextBox*		mLabelRepeatsPerMeter;
-	//LLSpinCtrl*		mCtrlRepeatsPerMeter;
-	//LLButton*		mBtnApply;
-
-	//LLTextBox*		mLabelTexAutoFix;
-	//LLButton*		mBtnAutoFix;
 };
 
 #endif
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index fea8924b781dafa0f831a7c92738fa3450407455..74c1d44329762a3c6811196405b3456d82d8129f 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -11,9 +11,9 @@
 #include "llstartup.h"
 
 #if LL_WINDOWS
-#include <process.h>		// _spawnl()
+#	include <process.h>		// _spawnl()
 #else
-#include <sys/stat.h>		// mkdir()
+#	include <sys/stat.h>		// mkdir()
 #endif
 
 #include "audioengine.h"
@@ -108,7 +108,6 @@
 #include "llviewerdisplay.h"
 #include "llviewergesture.h"
 #include "llviewerimagelist.h"
-#include "llviewermedialist.h"
 #include "llviewermenu.h"
 #include "llviewermessage.h"
 #include "llviewernetwork.h"
@@ -497,7 +496,7 @@ BOOL idle_startup()
 #if LL_WINDOWS
 				// FMOD on Windows needs the window handle to stop playing audio
 				// when window is minimized. JC
-				void* window_handle = (void*)llwindow_get_hwnd(gViewerWindow->getWindow());
+				void* window_handle = (HWND)gViewerWindow->getPlatformWindow();
 #else
 				void* window_handle = NULL;
 #endif
@@ -1854,46 +1853,6 @@ BOOL idle_startup()
 		}
 		#endif
 
-		// Get list of URLs approved for usage
-		// CP: removed since they're not useful without Mozilla enabled
-		#if LL_MOZILLA_ENABLED
-		LLUrlWhiteList::getInstance()->load();
-		#endif
-
-		// initialize mozilla if we're using web page on a prim or not using an external browser for floater
-		BOOL use_web_pages_on_prims = gSavedSettings.getBOOL("UseWebPagesOnPrims");
-		BOOL use_external_browser = gSavedSettings.getBOOL("UseExternalBrowser");
-
-use_external_browser = false;
-
-		if (use_web_pages_on_prims || !use_external_browser)
-		{
-			//llinfos << "Initializing web browser...." << llendl;
-			//set_startup_status(0.48f, "Initializing web browser...", gAgent.mMOTD.c_str());
-			//display_startup();
-			// initialize mozilla
-			LLString mozilla_path = gDirUtilp->getExecutableDir();
-			mozilla_path.append( gDirUtilp->getDirDelimiter() );
-#if LL_DEBUG
-			mozilla_path.append( "mozilla_debug" );
-#else
-			mozilla_path.append( "mozilla" );
-#endif
-
-#if LL_MOZILLA_ENABLED
-			if (!gMozillaInitialized)
-			{
-				void* platform_window = gViewerWindow->getPlatformWindow();
-				mozilla_init_embedding(platform_window, mozilla_path);
-			}
-#endif
-
-			if (use_web_pages_on_prims)
-			{
-				gMediaList = new LLViewerMediaList(2);
-			}
-		}
-
 		gStartupState++;
 		return do_normal_idle;
 	}
diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp
index d582d2d19f0f85fc649f200a3c31479295c2d162..65f7229abfc3560d48321a5faf5e31ecbee83020 100644
--- a/indra/newview/llurlwhitelist.cpp
+++ b/indra/newview/llurlwhitelist.cpp
@@ -200,22 +200,4 @@ bool LLUrlWhiteList::getNext ( LLString& valueOut )
 bool LLUrlWhiteList::containsMatch ( const LLString& patternIn )
 {
 	return false;
-
-	// CP: removed since they're not useful without Mozilla enabled
-	#if LL_MOZILLA_ENABLED
-	LLString pattern = url_cleanup(patternIn);
-	
-	if (pattern.empty()) return false;	
-	
-	LLStringListIter iter = std::find ( mUrlList.begin (), mUrlList.end (), pattern );
-
-	if ( iter != mUrlList.end () )
-	{
-		return true;
-	}
-	else
-	{	
-		return false;
-	};
-	#endif
 }
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3a38ba52eed641ffc545169c2086a0f51c012cdb..1a4ffadeee940cf6cdd51c0b308288759ed0c30f 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -183,7 +183,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
 		static F32 last_update_time = 0.f;
 		if ((gFrameTimeSeconds - last_update_time) > 1.f)
 		{
-			InvalidateRect(llwindow_get_hwnd(gViewerWindow->getWindow()), NULL, FALSE);
+			InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), NULL, FALSE);
 			last_update_time = gFrameTimeSeconds;
 		}
 #elif LL_DARWIN
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 2d97c6f2a4f381c588236cd3b37ef03b3681782b..7db94eb97249774493bfc0fb97847116eb68441b 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -49,7 +49,6 @@
 #include "llviewercamera.h"
 #include "llviewerimagelist.h"
 #include "llviewerinventory.h"
-#include "llviewermedialist.h"
 #include "llviewerobjectlist.h"
 #include "llviewerparceloverlay.h"
 #include "llviewerpartsource.h"
@@ -3266,16 +3265,8 @@ void LLViewerObject::setMediaType(U8 media_type)
 	else if (mMedia->mMediaType != media_type)
 	{
 		mMedia->mMediaType = media_type;
-		if (gMediaList)
-		{
-			// we're using web pages on prims
-			gMediaList->updatedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 }
 
@@ -3300,30 +3291,15 @@ void LLViewerObject::setMediaURL(const LLString& media_url)
 		mMedia = new LLViewerObjectMedia;
 		mMedia->mMediaURL = media_url;
 		mMedia->mPassedWhitelist = FALSE;
-		if (gMediaList)
-		{
-			gMediaList->addedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 	else if (mMedia->mMediaURL != media_url)
 	{
 		mMedia->mMediaURL = media_url;
 		mMedia->mPassedWhitelist = FALSE;
-		if (gMediaList)
-		{
-			// we're using web pages on prims
-			gMediaList->updatedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 }
 
@@ -4137,6 +4113,12 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
 		}
 	}
 
+	if ( mAudioSourcep )
+	{
+		gAudiop->cleanupAudioSource(mAudioSourcep);
+		mAudioSourcep = NULL;
+	}
+
 	getAudioSource(owner_id);
 
 	if (mAudioSourcep)
@@ -4153,8 +4135,6 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
 
 LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id)
 {
-	LLMemType mt(LLMemType::MTYPE_OBJECT);
-	
 	if (!mAudioSourcep)
 	{
 		// Arbitrary low gain for a sound that's not playing.
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index e1fed12563996f5cc589cce6ee53455b5d609eae..e2c1bc06957aca79eefca9801dc8f6ea2788de72 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -44,7 +44,6 @@
 #include "lldatapacker.h"
 #include <zlib/zlib.h>
 #include "object_flags.h"
-#include "llviewermedialist.h"
 
 extern BOOL gVelocityInterpolate;
 extern BOOL gPingInterpolate;
@@ -178,11 +177,13 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 										   U32 i, 
 										   const EObjectUpdateType update_type, 
 										   LLDataPacker* dpp, 
-										   BOOL justCreated)
+										   BOOL just_created)
 {
 	LLMessageSystem* msg = gMessageSystem;
 
-	U32 pum_flags = objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
+	// ignore returned flags
+	objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
+
 	if (objectp->isDead())
 	{
 		// The update failed
@@ -196,7 +197,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	// Update the image levels of textures for this object.
 	objectp->updateTextures(gAgent);
 
-	if (justCreated) 
+	if (just_created) 
 	{
 		gPipeline.addObject(objectp);
 	}
@@ -207,7 +208,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
 
 	// If we're just wandering around, don't create new objects selected.
-	if (justCreated 
+	if (just_created 
 		&& update_type != OUT_TERSE_IMPROVED 
 		&& objectp->mCreateSelected)
 	{
@@ -223,37 +224,6 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 		gViewerWindow->getWindow()->decBusyCount();
 		gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );
 	}
-
-	if (gMediaList)
-	{
-		// we're using web pages on prims
-		if (pum_flags & LLViewerObject::MEDIA_URL_ADDED)
-		{
-			//llwarns << "WEBONPRIM media url added " << objectp->getMediaURL() << llendl;
-			gMediaList->addedMediaURL(objectp);
-		}
-
-		if (pum_flags & LLViewerObject::MEDIA_URL_UPDATED)
-		{
-			//llwarns << "WEBONPRIM media url updated " << objectp->getMediaURL() << llendl;
-			gMediaList->updatedMediaURL(objectp);
-		}
-
-		if (pum_flags & LLViewerObject::MEDIA_URL_REMOVED)
-		{
-			//llwarns << "WEBONPRIM media url removed " << objectp->getMediaURL() << llendl;
-			gMediaList->removedMediaURL(objectp);
-		}
-
-		// Make sure we get moved in or out of LLDrawPoolMedia, as needed
-		if (pum_flags & (LLViewerObject::MEDIA_URL_ADDED | LLViewerObject::MEDIA_URL_REMOVED | LLViewerObject::MEDIA_URL_UPDATED))
-		{
-			if (objectp->mDrawable.notNull())
-			{
-				gPipeline.markTextured(objectp->mDrawable);
-			}
-		}
-	}
 }
 
 void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 8e7edab927e96539abe694f4626150d121147074..b29b49b39961aeb3c61ed50281229aaa068f0d12 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1866,15 +1866,8 @@ void prepare_video(const LLParcel *parcel)
 void start_video(const LLParcel *parcel)
 {
 	prepare_video(parcel);
-	bool web_url = (parcel->getParcelFlag(PF_URL_WEB_PAGE) || parcel->getParcelFlag(PF_URL_RAW_HTML));
 	std::string path( "" );
-	#if LL_MOZILLA_ENABLED
-	if (web_url)
-	{
-		path = get_mozilla_path();
-	}
-	#endif
-	LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, web_url, path);
+	LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, false, path);
 }
 
 void stop_video()
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index 5c50fef58e95e84164a19462cbff704a1bb56ca8..76efdb85955c18ebc4aac425d4514955b889ae19 100644
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -15,10 +15,18 @@
 // in viewer.
 // It is used to precompile headers for improved build speed.
 
-// Reference headers your program requires here:
 #include "linden_common.h"
 
-// The rest of the common system headers go here:
+// We may want to take the windows.h include out, but it used to be in 
+// linden_common.h, and hence in all the libraries.  This is better. JC
+#if LL_WINDOWS
+	// Limit Windows API to small and manageable set.
+	// If you get undefined symbols, find the appropriate
+	// Windows header file and include that in your .cpp file.
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+	#include <windows.h>
+#endif
 
 // Work around stupid Microsoft STL warning
 #ifdef LL_WINDOWS
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ea73a969d6682b6f501e23279e4c30f0e25865db..331502c28adb1c590a56784772a23fd3ce58f749 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1023,7 +1023,7 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window,  S32 x,  S32 y, S32 width,  S
 #if LL_WINDOWS
 	if (gNoRender)
 	{
-		HWND window_handle = llwindow_get_hwnd(window);
+		HWND window_handle = (HWND)window->getPlatformWindow();
 		PAINTSTRUCT ps; 
 		HDC hdc; 
  
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index d1e4de547858156dc9f3e3b0062f851378b708a5..d1bcacb5c4ddc8da7173a2e87cd426dbcc6aa35e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -35,7 +35,6 @@
 #include "lldrawable.h"
 #include "lldrawpoolavatar.h"
 #include "lldrawpoolalpha.h"
-#include "lldrawpoolmedia.h"
 #include "lldrawpoolbump.h"
 #include "lldriverparam.h"
 #include "lleditingmotion.h"
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index d57bb7da822d22ae68fd4a6b9372240e3da497f8..1f87cf225d67bb46edd01b07f94a6161b76288ef 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -19,18 +19,7 @@
 // static
 void LLWeb::loadURL(std::string url)
 {
-#if LL_MOZILLA_ENABLED
-	if (gSavedSettings.getBOOL("UseExternalBrowser"))
-	{
-		loadURLExternal(url);
-	}
-	else
-	{
-		LLFloaterHTML::show((void*)url.c_str());
-	}
-#else
 	loadURLExternal(url);
-#endif
 }
 
 
diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp
index e9198e8ff9d4d3d25d8942fc74f34f75c8725a71..decb70d822a11574c747648565509e3939350561 100644
--- a/indra/win_crash_logger/win_crash_logger.cpp
+++ b/indra/win_crash_logger/win_crash_logger.cpp
@@ -9,9 +9,11 @@
 // win_crash_logger.cpp : Defines the entry point for the application.
 //
 
+// Must be first include, precompiled headers.
+#include "stdafx.h"
+
 #include "linden_common.h"
 #include "llcontrol.h"
-#include "stdafx.h"
 #include "resource.h"
 
 #include <stdio.h>