diff --git a/.hgtags b/.hgtags
old mode 100755
new mode 100644
index 51a13fbc092a52b069804091acbb5107b867a3d7..92ddad7884eee9d710328d5fc7168290dc6ea0e0
--- a/.hgtags
+++ b/.hgtags
@@ -72,35 +72,35 @@ b53a0576eec80614d7767ed72b40ed67aeff27c9 DRTVWR-38_2.5.2-release
 461c8c65b5c799ddfe365422f9be9c0095d91e7d 2.6.0-beta1-tip
 9e4641f4a7870c0f565a25a2971368d5a29516a1 2.6.0-beta2
 9e4641f4a7870c0f565a25a2971368d5a29516a1 DRTVWR-41_2.6.0-beta2
-42f32494bac475d0737799346f6831558ae8bf5d 2.6.0-release
-42f32494bac475d0737799346f6831558ae8bf5d DRTVWR-39_2.6.0-release
 c5bdef3aaa2744626aef3c217ce29e1900d357b3 2.6.1-beta1
 c5bdef3aaa2744626aef3c217ce29e1900d357b3 2.6.1-start
 c5bdef3aaa2744626aef3c217ce29e1900d357b3 DRTVWR-43_2.6.1-beta1
-c9182ed77d427c759cfacf49a7b71a2e20d522aa 2.6.1-release
-c9182ed77d427c759cfacf49a7b71a2e20d522aa DRTVWR-42_2.6.1-release
 56b2778c743c2a964d82e1caf11084d76a87de2c 2.6.2-start
 d1203046bb653b763f835b04d184646949d8dd5c 2.6.2-beta1
 d1203046bb653b763f835b04d184646949d8dd5c DRTVWR-45_2.6.2-beta1
-214180ad5714ce8392b82bbebcc92f4babd98300 2.6.2-release
-214180ad5714ce8392b82bbebcc92f4babd98300 DRTVWR-44_2.6.2-release
+42f32494bac475d0737799346f6831558ae8bf5d 2.6.0-release
+42f32494bac475d0737799346f6831558ae8bf5d DRTVWR-39_2.6.0-release
+c9182ed77d427c759cfacf49a7b71a2e20d522aa 2.6.1-release
+c9182ed77d427c759cfacf49a7b71a2e20d522aa DRTVWR-42_2.6.1-release
 52b2263ab28f0976c689fd0b76c55a9eb027cdbf end-of-develop.py
 ec32f1045e7c2644015245df3a9933620aa194b8 2.6.3-start
 d7fcefabdf32bb61a9ea6d6037c1bb26190a85bc 2.6.3-beta1
 d7fcefabdf32bb61a9ea6d6037c1bb26190a85bc DRTVWR-47_2.6.3-beta1
 0630e977504af5ea320c58d33cae4e1ddee793e9 2.6.3-beta2
 0630e977504af5ea320c58d33cae4e1ddee793e9 DRTVWR-48_2.6.3-beta2
-8f2da1701c81a62352df2b8d413d27fb2cade9a6 2.6.3-release
-8f2da1701c81a62352df2b8d413d27fb2cade9a6 DRTVWR-46_2.6.3-release
 3178e311da3a8739a85363665006ea3c4610cad4 dons-headless-hackathon-work
+214180ad5714ce8392b82bbebcc92f4babd98300 2.6.2-release
+214180ad5714ce8392b82bbebcc92f4babd98300 DRTVWR-44_2.6.2-release
 7db558aaa7c176f2022b3e9cfe38ac72f6d1fccd 2.6.5-beta1
 7db558aaa7c176f2022b3e9cfe38ac72f6d1fccd DRTVWR-50_2.6.5-beta1
+8f2da1701c81a62352df2b8d413d27fb2cade9a6 2.6.3-release
+8f2da1701c81a62352df2b8d413d27fb2cade9a6 DRTVWR-46_2.6.3-release
 800cefce8d364ffdd2f383cbecb91294da3ea424 2.6.6-start
 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 2.6.6-beta1
 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 DRTVWR-52_2.6.6-beta1
+5e349dbe9cc84ea5795af8aeb6d473a0af9d4953 2.6.8-start
 dac76a711da5f1489a01c1fa62ec97d99c25736d 2.6.6-release
 dac76a711da5f1489a01c1fa62ec97d99c25736d DRTVWR-51_2.6.6-release
-5e349dbe9cc84ea5795af8aeb6d473a0af9d4953 2.6.8-start
 beafa8a9bd1d1b670b7523d865204dc4a4b38eef 2.6.8-beta1
 beafa8a9bd1d1b670b7523d865204dc4a4b38eef DRTVWR-55_2.6.8-beta1
 be2000b946f8cb3de5f44b2d419287d4c48ec4eb 2.6.8-release
@@ -119,50 +119,50 @@ e67da2c6e3125966dd49eef98b36317afac1fcfe 2.6.9-start
 9f79a6ed8fdcd2f3dac33ea6b3236eeb278dccfe 2.7.2-start
 e0dc8b741eaa27dcdfbc9e956bb2579b954d15eb 2.7.2-beta1
 e0dc8b741eaa27dcdfbc9e956bb2579b954d15eb DRTVWR-63_2.7.2-beta1
+6a3e7e403bd19e45fdfc2fcc716867af3ab80861 2.7.3-start
 fe3a8e7973072ea62043c08b19b66626c1a720eb 2.7.1-release
 fe3a8e7973072ea62043c08b19b66626c1a720eb 2.7.2-release
 fe3a8e7973072ea62043c08b19b66626c1a720eb DRTVWR-60_2.7.1-release
 fe3a8e7973072ea62043c08b19b66626c1a720eb DRTVWR-62_2.7.2-release
-6a3e7e403bd19e45fdfc2fcc716867af3ab80861 2.7.3-start
 6af10678de4736222b2c3f7e010e984fb5b327de 2.7.4-start
 be963a4eef635542f9617d7f5fd22ba48fb71958 2.7.4-beta1
 be963a4eef635542f9617d7f5fd22ba48fb71958 DRTVWR-67_2.7.4-beta1
-057f319dd8eccdf63a54d99686c68cdcb31b6abc 2.7.4-release
-057f319dd8eccdf63a54d99686c68cdcb31b6abc DRTVWR-66_2.7.4-release
 19a498fa62570f352d7d246f17e3c81cc1d82d8b 2.7.5-start
 09984bfa6cae17e0f72d02b75c1b7393c65eecfc 2.7.5-beta1
 09984bfa6cae17e0f72d02b75c1b7393c65eecfc DRTVWR-69_2.7.5-beta1
-6866d9df6efbd441c66451debd376d21211de39c 2.7.5-release
-6866d9df6efbd441c66451debd376d21211de39c DRTVWR-68_2.7.5-release
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-beta1
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-start
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c DRTVWR-71_2.8.0-beta1
-493d9127ee50e84ba08a736a65a23ca86f7a5b01 2.8.0-release
-493d9127ee50e84ba08a736a65a23ca86f7a5b01 DRTVWR-70_2.8.0-release
+057f319dd8eccdf63a54d99686c68cdcb31b6abc 2.7.4-release
+057f319dd8eccdf63a54d99686c68cdcb31b6abc DRTVWR-66_2.7.4-release
+6866d9df6efbd441c66451debd376d21211de39c 2.7.5-release
+6866d9df6efbd441c66451debd376d21211de39c DRTVWR-68_2.7.5-release
 502f6a5deca9365ddae57db4f1e30172668e171e 2.8.1-start
 2c7e459e0c883f8e406b932e41e60097e9ee077e 2.8.1-beta1
 2c7e459e0c883f8e406b932e41e60097e9ee077e DRTVWR-73_2.8.1-beta1
+493d9127ee50e84ba08a736a65a23ca86f7a5b01 2.8.0-release
+493d9127ee50e84ba08a736a65a23ca86f7a5b01 DRTVWR-70_2.8.0-release
+54bc7823ad4e3a436fef79710f685a7372bbf795 2.8.2-start
+ac0f1a132d35c02a58861d37cca75b0429ac9137 2.8.3-start
 29e93d7e19991011bd12b5748142b11a5dcb4370 2.8.1-release
 29e93d7e19991011bd12b5748142b11a5dcb4370 DRTVWR-72_2.8.1-release
 4780e3bd2b3042f91be3426151f28c30d199bb3b 2.8.1-hotfix
 4780e3bd2b3042f91be3426151f28c30d199bb3b DRTVWR-76_2.8.1-hotfix
-54bc7823ad4e3a436fef79710f685a7372bbf795 2.8.2-start
-ac0f1a132d35c02a58861d37cca75b0429ac9137 2.8.3-start
 599677276b227357140dda35bea4a2c18e2e67b5 2.8.3-beta1
 599677276b227357140dda35bea4a2c18e2e67b5 DRTVWR-75_2.8.3-beta1
-fb85792b84bf28428889c4cc966469d92e5dac4c 2.8.3-release
-fb85792b84bf28428889c4cc966469d92e5dac4c DRTVWR-74_2.8.3-release
 6b678ea52f90d5c14181661dcd2546e25bde483e 3.0.0-start
 b0be6ce3adfef3a014a2389d360539f8a86c5439 3.0.0-beta1
 b0be6ce3adfef3a014a2389d360539f8a86c5439 DRTVWR-78_3.0.0-beta1
-1778f26b6d0ae762dec3ca37140f66620f2485d9 3.0.0-release
-1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-77_3.0.0-release
+fb85792b84bf28428889c4cc966469d92e5dac4c 2.8.3-release
+fb85792b84bf28428889c4cc966469d92e5dac4c DRTVWR-74_2.8.3-release
 82a2079ffcb57ecb1b3849cb41376b443e1eb912 3.0.1-start
 364fd63517fbacbbcb9129d096187171ba8c9e48 3.0.1-beta1
 364fd63517fbacbbcb9129d096187171ba8c9e48 DRTVWR-81_3.0.1-beta1
 f2412ecd6740803ea9452f1d17fd872e263a0df7 3.0.2-start
 42784bf50fa01974bada2a1af3892ee09c93fcda 3.0.2-beta1
 42784bf50fa01974bada2a1af3892ee09c93fcda DRTVWR-83_3.0.2-beta1
+1778f26b6d0ae762dec3ca37140f66620f2485d9 3.0.0-release
+1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-77_3.0.0-release
 e5c9af2d7980a99a71650be3a0cf7b2b3c3b897e 3.0.2-beta2
 e5c9af2d7980a99a71650be3a0cf7b2b3c3b897e DRTVWR-86_3.0.2-beta2
 b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
@@ -170,9 +170,9 @@ b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
 6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 DRTVWR-85_3.0.3-beta1
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a 3.0.3-beta2
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a DRTVWR-89_3.0.3-beta2
+586907287be581817b2422b5137971b22d54ea48 3.0.4-start
 0496d2f74043cf4e6058e76ac3db03d44cff42ce 3.0.3-release
 0496d2f74043cf4e6058e76ac3db03d44cff42ce DRTVWR-84_3.0.3-release
-586907287be581817b2422b5137971b22d54ea48 3.0.4-start
 92a3aa04775438226399b19deee12ac3b5a62838 3.0.5-start
 c7282e59f374ee904bd793c3c444455e3399b0c5 3.1.0-start
 2657fa785bbfac115852c41bd0adaff74c2ad5da 3.1.0-beta1
@@ -193,11 +193,11 @@ e440cd1dfbd128d7d5467019e497f7f803640ad6 DRTVWR-95_3.2.0-beta1
 c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
 9e390d76807fa70d356b8716fb83b8ce42a629ef 3.2.1-beta1
 9e390d76807fa70d356b8716fb83b8ce42a629ef DRTVWR-100_3.2.1-beta1
-a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
-a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 40b46edba007d15d0059c80864b708b99c1da368 3.2.2-start
 523df3e67378541498d516d52af4402176a26bac 3.2.2-beta1
 523df3e67378541498d516d52af4402176a26bac DRTVWR-102_3.2.2-beta1
+a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
+a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 80f3e30d8aa4d8f674a48bd742aaa6d8e9eae0b5 3.2.3-start
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-start
@@ -248,67 +248,57 @@ bb9932a7a5fd00edf52d95f354e3b37ae6a942db DRTVWR-156
 6414ecdabc5d89515b08d1f872cf923ed3a5523a DRTVWR-148
 2a3965b3ad202df7ea25d2be689291bb14a1280e DRTVWR-155
 24a7281bef42bd4430ceb25db8b195449c2c7de3 DRTVWR-153
-a716684aa7c07c440b1de5815b8a1f3dd3fd8bfb DRTVWR-159
-9a78ac13f047056f788c4734dd91aebfe30970e3 DRTVWR-157
 5910f8063a7e1ddddf504c2f35ca831cc5e8f469 DRTVWR-160
 f0a174c2adb4bc39b16722a61d7eeb4f2a1d4843 3.3.3-beta1
 f0a174c2adb4bc39b16722a61d7eeb4f2a1d4843 DRTVWR-144
-089e5c84b2dece68f2b016c842ef9b5de4786842 DRTVWR-161
-600f3b3920d94de805ac6dc8bb6def9c069dd360 DRTVWR-162
-c08e2ac17a99973b2a94477659220b99b8847ae2 DRTVWR-163
 2d6c0634b11e6f3df11002b8510a72a0433da00a DRTVWR-164
+600f3b3920d94de805ac6dc8bb6def9c069dd360 DRTVWR-162
 80b5e5e9775966d3839331ffa7a16a60f9d7c930 DRTVWR-165
 fdcc08a4f20ae9bb060f4693c8980d216534efdf 3.3.3-beta2
 af5f3e43e6e4424b1da19d9e16f6b853a7b822ed DRTVWR-169
 4b3c68199a86cabaa5d9466d7b0f7e141e901d7a 3.3.3-beta3
 6428242e124b523813bfaf4c45b3d422f0298c81 3.3.3-release
+a716684aa7c07c440b1de5815b8a1f3dd3fd8bfb DRTVWR-159
+9a78ac13f047056f788c4734dd91aebfe30970e3 DRTVWR-157
+089e5c84b2dece68f2b016c842ef9b5de4786842 DRTVWR-161
+c08e2ac17a99973b2a94477659220b99b8847ae2 DRTVWR-163
 b9d0170b62eb1c7c3adaa37a0b13a833e5e659f9 DRTVWR-171
 050e48759337249130f684b4a21080b683f61732 DRTVWR-168
 09ef7fd1b0781f33b8a3a9af6236b7bcb4831910 DRTVWR-170
 f87bfbe0b62d26f451d02a47c80ebef6b9168fc2 DRTVWR-158
 f91d003091a61937a044652c4c674447f7dcbb7a 3.3.4-beta1
-005dfe5c4c377207d065fb27858d2eb0b53b143a DRTVWR-167
 bce218b2b45b730b22cc51e4807aa8b571cadef3 DRTVWR-173
 cbea6356ce9cb0c313b6777f10c5c14783264fcc DRTVWR-174
 82b5330bc8b17d0d4b598832e9c5a92e90075682 3.3.4-beta2
 57d221de3df94f90b55204313c2cef044a3c0ae2 DRTVWR-176
 eb539c65e6ee26eea2bf373af2d0f4b52dc91289 DRTVWR-177
 a8057e1b9a1246b434a27405be35e030f7d28b0c 3.3.4-beta3
-888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
 4281aa899fb2cedb7a9ca7ce91c5c29d4aa69594 DRTVWR-180
 5c08e1d8edd871807153603b690e3ee9dbb548aa DRTVWR-183
 6c75f220b103db1420919c8b635fe53e2177f318 3.3.4-beta4
 9cd174d3a54d93d409a7c346a15b8bfb40fc58f4 DRTVWR-184
 ab2ffc547c8a8950ff187c4f6c95e5334fab597b 3.3.4-beta5
 28e100d0379a2b0710c57647a28fc5239d3d7b99 3.3.4-release
+005dfe5c4c377207d065fb27858d2eb0b53b143a DRTVWR-167
+888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
 a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182
 1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1
-81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
-47f0d08ba7ade0a3905074009067c6d3df7e16ae DRTVWR-190
-cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
-c04e68e1b0034fd0a20815ae24c77e5f8428e822 DRTVWR-188
 9ee9387789701d597130f879d9011a4958753862 DRTVWR-189
+47f0d08ba7ade0a3905074009067c6d3df7e16ae DRTVWR-190
 421126293dcbde918e0da027ca0ab9deb5b4fbf2 DRTVWR-192
-4b2c52aecb7a75de31dbb12d9f5b9a251d8707be DRTVWR-191
 33a2fc7a910ae29ff8b4850316ed7fbff9f64d33 DRTVWR-195
 e9732c739c8a72a590216951505ea9c76a526a84 DRTVWR-193
-78ca0bbf43a92e8914d4cfa87d69a6717ef7d4cf DRTVWR-194
 7602f61c804a512764e349c034c02ddabeefebc4 DRTVWR-196
 ae5c83dd61d2d37c45f1d5b8bf2b036d87599f1b DRTVWR-198
 507bdfbd6bf844a511c1ffeda4baa80016ed1346 DRTVWR-197
 b1dbb1a83f48f93f6f878cff9e52d2cb635e145c 3.4.0-beta2
 37402e2b19af970d51b0a814d79892cc5647532b DRTVWR-200
 182a9bf30e81070361bb020a78003b1cf398e79c 3.4.0-beta3
-248f4acd92a706c79e842bc83d80baa7369c0c2e DRTVWR-203
 6dfb0fba782c9233dd95f24ec48146db0d3f210b DRTVWR-199
 7c9102fb998885621919f2474a002c35b583539b 3.3.4-release2
 7649a3dff5ec22d3727377e5f02efd0f421e4cb5 DRTVWR-201
 84fb70dfe3444e75a44fb4bee43e2fc8221cebdd 3.4.0-beta4
-de3be913f68813a9bac7d1c671fef96d1159bcd6 DRTVWR-202
 573e863be2f26d3687161def4b9fea9b7038dda8 3.4.0-beta5
-34dbbe2b00afe90352d3acf8290eb10ab90d1c8b oz-build-test-tag
-6ee71714935ffcd159db3d4f5800c1929aac54e1 DRTVWR-205
-7b22c612fc756e0ea63b10b163e81d107f85dbf8 DRTVWR-206
 8c9085066c78ed5f6c9379dc054c82a6fcdb1851 DRTVWR-207
 351eea5f9dc192fc5ddea3b02958de97677a0a12 3.3.4-release3
 af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212
@@ -319,7 +309,6 @@ ceed0b65a69f1eac20d523e0203320a32f9a3f3c DRTVWR-215
 97977c67245f52db20eb15f1918cc0f24778cabc 3.4.0-release
 5adb2b8f96c3cac88ad7c7d996d707f1b29df336 3.4.1-beta1
 b3f74858a1c8720c82d0978f3877a3fc8ba459ec 3.4.1-beta1a
-b61afe175b829c149d369524a4e974dfda99facf DRTVWR-219
 2b779f233ee6f38c89cb921650c773a96e63da92 DRTVWR-220
 0b9d95f4bfb6867cbf56eaec51633b0da2f1262d DRTVWR-221
 e6e553761829dc0270eaaa712b7cb0622535b076 3.4.1-beta3
@@ -344,31 +333,36 @@ baf97f06ae17223614c5e31aa42e71d87cff07fe DRTVWR-236
 b2f21e3442542283a80e7eaebae9f833e5a927b6 DRTVWR-237
 3f9be82de642d468c5fc272cb9d96b46b5498402 3.4.1-beta12
 e59ffd3fe0838ae6b09b242a6e9df71761b88f41 3.4.1-release
+81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
+cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
+c04e68e1b0034fd0a20815ae24c77e5f8428e822 DRTVWR-188
+4b2c52aecb7a75de31dbb12d9f5b9a251d8707be DRTVWR-191
+78ca0bbf43a92e8914d4cfa87d69a6717ef7d4cf DRTVWR-194
+248f4acd92a706c79e842bc83d80baa7369c0c2e DRTVWR-203
+de3be913f68813a9bac7d1c671fef96d1159bcd6 DRTVWR-202
+34dbbe2b00afe90352d3acf8290eb10ab90d1c8b oz-build-test-tag
+6ee71714935ffcd159db3d4f5800c1929aac54e1 DRTVWR-205
+7b22c612fc756e0ea63b10b163e81d107f85dbf8 DRTVWR-206
+b61afe175b829c149d369524a4e974dfda99facf DRTVWR-219
 32896d5e920ca9a29256ff3b747c2e99752aa5ae DRTVWR-217
 704bbae7b182a1f2811a47a054e680522966f54a 3.4.2-beta1
-d799593b53ed733862e9a13871e318e886469377 DRTVWR-208
-e497dcde7a3653e384eb223a8a460030e89c294c DRTVWR-223
 288539fc0408ed4b69a99665de33bbbc2c3c08fe DRTVWR-216
 e664473c16df1d82ffaff382e7b3e023da202d52 3.4.2-beta2
-93ab02d83f51e30a3cabad98aff89601befd9413 DRTVWR-240
 0891d7a773a31397dcad48be3fa66531d567a821 DRTVWR-242
 710785535362b3cb801b6a3dc4703be3373bd0cd 3.4.2-beta3
-2aa72e3372a83dece4df9cf72fb1e7c34f90b5e3 DRTVWR-209
-f7bedce18ad52283e6072814db23318907261487 DRTVWR-238
-7b64c96fbcadf360bd2feaae19d330166b70877c DRTVWR-210
 e9a5886052433d5db9e504ffaca10890f9932979 DRTVWR-243
 73b84b9864dc650fe7c8fc9f52361450f0849004 3.4.2-beta4
 16310aabccf315870f7cc9bf966926c0ad6954fa 3.4.2-release
+d799593b53ed733862e9a13871e318e886469377 DRTVWR-208
+e497dcde7a3653e384eb223a8a460030e89c294c DRTVWR-223
+93ab02d83f51e30a3cabad98aff89601befd9413 DRTVWR-240
+2aa72e3372a83dece4df9cf72fb1e7c34f90b5e3 DRTVWR-209
+f7bedce18ad52283e6072814db23318907261487 DRTVWR-238
+7b64c96fbcadf360bd2feaae19d330166b70877c DRTVWR-210
 5e4e4128b256525bafc07a62e35ae8527aaa9c9d DRTVWR-241
 f1d3b3fcab28ed9ea532bf50db0ba96f5c8cc8e9 DRTVWR-232
 4918b150e75df6b516fb6c2616d32043fa6b4cac DRTVWR-245
 94ab2b49458ab372a95d2d6949fdf574f413068d 3.4.3-beta1
-4c3460cb1fb7c6da9965e09c734d282a8e9c81f0 DRTVWR-229
-f4481df42f9a4a92bf475a80f0c51d1a4bbdfd59 DRTVWR-246
-39c5204b6e800983a41ccac8ad6dc993120197c6 DRTVWR-247
-7c7d57d393e8ae7b61623279de06eb4a62ccae6a DRTVWR-249
-f72b50ef168c159d6e79e97aa2bcafaf8577ab99 DRTVWR-230
-b418be80903520c492e1173f3afbc4021cad5d07 DRTVWR-255
 965b9a35e260c0f53be1a25f0db7abc8a67eaf47 DRTVWR-252
 bb10adc4f76cf0067fca7075146f00cdc0740e9d DRTVWR-251
 ab0aa2f6ba22b52fed30a2337197f589156edc75 DRTVWR-253
@@ -377,21 +371,49 @@ ab0aa2f6ba22b52fed30a2337197f589156edc75 DRTVWR-253
 44e764a6ac9e672a4f3bce821a4b6a218590c374 DRTVWR-258
 c23d734065ed593b2413385aecd8366d8e0ee96b DRTVWR-257
 452ce96d4046dc05a3ecaecc203e2cc8ddd72e76 DRTVWR-259
-9aa1aa9f1fe13c194695a0b8f0af298296241dc2 DRTVWR-260
 daca610d840625b5bebb966a57cb49581852c417 DRTVWR-265
 9afbdc4e24cc04feacfb2b7a10b78a64f780901a DRTVWR-266
 73280db02501f5ad041fc18b1eba68e73a81996c DRTVWR-267
 870e2d79e0063fda87187f17bbc2747766733194 3.4.3-beta3
 0a2ca6546b499239afeb66d17b2fadbcdbe36ab1 3.4.3-release
+4c3460cb1fb7c6da9965e09c734d282a8e9c81f0 DRTVWR-229
+f4481df42f9a4a92bf475a80f0c51d1a4bbdfd59 DRTVWR-246
+39c5204b6e800983a41ccac8ad6dc993120197c6 DRTVWR-247
+7c7d57d393e8ae7b61623279de06eb4a62ccae6a DRTVWR-249
+f72b50ef168c159d6e79e97aa2bcafaf8577ab99 DRTVWR-230
+b418be80903520c492e1173f3afbc4021cad5d07 DRTVWR-255
+9aa1aa9f1fe13c194695a0b8f0af298296241dc2 DRTVWR-260
 84fbaf2d4141bd161731430e760949dc787ca206 DRTVWR-244
 083d2d36b5bb1c54fc3dd7caac0e7ac381a9cef0 3.4.4-beta1
-391a8c74cec7275c5d26c85ad108d4782a3e3dd9 DRTVWR-268
 b634dec987c16e8c9c938e11e52591d9ead8fa9b DRTVWR-270
 cd39255bd23330fd30c04105f2811e941d8524fe 3.4.4-beta2
 2c4011bbc2b15b82198fd8b51f3a9fe765a08c4d DRTVWR-271
 2f8a3ef687bc55828abcb17ac1ad7cde70536d7e 3.4.4-beta3
 35cfd4cf5b895fa776592f2e630e330be7f0604e DRTVWR-273
-a36f1f354b02aa6e448ca13685de167d0a0a3d03 DRTVWR-272
-37dba00ad820de3a808d4039396b162a9c275b3e DRTVWR-269
 c374035d459af3c03dea2dd90880dfc25de64706 DRTVWR-275
 05d9f1dd7a954069af2a33abedb7713fa36a04cb 3.4.4-beta4
+e1bb1ae7d8b12faeb37933a737c199cc9b9f89cc 3.4.4-release
+391a8c74cec7275c5d26c85ad108d4782a3e3dd9 DRTVWR-268
+a36f1f354b02aa6e448ca13685de167d0a0a3d03 DRTVWR-272
+37dba00ad820de3a808d4039396b162a9c275b3e DRTVWR-269
+7c6dfdc1b7a2ce0d8e3a8f3ce3058547ea065c0f DRTVWR-250
+b9ff9730daa53a541925300cbd02bb14575a5705 DRTVWR-277
+af6b711a97073431953b55ee808aaa09900c27e5 DRTVWR-276
+8302fefde6c8f4a64bfc7f04929f8bc85f5c6c7b DRTVWR-279
+c296133849d1f103c0e2abc41e6599daed00b67b DRTVWR-280
+40a2265058abc9fde4914c10185f916435818621 3.4.5-beta1
+5df4802bec93c8d0a509946d826bb4c50c5442ec DRTVWR-281
+7c1c33ba4cfd2d15ca51cc1ac440eca551331a4a DRTVWR-283
+6b9c7dbebef793230d64e1b452577c8b142d4143 3.4.5-beta2
+ccf991e02dc2f63fb646324230d54832683f4a9b DRTVWR-286
+2d849850558a5a0324b398d1c102d30bcbdfb88f DRTVWR-287
+e06898df8644fe567bee94f817d03abc1c380993 3.4.5-beta3
+a676b4d6c037b39fe5b8e42cf8839a9303936089 DRTVWR-289
+28fa8b944a0c1869636ab00cc400f5aa71f6fa3c DRTVWR-290
+7f09bbc28c297f14b67961be7b6575445fa160e8 DRTVWR-291
+b23419a2748483c98f3b84b630468a21c88feba5 DRTVWR-292
+1567de5700c273b583dac41b64275c223287306e 3.4.5-beta4
+1cce8447f8f574673e3f47d6fe584262e6964fe2 DRTVWR-296
+0a5d409161ef2a89b28c9a741051dd2dedc707d6 DRTVWR-297
+852b69ef0b5fe6b13b69cc2217282cc64de6afab 3.4.5-beta5
+a49c715243a36a8a380504d14cb7416b3039c956 3.4.5-release
diff --git a/autobuild.xml b/autobuild.xml
index 017427278ef4a1bad7b9d85e2a0280bfd8e9b254..11c2da52dc25642bda3b04818f32043b2749004a 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1463,6 +1463,30 @@
           </map>
         </map>
       </map>
+      <key>nvapi</key>
+      <map>
+        <key>license</key>
+        <string>NVAPI</string>
+        <key>license_file</key>
+        <string>LICENSES/NVAPI_SDK_License_Agreement.pdf</string>
+        <key>name</key>
+        <string>nvapi</string>
+        <key>platforms</key>
+        <map>
+          <key>windows</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>baf519d36dffe4e4a59471450e391d01</string>
+              <key>url</key>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-nvapi/rev/267102/arch/CYGWIN/installer/nvapi-304-windows-20121116.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows</string>
+          </map>
+        </map>
+      </map>
       <key>ogg-vorbis</key>
       <map>
         <key>license</key>
diff --git a/doc/contributions.txt b/doc/contributions.txt
index f53d9f5cfd74cd29e1706b43d2ec3c736b714bfd..e86ef11a72bd58e85621a2482f45d812f8afe0df 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -895,6 +895,7 @@ NickyD
 	MAINT-873
 Nicky Dasmijn
 	VWR-29228
+	MAINT-873
 Nicky Perian
 	OPEN-1
 	STORM-1087
@@ -1250,6 +1251,7 @@ Whimsy Winx
 Whirly Fizzle
 	STORM-1895
 	MAINT-873
+	STORM-1930
 Whoops Babii
 	VWR-631
 	VWR-1640
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 24c98bfadaa5e945c2ead2eb88ff6b94ed550bc2..001bb4b9359aa6e930c9b9158e0cf27a1da1d758 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -82,8 +82,7 @@ if (VIEWER)
 
   if (LINUX)
     add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
-    add_subdirectory(${VIEWER_PREFIX}linux_updater)
-    add_dependencies(viewer linux-crash-logger-strip-target linux-updater)
+    add_dependencies(viewer linux-crash-logger-strip-target)
   elseif (DARWIN)
     add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
     add_subdirectory(${VIEWER_PREFIX}mac_updater)
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
old mode 100644
new mode 100755
index 21a0c8a9cad82d777782b1f531874b69a98f3657..9bb3077797db94c929b803c68a4f977a51c354d1
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -211,7 +211,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
   if (WINDOWS)
     SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname}
         PROPERTIES
-        LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
+        LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS"
         LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
         LINK_FLAGS_RELEASE ""
         )
diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake
index 8f7bb296cec0617ae4b7d297eba1ac16c019c441..c254bf6f053b337ac6637f8a6b96e4f6cf9b2afc 100644
--- a/indra/cmake/LLCommon.cmake
+++ b/indra/cmake/LLCommon.cmake
@@ -22,7 +22,7 @@ else (LINUX)
     set(LLCOMMON_LIBRARIES llcommon)
 endif (LINUX)
 
-add_definitions(${TCMALLOC_FLAG})
+# add_definitions(${TCMALLOC_FLAG})
 
 set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.")
 if(LLCOMMON_LINK_SHARED)
diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..105f442a30f701cbcc97cb164122f7e8c364e1e9
--- /dev/null
+++ b/indra/cmake/NVAPI.cmake
@@ -0,0 +1,16 @@
+# -*- cmake -*-
+include(Prebuilt)
+
+set(NVAPI ON CACHE BOOL "Use NVAPI.")
+
+if (NVAPI)
+  if (WINDOWS)
+    use_prebuilt_binary(nvapi)
+    set(NVAPI_LIBRARY nvapi)
+  else (WINDOWS)
+    set(NVAPI_LIBRARY "")
+  endif (WINDOWS)
+else (NVAPI)
+  set(NVAPI_LIBRARY "")
+endif (NVAPI)
+
diff --git a/indra/linux_updater/CMakeLists.txt b/indra/linux_updater/CMakeLists.txt
deleted file mode 100644
index 4377a6333c37e53f993bfd5fd71f89df58b1c547..0000000000000000000000000000000000000000
--- a/indra/linux_updater/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- cmake -*-
-
-project(linux_updater)
-
-include(00-Common)
-include(CURL)
-include(CARes)
-include(OpenSSL)
-include(UI)
-include(LLCommon)
-include(LLVFS)
-include(LLXML)
-include(LLUI)
-include(Linking)
-
-include_directories(
-    ${LLCOMMON_INCLUDE_DIRS}
-    ${LLVFS_INCLUDE_DIRS}
-    ${LLXML_INCLUDE_DIRS}
-    ${LLUI_INCLUDE_DIRS}
-    ${CURL_INCLUDE_DIRS}
-    ${CARES_INCLUDE_DIRS}
-    ${OPENSSL_INCLUDE_DIRS}
-    ${UI_INCLUDE_DIRS}
-    )
-
-set(linux_updater_SOURCE_FILES linux_updater.cpp)
-
-set(linux_updater_HEADER_FILES CMakeLists.txt)
-
-set_source_files_properties(${linux_updater_HEADER_FILES}
-                            PROPERTIES HEADER_FILES_ONLY TRUE)
-
-list(APPEND linux_updater_SOURCE_FILES ${linux_updater_HEADER_FILES})
-
-add_executable(linux-updater ${linux_updater_SOURCE_FILES})
-
-target_link_libraries(linux-updater
-    ${CURL_LIBRARIES}
-    ${CARES_LIBRARIES}
-    ${OPENSSL_LIBRARIES}
-    ${CRYPTO_LIBRARIES}
-    ${UI_LIBRARIES}
-    ${LLXML_LIBRARIES}
-    ${LLUI_LIBRARIES}
-    ${LLVFS_LIBRARIES}
-    ${LLCOMMON_LIBRARIES}
-    )
-
-add_custom_target(linux-updater-target ALL
-                  DEPENDS linux-updater)
diff --git a/indra/linux_updater/linux_updater.cpp b/indra/linux_updater/linux_updater.cpp
deleted file mode 100644
index 991dfd9dce5693a914d8e7578e774de96a13c926..0000000000000000000000000000000000000000
--- a/indra/linux_updater/linux_updater.cpp
+++ /dev/null
@@ -1,926 +0,0 @@
-/**
- * @file linux_updater.cpp
- * @author Kyle Ambroff <ambroff@lindenlab.com>, Tofu Linden
- * @brief Viewer update program for unix platforms that support GTK+
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-
-#include "linden_common.h"
-#include "llerrorcontrol.h"
-#include "llfile.h"
-#include "lldir.h"
-#include "lldiriterator.h"
-
-/*==========================================================================*|
-// IQA-490: Use of LLTrans -- by this program at least -- appears to be buggy.
-// With it, the 3.3.2 beta 1 linux-updater.bin crashes; without it seems stable.
-#include "llxmlnode.h"
-#include "lltrans.h"
-|*==========================================================================*/
-
-static class LLTrans
-{
-public:
-	LLTrans();
-	static std::string getString(const std::string& key);
-
-private:
-	std::string _getString(const std::string& key) const;
-
-	typedef std::map<std::string, std::string> MessageMap;
-	MessageMap mMessages;
-} sLLTransInstance;
-
-#include <curl/curl.h>
-#include <map>
-#include <boost/foreach.hpp>
-
-extern "C" {
-#include <gtk/gtk.h>
-}
-
-const guint UPDATE_PROGRESS_TIMEOUT = 100;
-const guint UPDATE_PROGRESS_TEXT_TIMEOUT = 1000;
-const guint ROTATE_IMAGE_TIMEOUT = 8000;
-
-typedef struct _updater_app_state {
-	std::string app_name;
-	std::string url;
-	std::string file;
-	std::string image_dir;
-	std::string dest_dir;
-	std::string strings_dirs;
-	std::string strings_file;
-
-	LLDirIterator *image_dir_iter;
-
-	GtkWidget *window;
-	GtkWidget *progress_bar;
-	GtkWidget *image;
-
-	double progress_value;
-	bool activity_mode;
-
-	guint image_rotation_timeout_id;
-	guint progress_update_timeout_id;
-	guint update_progress_text_timeout_id;
-
-	bool failure;
-} UpdaterAppState;
-
-// List of entries from strings.xml to always replace
-static std::set<std::string> default_trans_args;
-void init_default_trans_args()
-{
-        default_trans_args.insert("SECOND_LIFE"); // World
-        default_trans_args.insert("APP_NAME");
-        default_trans_args.insert("SECOND_LIFE_GRID");
-        default_trans_args.insert("SUPPORT_SITE");
-}
-
-bool translate_init(std::string comma_delim_path_list,
-		    std::string base_xml_name)
-{
-	return true;
-/*==========================================================================*|
-	init_default_trans_args();
-
-	// extract paths string vector from comma-delimited flat string
-	std::vector<std::string> paths;
-	LLStringUtil::getTokens(comma_delim_path_list, paths, ","); // split over ','
-
-	for(std::vector<std::string>::iterator it = paths.begin(), end_it = paths.end();
-		it != end_it;
-		++it)
-	{
-		(*it) = gDirUtilp->findSkinnedFilename(*it, base_xml_name);
-	}
-
-	// suck the translation xml files into memory
-	LLXMLNodePtr root;
-	bool success = LLXMLNode::getLayeredXMLNode(root, paths);
-	if (!success)
-	{
-		// couldn't load string table XML
-		return false;
-	}
-	else
-	{
-		// get those strings out of the XML
-		LLTrans::parseStrings(root, default_trans_args);
-		return true;
-	}
-|*==========================================================================*/
-}
-
-
-void updater_app_ui_init(void);
-void updater_app_quit(UpdaterAppState *app_state);
-void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state);
-std::string next_image_filename(std::string& image_path, LLDirIterator& iter);
-void display_error(GtkWidget *parent, std::string title, std::string message);
-BOOL install_package(std::string package_file, std::string destination);
-BOOL spawn_viewer(UpdaterAppState *app_state);
-
-extern "C" {
-	void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state);
-	gpointer worker_thread_cb(gpointer *data);
-	int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow);
-	gboolean rotate_image_cb(gpointer data);
-	gboolean progress_update_timeout(gpointer data);
-	gboolean update_progress_text_timeout(gpointer data);
-}
-
-void updater_app_ui_init(UpdaterAppState *app_state)
-{
-	GtkWidget *vbox;
-	GtkWidget *summary_label;
-	GtkWidget *description_label;
-	GtkWidget *frame;
-
-	llassert(app_state != NULL);
-
-	// set up window and main container
-	std::string window_title = LLTrans::getString("UpdaterWindowTitle");
-	app_state->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	gtk_window_set_title(GTK_WINDOW(app_state->window),
-			     window_title.c_str());
-	gtk_window_set_resizable(GTK_WINDOW(app_state->window), FALSE);
-	gtk_window_set_position(GTK_WINDOW(app_state->window),
-				GTK_WIN_POS_CENTER_ALWAYS);
-
-	gtk_container_set_border_width(GTK_CONTAINER(app_state->window), 12);
-	g_signal_connect(G_OBJECT(app_state->window), "delete-event",
-			 G_CALLBACK(on_window_closed), app_state);
-
-	vbox = gtk_vbox_new(FALSE, 6);
-	gtk_container_add(GTK_CONTAINER(app_state->window), vbox);
-
-	// set top label
-	std::ostringstream label_ostr;
-	label_ostr << "<big><b>"
-		   << LLTrans::getString("UpdaterNowUpdating")
-		   << "</b></big>";
-
-	summary_label = gtk_label_new(NULL);
-	gtk_label_set_use_markup(GTK_LABEL(summary_label), TRUE);
-	gtk_label_set_markup(GTK_LABEL(summary_label),
-			     label_ostr.str().c_str());
-	gtk_misc_set_alignment(GTK_MISC(summary_label), 0, 0.5);
-	gtk_box_pack_start(GTK_BOX(vbox), summary_label, FALSE, FALSE, 0);
-
-	// create the description label
-	description_label = gtk_label_new(LLTrans::getString("UpdaterUpdatingDescriptive").c_str());
-	gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE);
-	gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5);
-	gtk_box_pack_start(GTK_BOX(vbox), description_label, FALSE, FALSE, 0);
-
-	// If an image path has been set, load the background images
-	if (!app_state->image_dir.empty()) {
-		frame = gtk_frame_new(NULL);
-		gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
-		gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
-
-		// load the first image
-		app_state->image = gtk_image_new_from_file
-			(next_image_filename(app_state->image_dir, *app_state->image_dir_iter).c_str());
-		gtk_widget_set_size_request(app_state->image, 340, 310);
-		gtk_container_add(GTK_CONTAINER(frame), app_state->image);
-
-		// rotate the images every 5 seconds
-		app_state->image_rotation_timeout_id = g_timeout_add
-			(ROTATE_IMAGE_TIMEOUT, rotate_image_cb, app_state);
-	}
-
-	// set up progress bar, and update it roughly every 1/10 of a second
-	app_state->progress_bar = gtk_progress_bar_new();
-	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
-				  LLTrans::getString("UpdaterProgressBarTextWithEllipses").c_str());
-	gtk_box_pack_start(GTK_BOX(vbox),
-			   app_state->progress_bar, FALSE, TRUE, 0);
-	app_state->progress_update_timeout_id = g_timeout_add
-		(UPDATE_PROGRESS_TIMEOUT, progress_update_timeout, app_state);
-	app_state->update_progress_text_timeout_id = g_timeout_add
-		(UPDATE_PROGRESS_TEXT_TIMEOUT, update_progress_text_timeout, app_state);
-
-	gtk_widget_show_all(app_state->window);
-}
-
-gboolean rotate_image_cb(gpointer data)
-{
-	UpdaterAppState *app_state;
-	std::string filename;
-
-	llassert(data != NULL);
-	app_state = (UpdaterAppState *) data;
-
-	filename = next_image_filename(app_state->image_dir, *app_state->image_dir_iter);
-
-	gdk_threads_enter();
-	gtk_image_set_from_file(GTK_IMAGE(app_state->image), filename.c_str());
-	gdk_threads_leave();
-
-	return TRUE;
-}
-
-std::string next_image_filename(std::string& image_path, LLDirIterator& iter)
-{
-	std::string image_filename;
-	iter.next(image_filename);
-	return gDirUtilp->add(image_path, image_filename);
-}
-
-void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data)
-{
-	UpdaterAppState *app_state;
-
-	llassert(data != NULL);
-	app_state = (UpdaterAppState *) data;
-
-	updater_app_quit(app_state);
-}
-
-void updater_app_quit(UpdaterAppState *app_state)
-{
-	if (app_state != NULL)
-	{
-		g_source_remove(app_state->progress_update_timeout_id);
-
-		if (!app_state->image_dir.empty())
-		{
-			g_source_remove(app_state->image_rotation_timeout_id);
-		}
-	}
-
-	gtk_main_quit();
-}
-
-void display_error(GtkWidget *parent, std::string title, std::string message)
-{
-	GtkWidget *dialog;
-
-	dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
-					GTK_DIALOG_DESTROY_WITH_PARENT,
-					GTK_MESSAGE_ERROR,
-					GTK_BUTTONS_OK,
-					"%s", message.c_str());
-	gtk_window_set_title(GTK_WINDOW(dialog), title.c_str());
-	gtk_dialog_run(GTK_DIALOG(dialog));
-	gtk_widget_destroy(dialog);
-}
-
-gpointer worker_thread_cb(gpointer data)
-{
-	UpdaterAppState *app_state;
-	CURL *curl;
-	CURLcode result;
-	FILE *package_file;
-	GError *error = NULL;
-	int fd;
-
-	//g_return_val_if_fail (data != NULL, NULL);
-	app_state = (UpdaterAppState *) data;
-
-	try {
-
-		if(!app_state->url.empty())
-		{
-			char* tmp_local_filename = NULL;
-			// create temporary file to store the package.
-			fd = g_file_open_tmp
-				("secondlife-update-XXXXXX", &tmp_local_filename, &error);
-			if (error != NULL)
-			{
-				llerrs << "Unable to create temporary file: "
-					   << error->message
-					   << llendl;
-
-				g_error_free(error);
-				throw 0;
-			}
-
-			if(tmp_local_filename != NULL)
-			{
-				app_state->file = tmp_local_filename;
-				g_free(tmp_local_filename);
-			}
-
-			package_file = fdopen(fd, "wb");
-			if (package_file == NULL)
-			{
-				llerrs << "Failed to create temporary file: "
-					   << app_state->file.c_str()
-					   << llendl;
-
-				gdk_threads_enter();
-				display_error(app_state->window,
-							  LLTrans::getString("UpdaterFailDownloadTitle"),
-							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
-				gdk_threads_leave();
-				throw 0;
-			}
-
-			// initialize curl and start downloading the package
-			llinfos << "Downloading package: " << app_state->url << llendl;
-
-			curl = curl_easy_init();
-			if (curl == NULL)
-			{
-				llerrs << "Failed to initialize libcurl" << llendl;
-
-				gdk_threads_enter();
-				display_error(app_state->window,
-							  LLTrans::getString("UpdaterFailDownloadTitle"),
-							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
-				gdk_threads_leave();
-				throw 0;
-			}
-
-			curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
-			curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
-			curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
-			curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
-			curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
-			curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
-							 &download_progress_cb);
-			curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
-
-			result = curl_easy_perform(curl);
-			fclose(package_file);
-			curl_easy_cleanup(curl);
-
-			if (result)
-			{
-				llerrs << "Failed to download update: "
-					   << app_state->url
-					   << llendl;
-
-				gdk_threads_enter();
-				display_error(app_state->window,
-							  LLTrans::getString("UpdaterFailDownloadTitle"),
-							  LLTrans::getString("UpdaterFailUpdateDescriptive"));
-				gdk_threads_leave();
-
-				throw 0;
-			}
-		}
-
-		// now pulse the progres bar back and forth while the package is
-		// being unpacked
-		gdk_threads_enter();
-		std::string installing_msg = LLTrans::getString("UpdaterNowInstalling");
-		gtk_progress_bar_set_text(
-			GTK_PROGRESS_BAR(app_state->progress_bar),
-			installing_msg.c_str());
-		app_state->activity_mode = TRUE;
-		gdk_threads_leave();
-
-		// *TODO: if the destination is not writable, terminate this
-		// thread and show file chooser?
-		if (!install_package(app_state->file.c_str(), app_state->dest_dir))
-		{
-			llwarns << "Failed to install package to destination: "
-				<< app_state->dest_dir
-				<< llendl;
-
-			gdk_threads_enter();
-			display_error(app_state->window,
-						  LLTrans::getString("UpdaterFailInstallTitle"),
-						  LLTrans::getString("UpdaterFailUpdateDescriptive"));
-			//"Failed to update " + app_state->app_name,
-			gdk_threads_leave();
-			throw 0;
-		}
-
-		// try to spawn the new viewer
-		if (!spawn_viewer(app_state))
-		{
-			llwarns << "Viewer was not installed properly in : "
-				<< app_state->dest_dir
-				<< llendl;
-
-			gdk_threads_enter();
-			display_error(app_state->window,
-						  LLTrans::getString("UpdaterFailStartTitle"),
-						  LLTrans::getString("UpdaterFailUpdateDescriptive"));
-			gdk_threads_leave();
-			throw 0;
-		}
-	}
-	catch (...)
-	{
-		app_state->failure = TRUE;
-	}
-
-	gdk_threads_enter();
-	updater_app_quit(app_state);
-	gdk_threads_leave();
-
-	return NULL;
-}
-
-
-gboolean less_anal_gspawnsync(gchar **argv,
-			      gchar **stderr_output,
-			      gint *child_exit_status,
-			      GError **spawn_error)
-{
-	// store current SIGCHLD handler if there is one, replace with default
-	// handler to make glib happy
-	struct sigaction sigchld_backup;
-	struct sigaction sigchld_appease_glib;
-	sigchld_appease_glib.sa_handler = SIG_DFL;
-	sigemptyset(&sigchld_appease_glib.sa_mask);
-	sigchld_appease_glib.sa_flags = 0;
-	sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
-
-	gboolean rtn = g_spawn_sync(NULL,
-				    argv,
-				    NULL,
-				    (GSpawnFlags) (G_SPAWN_STDOUT_TO_DEV_NULL),
-				    NULL,
-				    NULL,
-				    NULL,
-				    stderr_output,
-				    child_exit_status,
-				    spawn_error);
-
-	// restore SIGCHLD handler
-	sigaction(SIGCHLD, &sigchld_backup, NULL);
-
-	return rtn;
-}
-
-
-// perform a rename, or perform a (prompted) root rename if that fails
-int
-rename_with_sudo_fallback(const std::string& filename, const std::string& newname)
-{
-	int rtncode = ::rename(filename.c_str(), newname.c_str());
-	lldebugs << "rename result is: " << rtncode << " / " << errno << llendl;
-	if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))
-	{
-		llinfos << "Permission problem in rename, or moving between different mount points.  Retrying as a mv under a sudo." << llendl;
-		// failed due to permissions, try again as a gksudo or kdesu mv wrapper hack
-		char *sudo_cmd = NULL;
-		sudo_cmd = g_find_program_in_path("gksudo");
-		if (!sudo_cmd)
-		{
-			sudo_cmd = g_find_program_in_path("kdesu");
-		}
-		if (sudo_cmd)
-		{
-			char *mv_cmd = NULL;
-			mv_cmd = g_find_program_in_path("mv");
-			if (mv_cmd)
-			{
-				char *src_string_copy = g_strdup(filename.c_str());
-				char *dst_string_copy = g_strdup(newname.c_str());
-				char* argv[] =
-					{
-						sudo_cmd,
-						mv_cmd,
-						src_string_copy,
-						dst_string_copy,
-						NULL
-					};
-
-				gchar *stderr_output = NULL;
-				gint child_exit_status = 0;
-				GError *spawn_error = NULL;
-				if (!less_anal_gspawnsync(argv, &stderr_output,
-							  &child_exit_status, &spawn_error))
-				{
-					llwarns << "Failed to spawn child process: "
-						<< spawn_error->message
-						<< llendl;
-				}
-				else if (child_exit_status)
-				{
-					llwarns << "mv command failed: "
-						<< (stderr_output ? stderr_output : "(no reason given)")
-						<< llendl;
-				}
-				else
-				{
-					// everything looks good, clear the error code
-					rtncode = 0;
-				}
-
-				g_free(src_string_copy);
-				g_free(dst_string_copy);
-				if (spawn_error) g_error_free(spawn_error);
-			}
-		}
-	}
-	return rtncode;
-}
-
-gboolean install_package(std::string package_file, std::string destination)
-{
-	char *tar_cmd = NULL;
-	std::ostringstream command;
-
-	// Find the absolute path to the 'tar' command.
-	tar_cmd = g_find_program_in_path("tar");
-	if (!tar_cmd)
-	{
-		llerrs << "`tar' was not found in $PATH" << llendl;
-		return FALSE;
-	}
-	llinfos << "Found tar command: " << tar_cmd << llendl;
-
-	// Unpack the tarball in a temporary place first, then move it to
-	// its final destination
-	std::string tmp_dest_dir = gDirUtilp->getTempFilename();
-	if (LLFile::mkdir(tmp_dest_dir, 0744))
-	{
-		llerrs << "Failed to create directory: "
-		       << destination
-		       << llendl;
-
-		return FALSE;
-	}
-
-	char *package_file_string_copy = g_strdup(package_file.c_str());
-	char *tmp_dest_dir_string_copy = g_strdup(tmp_dest_dir.c_str());
-	gchar *argv[8] = {
-		tar_cmd,
-		const_cast<gchar*>("--strip"), const_cast<gchar*>("1"),
-		const_cast<gchar*>("-xjf"),
-		package_file_string_copy,
-		const_cast<gchar*>("-C"), tmp_dest_dir_string_copy,
-		NULL,
-	};
-
-	llinfos << "Untarring package: " << package_file << llendl;
-
-	// store current SIGCHLD handler if there is one, replace with default
-	// handler to make glib happy
-	struct sigaction sigchld_backup;
-	struct sigaction sigchld_appease_glib;
-	sigchld_appease_glib.sa_handler = SIG_DFL;
-	sigemptyset(&sigchld_appease_glib.sa_mask);
-	sigchld_appease_glib.sa_flags = 0;
-	sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
-
-	gchar *stderr_output = NULL;
-	gint child_exit_status = 0;
-	GError *untar_error = NULL;
-	if (!less_anal_gspawnsync(argv, &stderr_output,
-				  &child_exit_status, &untar_error))
-	{
-		llwarns << "Failed to spawn child process: "
-			<< untar_error->message
-			<< llendl;
-		return FALSE;
-	}
-
-	if (child_exit_status)
-	{
-	 	llwarns << "Untar command failed: "
-			<< (stderr_output ? stderr_output : "(no reason given)")
-			<< llendl;
-		return FALSE;
-	}
-
-	g_free(tar_cmd);
-	g_free(package_file_string_copy);
-	g_free(tmp_dest_dir_string_copy);
-	g_free(stderr_output);
-	if (untar_error) g_error_free(untar_error);
-
-	// move the existing package out of the way if it exists
-	if (gDirUtilp->fileExists(destination))
-	{
-		std::string backup_dir = destination + ".backup";
-		int oldcounter = 1;
-		while (gDirUtilp->fileExists(backup_dir))
-		{
-			// find a foo.backup.N folder name that isn't taken yet
-			backup_dir = destination + ".backup." + llformat("%d", oldcounter);
-			++oldcounter;
-		}
-
-		if (rename_with_sudo_fallback(destination, backup_dir))
-		{
-			llwarns << "Failed to move directory: '"
-				<< destination << "' -> '" << backup_dir
-				<< llendl;
-			return FALSE;
-		}
-	}
-
-	// The package has been unpacked in a staging directory, now we just
-	// need to move it to its destination.
-	if (rename_with_sudo_fallback(tmp_dest_dir, destination))
-	{
-		llwarns << "Failed to move installation to the destination: "
-			<< destination
-			<< llendl;
-		return FALSE;
-	}
-
-	// \0/ Success!
-	return TRUE;
-}
-
-gboolean progress_update_timeout(gpointer data)
-{
-	UpdaterAppState *app_state;
-
-	llassert(data != NULL);
-
-	app_state = (UpdaterAppState *) data;
-
-	gdk_threads_enter();
-	if (app_state->activity_mode)
-	{
-		gtk_progress_bar_pulse
-			(GTK_PROGRESS_BAR(app_state->progress_bar));
-	}
-	else
-	{
-		gtk_progress_set_value(GTK_PROGRESS(app_state->progress_bar),
-				       app_state->progress_value);
-	}
-	gdk_threads_leave();
-
-	return TRUE;
-}
-
-gboolean update_progress_text_timeout(gpointer data)
-{
-	UpdaterAppState *app_state;
-
-	llassert(data != NULL);
-	app_state = (UpdaterAppState *) data;
-
-	if (app_state->activity_mode == TRUE)
-	{
-		// We no longer need this timeout, it will be removed.
-		return FALSE;
-	}
-
-	if (!app_state->progress_value)
-	{
-		return TRUE;
-	}
-
-	std::string progress_text = llformat((LLTrans::getString("UpdaterProgressBarText")+" (%.0f%%)").c_str(), app_state->progress_value);
-
-	gdk_threads_enter();
-	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
-				  progress_text.c_str());
-	gdk_threads_leave();
-
-	return TRUE;
-}
-
-int download_progress_cb(gpointer data,
-			 double t,
-			 double d,
-			 double utotal,
-			 double ulnow)
-{
-	UpdaterAppState *app_state;
-
-	llassert(data != NULL);
-	app_state = (UpdaterAppState *) data;
-
-	if (t <= 0.0)
-	{
-		app_state->progress_value = 0;
-	}
-	else
-	{
-		app_state->progress_value = d * 100.0 / t;
-	}
-	return 0;
-}
-
-BOOL spawn_viewer(UpdaterAppState *app_state)
-{
-	llassert(app_state != NULL);
-
-	std::string cmd = app_state->dest_dir + "/secondlife";
-	GError *error = NULL;
-
-	// We want to spawn the Viewer on the same display as the updater app
-	gboolean success = gdk_spawn_command_line_on_screen
-		(gtk_widget_get_screen(app_state->window), cmd.c_str(), &error);
-
-	if (!success)
-	{
-		llwarns << "Failed to launch viewer: " << error->message
-			<< llendl;
-	}
-
-	if (error) g_error_free(error);
-
-	return success;
-}
-
-void show_usage_and_exit()
-{
-	std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
-		  << "[--image-dir PATH]"
-		  << std::endl;
-	exit(1);
-}
-
-void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
-{
-	int i;
-
-	for (i = 1; i < argc; i++)
-	{
-		if ((!strcmp(argv[i], "--url")) && (++i < argc))
-		{
-			app_state->url = argv[i];
-		}
-		else if ((!strcmp(argv[i], "--file")) && (++i < argc))
-		{
-			app_state->file = argv[i];
-		}
-		else if ((!strcmp(argv[i], "--name")) && (++i < argc))
-		{
-			app_state->app_name = argv[i];
-		}
-		else if ((!strcmp(argv[i], "--image-dir")) && (++i < argc))
-		{
-			app_state->image_dir = argv[i];
-			app_state->image_dir_iter = new LLDirIterator(argv[i], "*.jpg");
-		}
-		else if ((!strcmp(argv[i], "--dest")) && (++i < argc))
-		{
-			app_state->dest_dir = argv[i];
-		}
-		else if ((!strcmp(argv[i], "--stringsdir")) && (++i < argc))
-		{
-			app_state->strings_dirs = argv[i];
-		}
-		else if ((!strcmp(argv[i], "--stringsfile")) && (++i < argc))
-		{
-			app_state->strings_file = argv[i];
-		}
-		else
-		{
-			// show usage, an invalid option was given.
-			show_usage_and_exit();
-		}
-	}
-
-	if (app_state->app_name.empty()
-	    || (app_state->url.empty() && app_state->file.empty())
-	    || app_state->dest_dir.empty())
-	{
-		show_usage_and_exit();
-	}
-
-	app_state->progress_value = 0.0;
-	app_state->activity_mode = FALSE;
-	app_state->failure = FALSE;
-
-	translate_init(app_state->strings_dirs, app_state->strings_file);
-}
-
-int main(int argc, char **argv)
-{
-	UpdaterAppState* app_state = new UpdaterAppState;
-	GThread *worker_thread;
-
-	parse_args_and_init(argc, argv, app_state);
-
-	// Initialize logger, and rename old log file
-	gDirUtilp->initAppDirs("SecondLife");
-	LLError::initForApplication
-		(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
-	std::string old_log_file = gDirUtilp->getExpandedFilename
-		(LL_PATH_LOGS, "updater.log.old");
-	std::string log_file =
-		gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
-	LLFile::rename(log_file, old_log_file);
-	LLError::logToFile(log_file);
-
-	// initialize gthreads and gtk+
-	if (!g_thread_supported())
-	{
-		g_thread_init(NULL);
-		gdk_threads_init();
-	}
-
-	gtk_init(&argc, &argv);
-
-	// create UI
-	updater_app_ui_init(app_state);
-
-	//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
-
-	// create download thread
-	worker_thread = g_thread_create
-		(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);
-
-	gdk_threads_enter();
-	gtk_main();
-	gdk_threads_leave();
-
-	// Delete the file only if created from url download.
-	if(!app_state->url.empty() && !app_state->file.empty())
-	{
-		if (gDirUtilp->fileExists(app_state->file))
-		{
-			LLFile::remove(app_state->file);
-		}
-	}
-
-	bool success = !app_state->failure;
-	delete app_state->image_dir_iter;
-	delete app_state;
-	return success ? 0 : 1;
-}
-
-/*****************************************************************************
-*   Dummy LLTrans implementation (IQA-490)
-*****************************************************************************/
-static LLTrans sStaticStrings;
-
-// lookup
-std::string LLTrans::_getString(const std::string& key) const
-{
-	MessageMap::const_iterator found = mMessages.find(key);
-	if (found != mMessages.end())
-	{
-		return found->second;
-	}
-	LL_WARNS("linux_updater") << "No message for key '" << key
-							  << "' -- add to LLTrans::LLTrans() in linux_updater.cpp"
-							  << LL_ENDL;
-	return key;
-}
-
-// static lookup
-std::string LLTrans::getString(const std::string& key)
-{
-    return sLLTransInstance._getString(key);
-}
-
-// initialization
-LLTrans::LLTrans()
-{
-	typedef std::pair<const char*, const char*> Pair;
-	static const Pair data[] =
-	{
-		Pair("UpdaterFailDownloadTitle",
-			 "Failed to download update"),
-		Pair("UpdaterFailInstallTitle",
-			 "Failed to install update"),
-		Pair("UpdaterFailStartTitle",
-			 "Failed to start viewer"),
-		Pair("UpdaterFailUpdateDescriptive",
-			 "An error occurred while updating Second Life. "
-			 "Please download the latest version from www.secondlife.com."),
-		Pair("UpdaterNowInstalling",
-			 "Installing Second Life..."),
-		Pair("UpdaterNowUpdating",
-			 "Now updating Second Life..."),
-		Pair("UpdaterProgressBarText",
-			 "Downloading update"),
-		Pair("UpdaterProgressBarTextWithEllipses",
-			 "Downloading update..."),
-		Pair("UpdaterUpdatingDescriptive",
-			 "Your Second Life Viewer is being updated to the latest release. "
-			 "This may take some time, so please be patient."),
-		Pair("UpdaterWindowTitle",
-			 "Second Life Update")
-	};
-
-	BOOST_FOREACH(Pair pair, data)
-	{
-		mMessages[pair.first] = pair.second;
-	}
-}
diff --git a/indra/llcharacter/llbvhconsts.h b/indra/llcharacter/llbvhconsts.h
index d363a6e595dafa2aa870dd59e51f824be099faf1..b06c279b8f8867071ee4db071a49b785212175bb 100644
--- a/indra/llcharacter/llbvhconsts.h
+++ b/indra/llcharacter/llbvhconsts.h
@@ -27,7 +27,7 @@
 #ifndef LL_LLBVHCONSTS_H
 #define LL_LLBVHCONSTS_H
 
-const F32 MAX_ANIM_DURATION = 30.f;
+const F32 MAX_ANIM_DURATION = 60.f;
 
 typedef enum e_constraint_type
 	{
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 5524bba2965be64e9df1b271b610bb07ac26dda6..d1c605451a38698cc44e50df57e26aa8e474e1d9 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -28,8 +28,8 @@
 // Header Files
 //-----------------------------------------------------------------------------
 #include "linden_common.h"
-#include "llmotioncontroller.h"
 
+#include "llmotioncontroller.h"
 #include "llfasttimer.h"
 #include "llkeyframemotion.h"
 #include "llmath.h"
@@ -43,6 +43,7 @@ const U32 MAX_MOTION_INSTANCES = 32;
 //-----------------------------------------------------------------------------
 // Constants and statics
 //-----------------------------------------------------------------------------
+F32 LLMotionController::sCurrentTimeFactor = 1.f;
 LLMotionRegistry LLMotionController::sRegistry;
 
 //-----------------------------------------------------------------------------
@@ -126,7 +127,7 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
 // Class Constructor
 //-----------------------------------------------------------------------------
 LLMotionController::LLMotionController()
-	: mTimeFactor(1.f),
+	: mTimeFactor(sCurrentTimeFactor),
 	  mCharacter(NULL),
 	  mAnimTime(0.f),
 	  mPrevTimerElapsed(0.f),
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index b996f708d2b94cdb8506f48f32f1f20e3810f61c..52eaf557b16c12898051fa05d557a9a5f17e9ba3 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -168,6 +168,9 @@ class LLMotionController
 
 	const LLFrameTimer& getFrameTimer() { return mTimer; }
 
+	static F32	getCurrentTimeFactor()				{ return sCurrentTimeFactor;	};
+	static void setCurrentTimeFactor(F32 factor)	{ sCurrentTimeFactor = factor;	};
+
 protected:
 	// internal operations act on motion instances directly
 	// as there can be duplicate motions per id during blending overlap
@@ -187,7 +190,8 @@ class LLMotionController
 	void deactivateStoppedMotions();
 
 protected:
-	F32					mTimeFactor;
+	F32					mTimeFactor;			// 1.f for normal speed
+	static F32			sCurrentTimeFactor;		// Value to use for initialization
 	static LLMotionRegistry	sRegistry;
 	LLPoseBlender		mPoseBlender;
 
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index 694e27f371c7d79a32d00054b2c3f3e8369ce5d3..281fb147810203bcb09f412bc5c3d23501c3056e 100644
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -89,6 +89,7 @@ class LLVisualParamInfo
 // An interface class for a generalized parametric modification of the avatar mesh
 // Contains data that is specific to each Avatar
 //-----------------------------------------------------------------------------
+LL_ALIGN_PREFIX(16)
 class LLVisualParam
 {
 public:
@@ -160,6 +161,6 @@ class LLVisualParam
 
 	S32					mID;				// id for storing weight/morphtarget compares compactly
 	LLVisualParamInfo	*mInfo;
-};
+} LL_ALIGN_POSTFIX(16);
 
 #endif // LL_LLVisualParam_H
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index 5baf049c038699b40f68b9a74691088dea77df80..fbffe133f12e93260982c1844bb1cb044dd438c6 100644
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -117,17 +117,17 @@ struct SortTimerByName
 };
 
 TimeBlock& TimeBlock::getRootTimeBlock()
-{
+	{
 	static TimeBlock root_timer("root", true, NULL);
 	return root_timer;
-}
+	}
 
 void TimeBlock::pushLog(LLSD log)
-{
+	{
 	LLMutexLock lock(sLogLock);
 
 	sLogQueue.push(log);
-}
+	}
 
 void TimeBlock::setLogLock(LLMutex* lock)
 {
@@ -149,7 +149,7 @@ U64 TimeBlock::countsPerSecond()
 	static LLUnit<LLUnits::Hertz, U64> sCPUClockFrequency = LLProcessorInfo().getCPUFrequency();
 
 #else
-	// If we're not using RDTSC, each fast timer tick is just a performance counter tick.
+	// If we're not using RDTSC, each fasttimer tick is just a performance counter tick.
 	// Not redefining the clock frequency itself (in llprocessor.cpp/calculate_cpu_frequency())
 	// since that would change displayed MHz stats for CPUs
 	static bool firstcall = true;
@@ -176,9 +176,9 @@ TimeBlockTreeNode& TimeBlock::getTreeNode() const
 	TimeBlockTreeNode* nodep = LLTrace::get_thread_recorder()->getTimeBlockTreeNode(getIndex());
 	llassert(nodep);
 	return *nodep;
-}
+	}
 
-// static
+//static
 void TimeBlock::processTimes()
 {
 	get_clock_count(); // good place to calculate clock frequency
@@ -191,9 +191,9 @@ void TimeBlock::processTimes()
 	{
 		TimeBlock& timer = *it;
 		if (&timer == &TimeBlock::getRootTimeBlock()) continue;
-
-		// bootstrap tree construction by attaching to last timer to be on stack
-		// when this timer was called
+			
+			// bootstrap tree construction by attaching to last timer to be on stack
+			// when this timer was called
 		if (timer.getParent() == &TimeBlock::getRootTimeBlock())
 		{
 			TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator();
@@ -203,7 +203,7 @@ void TimeBlock::processTimes()
 				timer.setParent(accumulator->mLastCaller);
 				accumulator->mParent = accumulator->mLastCaller;
 			}
-			// no need to push up tree on first use, flag can be set spuriously
+				// no need to push up tree on first use, flag can be set spuriously
 			accumulator->mMoveUpTree = false;
 		}
 	}
@@ -230,28 +230,28 @@ void TimeBlock::processTimes()
 			TimeBlockAccumulator* accumulator = timerp->getPrimaryAccumulator();
 
 			if (accumulator->mMoveUpTree)
-			{
+		{
 				// since ancestors have already been visited, re-parenting won't affect tree traversal
-				//step up tree, bringing our descendants with us
-				LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
-					" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
-				timerp->setParent(timerp->getParent()->getParent());
+			//step up tree, bringing our descendants with us
+			LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
+				" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
+			timerp->setParent(timerp->getParent()->getParent());
 				accumulator->mParent = timerp->getParent();
 				accumulator->mMoveUpTree = false;
 
-				// don't bubble up any ancestors until descendants are done bubbling up
+			// don't bubble up any ancestors until descendants are done bubbling up
 				// as ancestors may call this timer only on certain paths, so we want to resolve
 				// child-most block locations before their parents
-				it.skipAncestors();
-			}
+			it.skipAncestors();
 		}
 	}
+}
 
 	// walk up stack of active timers and accumulate current time while leaving timing structures active
 	BlockTimerStackRecord* stack_record			= ThreadTimerStack::getInstance();
 	BlockTimer* cur_timer						= stack_record->mActiveTimer;
 	TimeBlockAccumulator* accumulator = stack_record->mTimeBlock->getPrimaryAccumulator();
-	
+
 	// root defined by parent pointing to self
 	while(cur_timer && cur_timer->mParentTimerData.mActiveTimer != cur_timer)
 	{
@@ -286,12 +286,12 @@ void TimeBlock::processTimes()
 
 
 std::vector<TimeBlock*>::iterator TimeBlock::beginChildren()
-{ 
+		{
 	return getTreeNode().mChildren.begin(); 
-}
+		}
 
 std::vector<TimeBlock*>::iterator TimeBlock::endChildren()
-{
+		{
 	return getTreeNode().mChildren.end();
 }
 
@@ -300,7 +300,7 @@ std::vector<TimeBlock*>& TimeBlock::getChildren()
 	return getTreeNode().mChildren;
 }
 
-//static
+// static
 void TimeBlock::logStats()
 {
 	// get ready for next frame
@@ -331,7 +331,7 @@ void TimeBlock::logStats()
 				LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording();
 				sd[timer.getName()]["Time"] = (LLSD::Real) (frame_recording.getLastRecordingPeriod().getSum(timer).value());	
 				sd[timer.getName()]["Calls"] = (LLSD::Integer) (frame_recording.getLastRecordingPeriod().getSum(timer.callCount()));
-
+				
 				// computing total time here because getting the root timer's getCountHistory
 				// doesn't work correctly on the first frame
 				total_time += frame_recording.getLastRecordingPeriod().getSum(timer);
@@ -383,7 +383,7 @@ void TimeBlock::dumpCurTimes()
 	}
 }
 
-//static
+//static 
 void TimeBlock::writeLog(std::ostream& os)
 {
 	while (!sLogQueue.empty())
@@ -437,7 +437,7 @@ void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other )
 		mParent = other->mParent;
 	}
 	else
-	{
+{
 		mStartTotalTimeCounter = mTotalTimeCounter;
 	}
 }
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 502f93cbb8684b5c8af626487472e8c5044af559..3e18287a6f55fc091c2a862dab4edbde828ad456 100644
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -32,6 +32,7 @@
 #include <list>
 #include <boost/function.hpp>
 #include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_enum.hpp>
 #include <boost/unordered_map.hpp>
 
 #include "llerror.h"
@@ -210,7 +211,6 @@ namespace LLInitParam
 	class LL_COMMON_API Parser
 	{
 		LOG_CLASS(Parser);
-
 	public:
 		typedef std::vector<std::pair<std::string, bool> >					name_stack_t;
 		typedef std::pair<name_stack_t::iterator, name_stack_t::iterator>	name_stack_range_t;
@@ -224,32 +224,81 @@ namespace LLInitParam
 		typedef std::map<const std::type_info*, parser_write_func_t>	parser_write_func_map_t;
 		typedef std::map<const std::type_info*, parser_inspect_func_t>	parser_inspect_func_map_t;
 
+	private:
+		template<typename T, bool is_enum = boost::is_enum<T>::value>
+		struct ReaderWriter
+		{
+			static bool read(T& param, Parser* parser)
+			{
+				parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(T));
+				if (found_it != parser->mParserReadFuncs->end())
+				{
+					return found_it->second(*parser, (void*)&param);
+				}
+				return false;
+			}
+			
+			static bool write(const T& param, Parser* parser, name_stack_t& name_stack)
+			{
+				parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(T));
+				if (found_it != parser->mParserWriteFuncs->end())
+				{
+					return found_it->second(*parser, (const void*)&param, name_stack);
+				}
+				return false;
+			}
+		};
+
+		// read enums as ints
+		template<typename T>
+		struct ReaderWriter<T, true>
+		{
+			static bool read(T& param, Parser* parser)
+			{
+				// read all enums as ints
+				parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32));
+				if (found_it != parser->mParserReadFuncs->end())
+				{
+					S32 value;
+					if (found_it->second(*parser, (void*)&value))
+					{
+						param = (T)value;
+						return true;
+					}
+				}
+				return false;
+			}
+
+			static bool write(const T& param, Parser* parser, name_stack_t& name_stack)
+			{
+				parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(S32));
+				if (found_it != parser->mParserWriteFuncs->end())
+				{
+					return found_it->second(*parser, (const void*)&param, name_stack);
+				}
+				return false;
+			}
+		};
+
+	public:
+
 		Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
 		:	mParseSilently(false),
 			mParserReadFuncs(&read_map),
 			mParserWriteFuncs(&write_map),
 			mParserInspectFuncs(&inspect_map)
 		{}
+
 		virtual ~Parser();
 
 		template <typename T> bool readValue(T& param)
 	    {
-		    parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
-		    if (found_it != mParserReadFuncs->end())
-		    {
-			    return found_it->second(*this, (void*)&param);
-		    }
-		    return false;
+			return ReaderWriter<T>::read(param, this);
 	    }
 
 		template <typename T> bool writeValue(const T& param, name_stack_t& name_stack)
 		{
-		    parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T));
-		    if (found_it != mParserWriteFuncs->end())
-		    {
-			    return found_it->second(*this, (const void*)&param, name_stack);
-		    }
-		    return false;
+			return ReaderWriter<T>::write(param, this, name_stack);
 		}
 
 		// dispatch inspection to registered inspection functions, for each parameter in a param block
@@ -880,30 +929,24 @@ namespace LLInitParam
 			// no further names in stack, attempt to parse value now
 			if (name_stack_range.first == name_stack_range.second)
 			{
-				if (parser.readValue(typed_param.getValue()))
+				std::string name;
+
+				// try to parse a known named value
+				if(name_value_lookup_t::valueNamesExist()
+					&& parser.readValue(name)
+					&& name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
 				{
-					typed_param.clearValueName();
+					typed_param.setValueName(name);
 					typed_param.setProvided();
 					return true;
 				}
-				
-				// try to parse a known named value
-				if(name_value_lookup_t::valueNamesExist())
+				// try to read value directly
+				else if (parser.readValue(typed_param.getValue()))
 				{
-					// try to parse a known named value
-					std::string name;
-					if (parser.readValue(name))
-					{
-						// try to parse a per type named value
-						if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
-						{
-							typed_param.setValueName(name);
+					typed_param.clearValueName();
 							typed_param.setProvided();
 							return true;
 						}
-
-					}
-				}
 			}
 			return false;
 		}
@@ -1040,30 +1083,29 @@ namespace LLInitParam
 		static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
 		{ 
 			self_t& typed_param = static_cast<self_t&>(param);
-			// attempt to parse block...
-			if(typed_param.deserializeBlock(parser, name_stack_range, new_name))
+
+			if (name_stack_range.first == name_stack_range.second)
+			{	// try to parse a known named value
+				std::string name;
+
+				if(name_value_lookup_t::valueNamesExist()
+					&& parser.readValue(name)				
+					&& name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
 			{
-				typed_param.clearValueName();
+					typed_param.setValueName(name);
 				typed_param.setProvided();
 				return true;
 			}
+			}
 
-			if(name_value_lookup_t::valueNamesExist())
-			{
-				// try to parse a known named value
-				std::string name;
-				if (parser.readValue(name))
-				{
-					// try to parse a per type named value
-					if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
-					{
-						typed_param.setValueName(name);
+			if(typed_param.deserializeBlock(parser, name_stack_range, new_name))
+			{	// attempt to parse block...
+				typed_param.clearValueName();
 						typed_param.setProvided();
 						return true;
 					}
 
-				}
-			}
+
 			return false;
 		}
 
@@ -1228,30 +1270,22 @@ namespace LLInitParam
 			// no further names in stack, attempt to parse value now
 			if (new_name_stack_range.first == new_name_stack_range.second)
 			{
-				// attempt to read value directly
-				if (parser.readValue(value))
+				std::string name;
+				
+				// try to parse a known named value
+				if(name_value_lookup_t::valueNamesExist()
+					&& parser.readValue(name)
+					&& name_value_lookup_t::getValueFromName(name, value))
 				{
 					typed_param.add(value);
+					typed_param.mValues.back().setValueName(name);
 					return true;
 				}
-				
-				// try to parse a known named value
-				if(name_value_lookup_t::valueNamesExist())
-				{
-					// try to parse a known named value
-					std::string name;
-					if (parser.readValue(name))
-					{
-						// try to parse a per type named value
-						if (name_value_lookup_t::getValueFromName(name, value))
+				else if (parser.readValue(value)) 	// attempt to read value directly
 						{
 							typed_param.add(value);
-							typed_param.mValues.back().setValueName(name);
 							return true;
 						}
-
-					}
-				}
 			}
 			return false;
 		}
@@ -1475,9 +1509,15 @@ namespace LLInitParam
 
 			param_value_t& value = typed_param.mValues.back();
 
-			// attempt to parse block...
-			if(value.deserializeBlock(parser, new_name_stack_range, new_name))
+			if (new_name_stack_range.first == new_name_stack_range.second)
+			{	// try to parse a known named value
+				std::string name;
+
+				if(name_value_lookup_t::valueNamesExist()
+					&& parser.readValue(name)
+					&& name_value_lookup_t::getValueFromName(name, value.getValue()))
 			{
+					typed_param.mValues.back().setValueName(name);
 				typed_param.setProvided();
 				if (new_array_value)
 				{
@@ -1485,16 +1525,11 @@ namespace LLInitParam
 				}
 				return true;
 			}
-			else if(name_value_lookup_t::valueNamesExist())
-			{
-				// try to parse a known named value
-				std::string name;
-				if (parser.readValue(name))
-				{
-					// try to parse a per type named value
-					if (name_value_lookup_t::getValueFromName(name, value.getValue()))
+			}
+
+			// attempt to parse block...
+			if(value.deserializeBlock(parser, name_stack_range, new_name))
 					{
-						typed_param.mValues.back().setValueName(name);
 						typed_param.setProvided();
 						if (new_array_value)
 						{
@@ -1503,8 +1538,6 @@ namespace LLInitParam
 						return true;
 					}
 
-				}
-			}
 
 			if (new_value)
 			{	// failed to parse new value, pop it off
@@ -1547,7 +1580,7 @@ namespace LLInitParam
 				}
 
 				name_stack.pop_back();
-			}
+				}
 
 			if (!serialized && predicate_rule.check(ll_make_predicate(EMPTY)))
 			{
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index f06547ed7d46350e7f6b08774dfa5e6aaaf18d23..e7e274ff03520af9e31b98a495119f09ae97ed0b 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -158,7 +158,7 @@ void LLImageBase::sanityCheck()
 // virtual
 void LLImageBase::deleteData()
 {
-	FREE_MEM(sPrivatePoolp, mData);
+	FREE_MEM(sPrivatePoolp, mData) ;
 	memDisclaim(mDataSize);
 	mData = NULL;
 	mDataSize = 0;
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
old mode 100755
new mode 100644
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index a871bcbb25c3ced13be8e1b6ea70a53ba4220d3e..37c603348e3342a1ed9191e72cffcf47d125cc04 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -205,7 +205,7 @@ void LLParcel::init(const LLUUID &owner_id,
 	mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER);
 	mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER);
 
-	mLocalID = 0;
+	mLocalID = INVALID_PARCEL_ID;
 
 	//mSimWidePrimCorrection = 0;
 	setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS)));
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index 499f690e7609e79ab79d407e67d624de3e5d326c..0279e8bef970371595250a794c2bfc79bee03ded 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -97,6 +97,7 @@ const U32 RT_OTHER	= 0x1 << 3;
 const U32 RT_LIST	= 0x1 << 4;
 const U32 RT_SELL	= 0x1 << 5;
 
+const S32 INVALID_PARCEL_ID = -1;
 
 // Timeouts for parcels
 // default is 21 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 1814400000000
diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp
old mode 100755
new mode 100644
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 4ac1e55cfc79e278fea79b8ae93dc6b8b251dd25..7348904c6165d8f987aa34a116cfb24c8843c4d3 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -78,7 +78,7 @@ class LLOctreeNode : public LLTreeNode<T>
 
 	typedef LLOctreeTraveler<T>									oct_traveler;
 	typedef LLTreeTraveler<T>									tree_traveler;
-	typedef std::vector<LLPointer<T> >							element_list;
+	typedef std::vector< LLPointer<T> >							element_list;		// note:  don't remove the whitespace between "> >"
 	typedef LLPointer<T>*										element_iter;
 	typedef const LLPointer<T>*									const_element_iter;
 	typedef typename std::vector<LLTreeListener<T>*>::iterator	tree_listener_iter;
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp
index 9105b1c1fd26d9fc94acf35b28b01b8198c7d8bd..5ee3c45502b24809b2a98e0d0845ae67dc551cc7 100644
--- a/indra/llmath/tests/alignment_test.cpp
+++ b/indra/llmath/tests/alignment_test.cpp
@@ -79,7 +79,7 @@ template<> template<>
 void alignment_test_object_t::test<1>()
 {
 #   ifdef LL_DEBUG
-	skip("This test fails on Windows when compiled in debug mode.");
+//	skip("This test fails on Windows when compiled in debug mode.");
 #   endif
 	
 	const int num_tests = 7;
@@ -116,7 +116,7 @@ template<> template<>
 void alignment_test_object_t::test<3>()
 {
 #   ifdef LL_DEBUG
-	skip("This test fails on Windows when compiled in debug mode.");
+//	skip("This test fails on Windows when compiled in debug mode.");
 #   endif
 	
 	const int ARR_SIZE = 7;
@@ -128,12 +128,14 @@ void alignment_test_object_t::test<3>()
 	}
 
 	MyVector4a *veca = new MyVector4a[ARR_SIZE];
+	//std::cout << "veca base is " << (S32) veca << std::endl;
 	ensure("LLAligment veca base", is_aligned(veca,16));
 	for(int i=0; i<ARR_SIZE; i++)
 	{
 		std::cout << "veca[" << i << "]" << std::endl;
 		ensure("LLAlignment veca member unaligned", is_aligned(&veca[i],16));
 	}
+	delete [] veca; 
 }
 
 }
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 0e5fe1de0887861b7bd13e006ea393ab3f12f622..1264659b621957d6877389383e27a137bd239f4e 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -358,7 +358,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 			}
 		}
 
-		while(1)
+		bool keep_looping = true;
+		while(keep_looping)
 		{
 			CURLcode result;
 
@@ -409,8 +410,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 				case CURLE_FAILED_INIT:
 				case CURLE_COULDNT_CONNECT:
 					status = STATUS_NO_CONNECTION;
+					keep_looping = false;
 					break;
-				default:
+				default:			// CURLE_URL_MALFORMAT
 					llwarns << "URLRequest Error: " << result
 							<< ", "
 							<< LLCurl::strerror(result)
@@ -418,6 +420,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 							<< (mDetail->mURL.empty() ? "<EMPTY URL>" : mDetail->mURL)
 							<< llendl;
 					status = STATUS_ERROR;
+					keep_looping = false;
 					break;
 			}
 		}
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index b9cddc8e45434ba3f69583bcb055cf3f3ea3507d..00b9d81611b6d1dba65bbe6706d9b34b1207c47a 100644
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -886,8 +886,17 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
 				return;
 		}
 
-
-		std::string expanded_filename = gDirUtilp->getExpandedFilename( local_path, local_filename );
+		// If we want to use a special path (e.g. LL_PATH_CACHE), we want to make sure we create the
+		// proper expanded filename.
+		std::string expanded_filename;
+		if (local_path != LL_PATH_NONE)
+		{
+			expanded_filename = gDirUtilp->getExpandedFilename( local_path, local_filename );
+		}
+		else
+		{
+			expanded_filename = local_filename;
+		}
 		llinfos << "starting file transfer: " <<  expanded_filename << " to " << mesgsys->getSender() << llendl;
 
 		BOOL delete_local_on_completion = FALSE;
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
old mode 100755
new mode 100644
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
old mode 100755
new mode 100644
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
old mode 100755
new mode 100644
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 137c6efc5374effc08262ad4198e6fc9fcd0f49b..269cb4676a39e5ec70ed3601b0f4863e04c51706 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1116,6 +1116,11 @@ bool LLNotificationChannel::isEmpty() const
 	return mItems.empty();
 }
 
+S32 LLNotificationChannel::size() const
+{
+	return mItems.size();
+}
+
 LLNotificationChannel::Iterator LLNotificationChannel::begin()
 {
 	return mItems.begin();
@@ -1433,7 +1438,7 @@ bool LLNotifications::loadTemplates()
 	std::string base_filename = search_paths.front();
 	LLXMLNodePtr root;
 	BOOL success  = LLXMLNode::getLayeredXMLNode(root, search_paths);
-	
+
 	if (!success || root.isNull() || !root->hasName( "notifications" ))
 	{
 		llerrs << "Problem reading XML from UI Notifications file: " << base_filename << llendl;
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 4ae02b943fa415c691005db26ee61b753ab37ce4..d7534c416dccdccaff5314bc1258e31d34e62ca4 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -813,6 +813,7 @@ class LLNotificationChannel :
 	std::string getParentChannelName() { return mParent; }
     
     bool isEmpty() const;
+    S32 size() const;
     
     Iterator begin();
     Iterator end();
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 2297285c391aaaefbc267cc7c6672edb4380c194..13aa21b5051ee26703a877d9cae9f030240eaaf7 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -117,7 +117,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
 	mButtonEnterSignal(NULL),
 	mButtonLeaveSignal(NULL),
 	mButtonRemoveSignal(NULL),
-	mDragAndDropTarget(false)
+	mDragAndDropTarget(false),
+	mCaretIcon(NULL)
 {
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
@@ -830,7 +831,12 @@ void LLToolBar::draw()
 	LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
 
 	// Position the caret 
-	LLIconCtrl* caret = getChild<LLIconCtrl>("caret");
+	if (!mCaretIcon)
+	{
+		mCaretIcon = getChild<LLIconCtrl>("caret");
+	}
+
+	LLIconCtrl* caret = mCaretIcon;
 	caret->setVisible(FALSE);
 	if (mDragAndDropTarget && !mButtonCommands.empty())
 	{
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 2ffcc8b574cc972ccd6b63b4a5549403e1825cbf..6936cb37f79306c60e256e64685f4e8d179bc0ae 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -37,6 +37,7 @@
 
 class LLToolBar;
 class LLToolBarButton;
+class LLIconCtrl;
 
 typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
 typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
@@ -284,6 +285,8 @@ class LLToolBar
 	button_signal_t*				mButtonRemoveSignal;
 
 	std::string						mButtonTooltipSuffix;
+
+	LLIconCtrl*						mCaretIcon; 
 };
 
 
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 5b7424acbb69dcf2762f78236ef68e96342c1e87..93b9d36939002d60729f52e7a1c5ddf4b284d34f 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -50,14 +50,15 @@ LLSplashScreen *gSplashScreenp = NULL;
 BOOL gDebugClicks = FALSE;
 BOOL gDebugWindowProc = FALSE;
 
-const S32 gURLProtocolWhitelistCount = 3;
-const std::string gURLProtocolWhitelist[] = { "file:", "http:", "https:" };
+const S32 gURLProtocolWhitelistCount = 4;
+const std::string gURLProtocolWhitelist[] = { "secondlife:", "http:", "https:", "data:" };
 
 // CP: added a handler list - this is what's used to open the protocol and is based on registry entry
 //	   only meaningful difference currently is that file: protocols are opened using http:
 //	   since no protocol handler exists in registry for file:
 //     Important - these lists should match - protocol to handler
-const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" };	
+// Maestro: This list isn't referenced anywhere that I could find
+//const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" };	
 
 
 S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index f378203a88e9a7077d5de8c9f2789b4d68135810..c235d77656d5ec74d8e2a3df4bdb7b3462ee5687 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -281,7 +281,7 @@ extern BOOL gDebugWindowProc;
 // Protocols, like "http" and "https" we support in URLs
 extern const S32 gURLProtocolWhitelistCount;
 extern const std::string gURLProtocolWhitelist[];
-extern const std::string gURLProtocolWhitelistHandler[];
+//extern const std::string gURLProtocolWhitelistHandler[];
 
 void simpleEscapeString ( std::string& stringIn  );
 
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 39f8a36a6e24dedf0624aae60e9ab589dfbf87d1..a15114cb9bc77a2fc62b2ba7be838d93e9c984a0 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -2516,6 +2516,23 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
 // Must begin with protocol identifier.
 void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
 {
+	bool found = false;
+	S32 i;
+	for (i = 0; i < gURLProtocolWhitelistCount; i++)
+	{
+		if (escaped_url.find(gURLProtocolWhitelist[i]) != std::string::npos)
+		{
+			found = true;
+			break;
+		}
+	}
+
+	if (!found)
+	{
+		llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
+		return;
+	}
+
 	llinfos << "spawn_web_browser: " << escaped_url << llendl;
 	
 #if LL_LINUX || LL_SOLARIS
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index 9a3a40e476f0395e481e5d5b295c18183c167823..ee7d1d50b7e1de8cb81e372330c9de128fda49ec 100644
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -254,6 +254,7 @@ class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
 		else
 		{
 			llwarns << "Control " << name << " not found." << llendl;
+			return T();
 		}
 		return convert_from_llsd<T>(value, type, name);
 	}
diff --git a/indra/media_plugins/webkit/windows_volume_catcher.cpp b/indra/media_plugins/webkit/windows_volume_catcher.cpp
index 5fb84756eed5720470d5a38c22ef3ef1811a3252..0cfb810906b578e4ae3466b32ca0a8c808dd9132 100644
--- a/indra/media_plugins/webkit/windows_volume_catcher.cpp
+++ b/indra/media_plugins/webkit/windows_volume_catcher.cpp
@@ -48,18 +48,37 @@ friend LLSingleton<VolumeCatcherImpl>;
 	set_volume_func_t mSetVolumeFunc;
 	set_mute_func_t mSetMuteFunc;
 
+	// tests if running on Vista, 7, 8 + once in CTOR
+	bool isWindowsVistaOrHigher();
+
 	F32 	mVolume;
 	F32 	mPan;
+	bool mSystemIsVistaOrHigher;
 };
+
+bool VolumeCatcherImpl::isWindowsVistaOrHigher()
+{
+	OSVERSIONINFO osvi;
+	ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+	GetVersionEx(&osvi);
+	return osvi.dwMajorVersion >= 6;
+}
+
 VolumeCatcherImpl::VolumeCatcherImpl()
-:	mVolume(1.0f),	// default volume is max
-	mPan(0.f)		// default pan is centered
+:	mVolume(1.0f),			// default volume is max
+	mPan(0.f)				// default pan is centered
 {
-	HMODULE handle = ::LoadLibrary(L"winmm.dll");
-	if(handle)
+	mSystemIsVistaOrHigher = isWindowsVistaOrHigher();
+
+	if ( ! mSystemIsVistaOrHigher )
 	{
-		mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
-		mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
+		HMODULE handle = ::LoadLibrary(L"winmm.dll");
+		if(handle)
+		{
+			mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
+			mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
+		}
 	}
 }
 
@@ -67,18 +86,29 @@ VolumeCatcherImpl::~VolumeCatcherImpl()
 {
 }
 
-
 void VolumeCatcherImpl::setVolume(F32 volume)
 {
 	mVolume = volume;
 
-	if (mSetMuteFunc)
+	if ( mSystemIsVistaOrHigher )
 	{
-		mSetMuteFunc(volume == 0.f);
+		// set both left/right to same volume
+		// TODO: use pan value to set independently
+		DWORD left_channel  = (DWORD)(mVolume * 65535.0f);
+		DWORD right_channel =  (DWORD)(mVolume * 65535.0f);
+		DWORD hw_volume = left_channel << 16 | right_channel;
+		::waveOutSetVolume(NULL, hw_volume);
 	}
-	if (mSetVolumeFunc)
+	else
 	{
-		mSetVolumeFunc(mVolume);
+		if (mSetMuteFunc)
+		{
+			mSetMuteFunc(volume == 0.f);
+		}
+		if (mSetVolumeFunc)
+		{
+			mSetVolumeFunc(mVolume);
+		}
 	}
 }
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
old mode 100755
new mode 100644
index 575400941f0928fb473646ec720c33d0d62fe0a5..718a8c710febd303926c6bf07fa55639ac44eb37
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -35,6 +35,7 @@ include(LLXML)
 include(LScript)
 include(Linking)
 include(NDOF)
+include(NVAPI)
 include(GooglePerfTools)
 include(TemplateCheck)
 include(UI)
@@ -1821,6 +1822,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${LLCOREHTTP_LIBRARIES}
     ${LLCOMMON_LIBRARIES}
     ${NDOF_LIBRARY}
+    ${NVAPI_LIBRARY}
     ${HUNSPELL_LIBRARY}
     ${viewer_LIBRARIES}
     ${BOOST_PROGRAM_OPTIONS_LIBRARY}
@@ -1869,7 +1871,6 @@ if (LINUX)
   set(COPY_INPUT_DEPENDENCIES
     ${VIEWER_BINARY_NAME}
     linux-crash-logger
-    linux-updater
     SLPlugin
     media_plugin_webkit
     media_plugin_gstreamer010
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
old mode 100755
new mode 100644
index 5c0e8d858e2dce771a00049a0f34636b6bc8a476..94a85509384bcffad7fcf4294394a2f3a30eec1a
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -14094,6 +14094,18 @@
       </array>
     </map>
 
+    <key>HideUIControls</key>
+    <map>
+      <key>Comment</key>
+      <string>Hide all menu items and buttons</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+
   <key>SimulateFBOFailure</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl
new file mode 100644
index 0000000000000000000000000000000000000000..284da3d0ac0e351c9feaf997d12fd38f77d7a21b
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl
@@ -0,0 +1,41 @@
+/** 
+ * @file previewF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor
+#endif
+
+uniform sampler2D diffuseMap;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void main()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+	frag_color = color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 5dcfa87066fc95e4ec36e254e007c6f93f9655ce..7f3f84398b102ab07dd68c2106a67fc2a9509408 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -32,12 +32,51 @@ ATTRIBUTE vec3 position;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
 
+uniform vec4 color;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
+//===================================================================================================
+//declare these here explicitly to separate them from atmospheric lighting elsewhere to work around
+//drivers that are picky about functions being declared but not defined even if they aren't called
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+	float a = max(dot(n,l),0.0);
+	return a;
+}
+
+
+float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight)
+{
+	//get light vector
+	vec3 lv = lp.xyz-v;
+	
+	//get distance
+	float d = length(lv);
+	
+	//normalize light vector
+	lv *= 1.0/d;
+	
+	//distance attenuation
+	float da = clamp(1.0/(la * d), 0.0, 1.0);
+	
+	// spotlight coefficient.
+	float spot = max(dot(-ln, lv), is_pointlight);
+	da *= spot*spot; // GL_SPOT_EXPONENT=2
+
+	//angular attenuation
+	da *= calcDirectionalLight(n, lv);
+
+	return da;	
+}
+//====================================================================================================
 
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-void calcAtmospherics(vec3 inPositionEye);
 
 void main()
 {
@@ -45,13 +84,15 @@ void main()
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-		
+	
 	vec3 norm = normalize(normal_matrix * normal);
 
-	calcAtmospherics(pos.xyz);
-
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
-	vertex_color = color;
+	vec4 col = vec4(0,0,0,1);
 
-	
+	// Collect normal lights (need to be divided by two, as we later multiply by 2)
+	col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
+		
+	vertex_color = col*color;
 }
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 66484314592fb722c2edcc0018fb0f3ff36b7f1d..420220d21a2601a28a1e46a98289e41996caedad 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -35,6 +35,7 @@
 #include "llfloaterreg.h"
 #include "llhudmanager.h"
 #include "lljoystickbutton.h"
+#include "llmoveview.h"
 #include "llselectmgr.h"
 #include "llsmoothstep.h"
 #include "lltoolmgr.h"
@@ -2114,6 +2115,11 @@ void LLAgentCamera::changeCameraToDefault()
 	{
 		changeCameraToThirdPerson();
 	}
+	if (gSavedSettings.getBOOL("HideUIControls"))
+	{
+		gViewerWindow->setUIVisibility(false);
+		LLPanelStandStopFlying::getInstance()->setVisible(false);
+	}
 }
 
 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index dc07c8f13bcab96108b8ede81f984a04b5791e05..6b50c62ea64f6b85257c45bc8d6086eec867be87 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -735,10 +735,6 @@ bool LLAppViewer::init()
 	// before consumers (LLTextureFetch).
 	mAppCoreHttp.init();
 	
-#if LL_RECORD_VIEWER_STATS
-	LLViewerStatsRecorder::initClass();
-#endif
-
     // *NOTE:Mani - LLCurl::initClass is not thread safe. 
     // Called before threads are created.
     LLCurl::initClass(gSavedSettings.getF32("CurlRequestTimeOut"), 
@@ -1034,12 +1030,21 @@ bool LLAppViewer::init()
 	}
 
 #if LL_WINDOWS
-	if (gGLManager.mIsIntel && 
-		LLFeatureManager::getInstance()->getGPUClass() > 0 &&
-		gGLManager.mGLVersion <= 3.f)
+	if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion())
+	{
+		if (gGLManager.mIsIntel)
 	{
 		LLNotificationsUtil::add("IntelOldDriver");
 	}
+		else if (gGLManager.mIsNVIDIA)
+		{
+			LLNotificationsUtil::add("NVIDIAOldDriver");
+		}
+		else if (gGLManager.mIsATI)
+		{
+			LLNotificationsUtil::add("AMDOldDriver");
+		}
+	}
 #endif
 
 
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 06c06c4af26af83a0e9cbfaacdfe6fb2e3ee37df..627652dc308b2ddbdd05de4224b2e7992babe1dc 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -179,7 +179,7 @@ class LLAppViewer : public LLApp
 	// Metrics policy helper statics.
 	static void metricsUpdateRegion(U64 region_handle);
 	static void metricsSend(bool enable_reporting);
-	
+
 	// llcorehttp init/shutdown/config information.
 	LLAppCoreHttp & getAppCoreHttp()			{ return mAppCoreHttp; }
 	
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index b70c81e84dd16eef563cb7e33efbdecf9afc9797..8326be433e9db7ebf519b38e30cf6141c7d0f020 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -46,6 +46,11 @@
 #include "llviewercontrol.h"
 #include "lldxhardware.h"
 
+#include "nvapi/nvapi.h"
+#include "nvapi/NvApiDriverSettings.h"
+
+#include <stdlib.h>
+
 #include "llweb.h"
 #include "llsecondlifeurls.h"
 
@@ -60,6 +65,7 @@
 #include "llwindebug.h"
 #endif
 
+
 // *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib
 // The lib was compiled under VS2005 - in VS2003 we need to remap assert
 #ifdef LL_DEBUG
@@ -75,6 +81,20 @@ extern "C" {
 
 const std::string LLAppViewerWin32::sWindowClass = "Second Life";
 
+/*
+    This function is used to print to the command line a text message 
+    describing the nvapi error and quits
+*/
+void nvapi_error(NvAPI_Status status)
+{
+    NvAPI_ShortString szDesc = {0};
+	NvAPI_GetErrorMessage(status, szDesc);
+	llwarns << szDesc << llendl;
+
+	//should always trigger when asserts are enabled
+	llassert(status == NVAPI_OK);
+}
+
 // Create app mutex creates a unique global windows object. 
 // If the object can be created it returns true, otherwise
 // it returns false. The false result can be used to determine 
@@ -96,6 +116,79 @@ bool create_app_mutex()
 	return result;
 }
 
+void ll_nvapi_init(NvDRSSessionHandle hSession)
+{
+	// (2) load all the system settings into the session
+	NvAPI_Status status = NvAPI_DRS_LoadSettings(hSession);
+	if (status != NVAPI_OK) 
+	{
+		nvapi_error(status);
+		return;
+	}
+
+	NvAPI_UnicodeString profile_name;
+	std::string app_name = LLTrans::getString("APP_NAME");
+	llutf16string w_app_name = utf8str_to_utf16str(app_name);
+	wsprintf(profile_name, L"%s", w_app_name.c_str());
+	status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
+	if (status != NVAPI_OK)
+	{
+		nvapi_error(status);
+		return;
+	}
+
+	// (3) Obtain the current profile. 
+	NvDRSProfileHandle hProfile = 0;
+	status = NvAPI_DRS_GetCurrentGlobalProfile(hSession, &hProfile);
+	if (status != NVAPI_OK) 
+	{
+		nvapi_error(status);
+		return;
+	}
+
+	// load settings for querying 
+	status = NvAPI_DRS_LoadSettings(hSession);
+	if (status != NVAPI_OK)
+	{
+		nvapi_error(status);
+		return;
+	}
+
+	//get the preferred power management mode for Second Life
+	NVDRS_SETTING drsSetting = {0};
+	drsSetting.version = NVDRS_SETTING_VER;
+	status = NvAPI_DRS_GetSetting(hSession, hProfile, PREFERRED_PSTATE_ID, &drsSetting);
+	if (status == NVAPI_SETTING_NOT_FOUND)
+	{ //only override if the user hasn't specifically set this setting
+		// (4) Specify that we want the VSYNC disabled setting
+		// first we fill the NVDRS_SETTING struct, then we call the function
+		drsSetting.version = NVDRS_SETTING_VER;
+		drsSetting.settingId = PREFERRED_PSTATE_ID;
+		drsSetting.settingType = NVDRS_DWORD_TYPE;
+		drsSetting.u32CurrentValue = PREFERRED_PSTATE_PREFER_MAX;
+		status = NvAPI_DRS_SetSetting(hSession, hProfile, &drsSetting);
+		if (status != NVAPI_OK) 
+		{
+			nvapi_error(status);
+			return;
+		}
+	}
+	else if (status != NVAPI_OK)
+	{
+		nvapi_error(status);
+		return;
+	}
+
+	
+
+	// (5) Now we apply (or save) our changes to the system
+	status = NvAPI_DRS_SaveSettings(hSession);
+	if (status != NVAPI_OK) 
+	{
+		nvapi_error(status);
+	}
+}
+
 //#define DEBUGGING_SEH_FILTER 1
 #if DEBUGGING_SEH_FILTER
 #	define WINMAIN DebuggingWinMain
@@ -165,6 +258,27 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 		return -1;
 	}
 	
+	NvAPI_Status status;
+    
+	// Initialize NVAPI
+	status = NvAPI_Initialize();
+	NvDRSSessionHandle hSession = 0;
+
+    if (status == NVAPI_OK) 
+	{
+		// Create the session handle to access driver settings
+		status = NvAPI_DRS_CreateSession(&hSession);
+		if (status != NVAPI_OK) 
+		{
+			nvapi_error(status);
+		}
+		else
+		{
+			//override driver setting as needed
+			ll_nvapi_init(hSession);
+		}
+	}
+
 	// Have to wait until after logging is initialized to display LFH info
 	if (num_heaps > 0)
 	{
@@ -232,6 +346,15 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 		LLAppViewer::sUpdaterInfo = NULL ;
 	}
 
+
+
+	// (NVAPI) (6) We clean up. This is analogous to doing a free()
+	if (hSession)
+	{
+		NvAPI_DRS_DestroySession(hSession);
+		hSession = 0;
+	}
+	
 	return 0;
 }
 
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 84e73e96fa01213c6405d11859c31f4d5deada34..3e1fa1e49be0d66241cac49db41e7e3a41e83868 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -110,7 +110,9 @@ class LLChatHistoryHeader: public LLPanel
 		mFrom(),
 		mSessionID(),
 		mMinUserNameWidth(0),
-		mUserNameFont(NULL)
+		mUserNameFont(NULL),
+		mUserNameTextBox(NULL),
+		mTimeBoxTextBox(NULL)
 	{}
 
 	static LLChatHistoryHeader* createInstance(const std::string& file_name)
@@ -187,6 +189,9 @@ class LLChatHistoryHeader: public LLPanel
 		setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this));
 		setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this));
 
+		mUserNameTextBox = getChild<LLTextBox>("user_name");
+		mTimeBoxTextBox = getChild<LLTextBox>("time_box");
+
 		return LLPanel::postBuild();
 	}
 
@@ -377,8 +382,8 @@ class LLChatHistoryHeader: public LLPanel
 
 	/*virtual*/ void draw()
 	{
-		LLTextBox* user_name = getChild<LLTextBox>("user_name");
-		LLTextBox* time_box = getChild<LLTextBox>("time_box");
+		LLTextBox* user_name = mUserNameTextBox; //getChild<LLTextBox>("user_name");
+		LLTextBox* time_box = mTimeBoxTextBox; //getChild<LLTextBox>("time_box");
 
 		LLRect user_name_rect = user_name->getRect();
 		S32 user_name_width = user_name_rect.getWidth();
@@ -568,6 +573,8 @@ class LLChatHistoryHeader: public LLPanel
 
 	S32					mMinUserNameWidth;
 	const LLFontGL*		mUserNameFont;
+	LLTextBox*			mUserNameTextBox;
+	LLTextBox*			mTimeBoxTextBox; 
 };
 
 LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL;
diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp
index 86f0213282b33fdcadf4eeb0f5d40c6bec3296d6..1264f05d770090b252984bfc0f81c4cd3ddfeba4 100644
--- a/indra/newview/lldebugview.cpp
+++ b/indra/newview/lldebugview.cpp
@@ -99,7 +99,7 @@ void LLDebugView::init()
 	gSceneView->setVisible(FALSE);
 	addChild(gSceneView);
 	gSceneView->setRect(rect);
-
+	
 	gSceneMonitorView = new LLSceneMonitorView(r);
 	gSceneMonitorView->setFollowsTop();
 	gSceneMonitorView->setFollowsLeft();
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index a0c71b0f7367fbe398660cda78adc83a49e20871..4d72dd1343507a9311f4d2444e6c70beaca675ac 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -103,11 +103,11 @@ void LLDrawable::init(bool new_entry)
 	mParent = NULL;
 	mRenderType = 0;
 	mCurrentScale = LLVector3(1,1,1);
-	mDistanceWRTCamera = 0.0f;	
+	mDistanceWRTCamera = 0.0f;
 	mState     = 0;
-	
-	// mFaces	
-	mRadius = 0.f;	
+
+	// mFaces
+	mRadius = 0.f;
 	mGeneration = -1;	
 	mSpatialBridge = NULL;
 
@@ -132,7 +132,7 @@ void LLDrawable::init(bool new_entry)
 		{
 			getRegion()->addVisibleCacheEntry(vo_entry); //to load all children.
 		}
-
+	
 		getRegion()->addActiveCacheEntry(vo_entry);		
 	}
 
@@ -192,7 +192,7 @@ void LLDrawable::markDead()
 
 	sNumZombieDrawables++;
 
-	// We're dead.  Free up all of our references to other objects	
+	// We're dead.  Free up all of our references to other objects
 	cleanupReferences();
 //	sDeadList.put(this);
 }
@@ -298,9 +298,17 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep)
 	return count;
 }
 
+static LLFastTimer::DeclareTimer FTM_ALLOCATE_FACE("Allocate Face", true);
+
 LLFace*	LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
 {
-	LLFace *face = new LLFace(this, mVObjp);
+	
+	LLFace *face;
+	{
+		LLFastTimer t(FTM_ALLOCATE_FACE);
+		face = new LLFace(this, mVObjp);
+	}
+
 	if (!face) llerrs << "Allocating new Face: " << mFaces.size() << llendl;
 	
 	if (face)
@@ -323,7 +331,11 @@ LLFace*	LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
 LLFace*	LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
 {
 	LLFace *face;
+	
+	{
+		LLFastTimer t(FTM_ALLOCATE_FACE);
 	face = new LLFace(this, mVObjp);
+	}
 
 	face->setTEOffset(mFaces.size());
 	face->setTexture(texturep);
@@ -477,7 +489,7 @@ void LLDrawable::makeActive()
 		//NOTE: linked set will now NEVER become static
 		mParent->setState(LLDrawable::ACTIVE_CHILD);
 	}
-	
+
 	llassert(isAvatar() || isRoot() || mParent->isActive());
 }
 
@@ -562,6 +574,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
 		dist_squared = dist_vec_squared(new_pos, target_pos);
 
 		LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot);
+		// FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes.
 		dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f;
 
 		LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt);
@@ -585,6 +598,15 @@ F32 LLDrawable::updateXform(BOOL undamped)
 			}
 		}
 	}
+	else
+	{
+		// The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275
+		// dist_squared = dist_vec_squared(old_pos, target_pos);
+
+		// The following fixes MAINT-2247 but causes MAINT-2275
+		//dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f;
+		//dist_squared += dist_vec_squared(old_scale, target_scale);
+	}
 
 	LLVector3 vec = mCurrentScale-target_scale;
 	
@@ -670,7 +692,7 @@ BOOL LLDrawable::updateMove()
 	{
 		return FALSE;
 	}
-	
+
 	makeActive();
 
 	BOOL done;
@@ -972,11 +994,11 @@ void LLDrawable::updateUVMinMax()
 bool LLDrawable::isVisible() const
 {
 	if (LLViewerOctreeEntryData::isVisible())
-	{
+{ 
 		return true;
-	}
-	
-	{
+}
+
+{
 		LLviewerOctreeGroup* group = mEntry->getGroup();
 		if (group && group->isVisible())
 		{
@@ -1008,7 +1030,7 @@ bool LLDrawable::isRecentlyVisible() const
 }
 
 void LLDrawable::setGroup(LLviewerOctreeGroup *groupp)
-{
+	{
 	LLSpatialGroup* cur_groupp = (LLSpatialGroup*)getGroup();
     
 	//precondition: mGroupp MUST be null or DEAD or mGroupp MUST NOT contain this
@@ -1081,7 +1103,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
 //virtual
 S32 LLDrawable::getMinVisFrameRange() const
 {
-	const S32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one.
+const S32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one.
 
 	return MIN_VIS_FRAME_RANGE ;
 }
@@ -1120,11 +1142,11 @@ LLSpatialBridge::~LLSpatialBridge()
 {	
 	if(mEntry)
 	{
-		LLSpatialGroup* group = getSpatialGroup();
-		if (group)
-		{
-			group->mSpatialPartition->remove(this, group);
-		}
+	LLSpatialGroup* group = getSpatialGroup();
+	if (group)
+	{
+		group->mSpatialPartition->remove(this, group);
+	}
 	}
 
 	//delete octree here so listeners will still be able to access bridge specific state
@@ -1184,7 +1206,7 @@ void LLSpatialBridge::updateSpatialExtents()
 
 	LLVector4a newMin;
 	LLVector4a newMax;	
-	newMin = newMax = center;	
+	newMin = newMax = center;
 	for (U32 i = 0; i < 4; i++)
 	{
 		LLVector4a delta;
@@ -1198,7 +1220,7 @@ void LLSpatialBridge::updateSpatialExtents()
 		newMax.setMax(newMax, max);
 	}
 	setSpatialExtents(newMin, newMax);
-
+	
 	LLVector4a diagonal;
 	diagonal.setSub(newMax, newMin);
 	mRadius = diagonal.getLength3().getF32() * 0.5f;
@@ -1405,7 +1427,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
 		markDead();
 		return;
 	}
-	
+
 	if (gShiftFrame)
 	{
 		return;
@@ -1487,7 +1509,7 @@ void LLSpatialBridge::cleanupReferences()
 	if (mDrawable)
 	{
 		mDrawable->setGroup(NULL);
-		
+
 		if (mDrawable->getVObj())
 		{
 			LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1500,8 +1522,8 @@ void LLSpatialBridge::cleanupReferences()
 				{
 					drawable->setGroup(NULL);				
 				}
+				}
 			}
-		}
 
 		LLDrawable* drawablep = mDrawable;
 		mDrawable = NULL;
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index 3691bbf71b57ef67df9d30d9715e8086bcb459e1..26796b92d030ca70342e9353c107251b7abb427f 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -297,18 +297,18 @@ class LLDrawable
 private:
 	typedef std::vector<LLFace*> face_list_t;
 	
-	U32							mState;
-	S32							mRenderType;
-	LLPointer<LLViewerObject>	mVObjp;
-	face_list_t					mFaces;
-	LLPointer<LLDrawable>		mSpatialBridge;
+	U32				mState;
+	S32				mRenderType;
+	LLPointer<LLViewerObject> mVObjp;
+	face_list_t     mFaces;
+	LLPointer<LLDrawable> mSpatialBridge;
 	
-	F32							mRadius;
-	S32							mGeneration;
-
-	LLVector3					mCurrentScale;
+	F32				mRadius;
+	S32				mGeneration;
+	
+	LLVector3		mCurrentScale;
 	
-	static U32					sNumZombieDrawables;
+	static U32 sNumZombieDrawables;
 	static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList;
 } LL_ALIGN_POSTFIX(16);
 
diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h
index c0976d1d43e534d81d213fd3d021b555b17d8517..216cf003e1105a2efb69920ab60947d4a168afa2 100644
--- a/indra/newview/lldriverparam.h
+++ b/indra/newview/lldriverparam.h
@@ -75,6 +75,7 @@ class LLDriverParamInfo : public LLViewerVisualParamInfo
 
 //-----------------------------------------------------------------------------
 
+LL_ALIGN_PREFIX(16)
 class LLDriverParam : public LLViewerVisualParam
 {
 	friend class LLPhysicsMotion; // physics motion needs to access driven params directly.
@@ -126,13 +127,13 @@ class LLDriverParam : public LLViewerVisualParam
 	void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
 
 
-	LLVector4a	mDefaultVec; // temp holder
+	LL_ALIGN_16(LLVector4a	mDefaultVec); // temp holder
 	typedef std::vector<LLDrivenEntry> entry_list_t;
 	entry_list_t mDriven;
 	LLViewerVisualParam* mCurrentDistortionParam;
 	// Backlink only; don't make this an LLPointer.
 	LLVOAvatar* mAvatarp;
 	LLWearable* mWearablep;
-};
+} LL_ALIGN_POSTFIX(16);
 
 #endif  // LL_LLDRIVERPARAM_H
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
old mode 100755
new mode 100644
index 0b3bc2b19a4a1e5367051574395b7fd6506fceea..28e4b3279303bb8771db59d5b66100a744e6d52b
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -166,7 +166,7 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
 
 	//special value to indicate uninitialized position
 	mIndicesIndex	= 0xFFFFFFFF;
-
+	
 	mIndexInTex = 0;
 	mTexture		= NULL;
 	mTEOffset		= -1;
@@ -1058,7 +1058,7 @@ bool LLFace::canRenderAsMask()
 	{
 		return false;
 	}
-
+	
 	if ((te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha
 		(te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask
 		getTexture()->getIsAlphaMask()) // texture actually qualifies for masking (lazily recalculated but expensive)
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 6caa89a611c0cc893db7c0c2e59947562391d9c8..80d845c70ea2a1bf6f31c42baf048bffaf3b1cab 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -394,13 +394,13 @@ static std::map<TimeBlock*, LLColor4> sTimerColors;
 void LLFastTimerView::draw()
 {
 	LLFastTimer t(FTM_RENDER_TIMER);
-
+	
 	generateUniqueColors();
 
 	// Draw the window background
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	gl_rect_2d(getLocalRect(), LLColor4(0.f, 0.f, 0.f, 0.25f));
-
+	
 	S32 y = drawHelp(getRect().getHeight() - MARGIN);
 	drawLegend(y - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 2));
 
diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h
index f9ceb4423b3b591b2ddcef3960c18f7f8cb9a1a2..8b9ad290bce6cc88cfa75d435bfbe5191e9ab7ca 100644
--- a/indra/newview/llfasttimerview.h
+++ b/indra/newview/llfasttimerview.h
@@ -113,20 +113,20 @@ class LLFastTimerView : public LLFloater
 		ALIGN_COUNT
 	} ChildAlignment;
 
-	ChildAlignment                mDisplayCenter;
+	ChildAlignment mDisplayCenter;
 	bool                          mDisplayCalls,
 								  mDisplayHz;
 	LLUnit<LLUnits::Seconds, F64> mAllTimeMax,
 								  mTotalTimeDisplay;
-	LLRect                        mBarRect;
-	S32						      mScrollIndex;
+	LLRect mBarRect;
+	S32	mScrollIndex;
 	LLTrace::TimeBlock*           mHoverID;
 	LLTrace::TimeBlock*           mHoverTimer;
-	LLRect						  mToolTipRect;
-	S32                           mHoverBarIndex;
-	LLFrameTimer                  mHighlightTimer;
-	S32                           mPrintStats;
-	LLRect                        mGraphRect;
+	LLRect					mToolTipRect;
+	S32 mHoverBarIndex;
+	LLFrameTimer mHighlightTimer;
+	S32 mPrintStats;
+	LLRect mGraphRect;
 	LLTrace::PeriodicRecording*	  mRecording;
 	bool						  mPauseHistory;
 };
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 2b39b771e7174f09170dc1618b8bdf25d8b4ca2a..a4cadcd5dcf1b18f11f9558813510ad00071c5ed 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -479,6 +479,7 @@ void LLFeatureManager::parseGPUTable(std::string filename)
 			mGPUString = label;
 			mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10);
 			mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10);
+			sscanf(expected_gl_version.c_str(), "%f", &mExpectedGLVersion);
 		}
 	}
 #if LL_EXPORT_GPU_TABLE
diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h
index 6f9d2e49c6b31dc3ffd4d6dfb6e5dd1eb12ff22d..ad72c167432e838d6adeb55ac0701efb5905e57d 100644
--- a/indra/newview/llfeaturemanager.h
+++ b/indra/newview/llfeaturemanager.h
@@ -103,7 +103,8 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManag
 		mTableVersion(0),
 		mSafe(FALSE),
 		mGPUClass(GPU_CLASS_UNKNOWN),
-		mGPUSupported(FALSE)
+		mExpectedGLVersion(0.f),
+		mGPUSupported(FALSE)		
 	{
 	}
 	~LLFeatureManager() {cleanupFeatureTables();}
@@ -118,6 +119,7 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManag
 	EGPUClass getGPUClass() 			{ return mGPUClass; }
 	std::string& getGPUString() 		{ return mGPUString; }
 	BOOL isGPUSupported()				{ return mGPUSupported; }
+	F32 getExpectedGLVersion()			{ return mExpectedGLVersion; }
 	
 	void cleanupFeatureTables();
 
@@ -157,6 +159,7 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManag
 	S32			mTableVersion;
 	BOOL		mSafe;					// Reinitialize everything to the "safe" mask
 	EGPUClass	mGPUClass;
+	F32			mExpectedGLVersion;		//expected GL version according to gpu table
 	std::string	mGPUString;
 	BOOL		mGPUSupported;
 };
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index c6983ef5b3e6fb712a62f1fc6829237423c5617f..77a0cdffce5a1b0e376119d5bce955d716027847 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -66,7 +66,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD
 	mSimulateRes = 0;
 	mFrameNum = 0;
 	mCollisionSphereRadius = 0.f;
-	mRenderRes = 1;
+	mRenderRes = -1;
 	
 	if(mVO->mDrawable.notNull())
 	{
@@ -350,16 +350,17 @@ void LLVolumeImplFlexible::doIdleUpdate()
 		{
 			bool visible = drawablep->isVisible();
 
-			if ((mSimulateRes == 0) && visible)
+			if (mRenderRes == -1)
 			{
 				updateRenderRes();
 				gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+				sUpdateDelay[mInstanceIndex] = 0;
 			}
 			else
 			{
 				F32 pixel_area = mVO->getPixelArea();
 
-				U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
+				U32 update_period = (U32) (llmax((S32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f))),0)+1);
 				// MAINT-1890 Clamp the update period to ensure that the update_period is no greater than 32 frames
 				update_period = llclamp(update_period, 0U, 32U);
 
@@ -650,6 +651,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
 	mSection[i].mdPosition = (mSection[i].mPosition - mSection[i-1].mPosition) * inv_section_length;
 
 	// Create points
+	llassert(mRenderRes > -1)
 	S32 num_render_sections = 1<<mRenderRes;
 	if (path->getPathLength() != num_render_sections+1)
 	{
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index bca4b5e447188a64526b73266771923ac3e2b194..fffd724b221111556406b5cc80fe336e508cb855 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -80,6 +80,7 @@ BOOL LLFloaterBuyContents::postBuild()
 
 LLFloaterBuyContents::~LLFloaterBuyContents()
 {
+	removeVOInventoryListener();
 }
 
 
@@ -147,23 +148,26 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
 		return;
 	}
 
-	if (!inv)
+	LLScrollListCtrl* item_list = getChild<LLScrollListCtrl>("item_list");
+	if (!item_list)
 	{
-		llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged"
-			<< llendl;
 		removeVOInventoryListener();
 		return;
 	}
 
-	LLCtrlListInterface *item_list = childGetListInterface("item_list");
-	if (!item_list)
+	item_list->deleteAllItems();
+	
+	if (!inv)
 	{
-		removeVOInventoryListener();
+		llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged"
+			<< llendl;
+
 		return;
 	}
 
 	// default to turning off the buy button.
-	getChildView("buy_btn")->setEnabled(FALSE);
+	LLView* buy_btn = getChildView("buy_btn");
+	buy_btn->setEnabled(FALSE);
 
 	LLUUID owner_id;
 	BOOL is_group_owned;
@@ -204,7 +208,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
 
 		// There will be at least one item shown in the display, so go
 		// ahead and enable the buy button.
-		getChildView("buy_btn")->setEnabled(TRUE);
+		buy_btn->setEnabled(TRUE);
 
 		// Create the line in the list
 		LLSD row;
@@ -255,8 +259,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
 		getChildView("wear_check")->setEnabled(TRUE);
 		getChild<LLUICtrl>("wear_check")->setValue(LLSD(false) );
 	}
-	
-	removeVOInventoryListener();
 }
 
 
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index e2beb272e6e8a43258fc70af3ef08ea741d566ed..06681f5fd5fade6462be44d04a70a9db5b4f63c5 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -172,9 +172,9 @@ void LLFloaterColorPicker::createUI ()
 //
 void LLFloaterColorPicker::showUI ()
 {
+	openFloater(getKey());
 	setVisible ( TRUE );
 	setFocus ( TRUE );
-	openFloater(getKey());
 
 	// HACK: if system color picker is required - close the SL one we made and use default system dialog
 	if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 6b2492d92758096e08d7427ecd41f55736b5e515..2575f6f8172d13c6e32ba39d17390208b535aa39 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -901,11 +901,13 @@ BOOL LLImagePreviewSculpted::render()
 	{
 		gObjectPreviewProgram.bind();
 	}
+	gPipeline.enableLightsPreview();
+
 	gGL.pushMatrix();
 	const F32 SCALE = 1.25f;
 	gGL.scalef(SCALE, SCALE, SCALE);
 	const F32 BRIGHTNESS = 0.9f;
-	gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
+	gGL.diffuseColor3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
 
 	mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
 	mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0);
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a5e3cd404d76e20a51dee8eec4ff1db8cf8f8fdf..69986f67897095ceb5bc96c53800876b988adb45 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -735,6 +735,20 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
 void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
 {
 	mModelPreview->onLODParamCommit(lod, enforce_tri_limit);
+
+	//refresh LoDs that reference this one
+	for (S32 i = lod - 1; i >= 0; --i)
+	{
+		LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[i]);
+		if (lod_source_combo->getCurrentIndex() == LLModelPreview::USE_LOD_ABOVE)
+		{
+			onLoDSourceCommit(i);
+		}
+		else
+		{
+			break;
+		}
+	}
 }
 
 
@@ -3868,15 +3882,30 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 	U32 triangle_count = 0;
 
-	for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter)
+	U32 instanced_triangle_count = 0;
+
+	//get the triangle count for the whole scene
+	for (LLModelLoader::scene::iterator iter = mBaseScene.begin(), endIter = mBaseScene.end(); iter != endIter; ++iter)
 	{
-		LLModel* mdl = *iter;
-		for (S32 i = 0; i < mdl->getNumVolumeFaces(); ++i)
+		for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance)
+	{
+			LLModel* mdl = instance->mModel;
+			if (mdl)
 		{
-			triangle_count += mdl->getVolumeFace(i).mNumIndices/3;
+				instanced_triangle_count += mdl->getNumTriangles();
+			}
 		}
+		}
+
+	//get the triangle count for the non-instanced set of models
+	for (U32 i = 0; i < mBaseModel.size(); ++i)
+	{
+		triangle_count += mBaseModel[i]->getNumTriangles();
 	}
 
+	//get ratio of uninstanced triangles to instanced triangles
+	F32 triangle_ratio = (F32) triangle_count / (F32) instanced_triangle_count;
+
 	U32 base_triangle_count = triangle_count;
 
 	U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
@@ -3910,6 +3939,8 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 		if (which_lod > -1 && which_lod < NUM_LOD)
 		{
 			limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger();
+			//convert from "scene wide" to "non-instanced" triangle limit
+			limit = (S32) ( (F32) limit*triangle_ratio );
 		}
 	}
 	else
@@ -4015,7 +4046,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 		U32 actual_verts = 0;
 		U32 submeshes = 0;
 
-		mRequestedTriangleCount[lod] = triangle_count;
+		mRequestedTriangleCount[lod] = (S32) ( (F32) triangle_count / triangle_ratio );
 		mRequestedErrorThreshold[lod] = lod_error_threshold;
 
 		glodGroupParameteri(mGroup, GLOD_ADAPT_MODE, lod_mode);
@@ -4197,15 +4228,21 @@ void LLModelPreview::updateStatusMessages()
 		//initialize total for this lod to 0
 		total_tris[lod] = total_verts[lod] = total_submeshes[lod] = 0;
 
-		for (U32 i = 0; i < mModel[lod].size(); ++i)
-		{ //for each model in the lod
+		for (LLModelLoader::scene::iterator iter = mScene[lod].begin(), endIter = mScene[lod].end(); iter != endIter; ++iter)
+		{
+			for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance)
+			{
+				LLModel* model = instance->mModel;
+				if (model)
+				{
+					 //for each model in the lod
 			S32 cur_tris = 0;
 			S32 cur_verts = 0;
-			S32 cur_submeshes = mModel[lod][i]->getNumVolumeFaces();
+					S32 cur_submeshes = model->getNumVolumeFaces();
 
 			for (S32 j = 0; j < cur_submeshes; ++j)
 			{ //for each submesh (face), add triangles and vertices to current total
-				const LLVolumeFace& face = mModel[lod][i]->getVolumeFace(j);
+						const LLVolumeFace& face = model->getVolumeFace(j);
 				cur_tris += face.mNumIndices/3;
 				cur_verts += face.mNumVertices;
 			}
@@ -4221,6 +4258,8 @@ void LLModelPreview::updateStatusMessages()
 			submeshes[lod].push_back(cur_submeshes);
 		}
 	}
+		}
+	}
 
 	if (mMaxTriangleLimit == 0)
 	{
@@ -4395,16 +4434,18 @@ void LLModelPreview::updateStatusMessages()
 	}
 	
 	//add up physics triangles etc
-	S32 start = 0;
-	S32 end = mModel[LLModel::LOD_PHYSICS].size();
-
 	S32 phys_tris = 0;
 	S32 phys_hulls = 0;
 	S32 phys_points = 0;
 
-	for (S32 i = start; i < end; ++i)
-	{ //add up hulls and points and triangles for selected mesh(es)
-		LLModel* model = mModel[LLModel::LOD_PHYSICS][i];
+	//get the triangle count for the whole scene
+	for (LLModelLoader::scene::iterator iter = mScene[LLModel::LOD_PHYSICS].begin(), endIter = mScene[LLModel::LOD_PHYSICS].end(); iter != endIter; ++iter)
+	{
+		for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance)
+		{
+			LLModel* model = instance->mModel;
+			if (model)
+			{
 		S32 cur_submeshes = model->getNumVolumeFaces();
 
 		LLModel::convex_hull_decomposition& decomp = model->mPhysics.mHull;
@@ -4426,6 +4467,8 @@ void LLModelPreview::updateStatusMessages()
 			}
 		}
 	}
+		}
+	}
 
 	if (phys_tris > 0)
 	{
@@ -4586,7 +4629,7 @@ void LLModelPreview::updateLodControls(S32 lod)
 	if (!lod_combo) return;
 
 	S32 lod_mode = lod_combo->getCurrentIndex();
-	if (lod_mode == 0) // LoD from file
+	if (lod_mode == LOD_FROM_FILE) // LoD from file
 	{
 		fmp->mLODMode[lod] = 0;
 		for (U32 i = 0; i < num_file_controls; ++i)
@@ -4599,7 +4642,7 @@ void LLModelPreview::updateLodControls(S32 lod)
 			mFMP->childHide(lod_controls[i] + lod_name[lod]);
 		}
 	}
-	else if (lod_mode == 2) // use LoD above
+	else if (lod_mode == USE_LOD_ABOVE) // use LoD above
 	{
 		fmp->mLODMode[lod] = 2;
 		for (U32 i = 0; i < num_file_controls; ++i)
@@ -5071,6 +5114,11 @@ BOOL LLModelPreview::render()
 		refresh();
 	}
 
+	if (use_shaders)
+	{
+		gObjectPreviewProgram.bind();
+	}
+
 	gGL.loadIdentity();
 	gPipeline.enableLightsPreview();
 
@@ -5096,11 +5144,6 @@ BOOL LLModelPreview::render()
 
 	const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
 
-	if (use_shaders)
-	{
-		gObjectPreviewProgram.bind();
-	}
-
 	LLGLEnable normalize(GL_NORMALIZE);
 
 	if (!mBaseModel.empty() && mVertexBuffer[5].empty())
@@ -5289,7 +5332,7 @@ BOOL LLModelPreview::render()
 											hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 128));
 										}
 
-										glColor4ubv(hull_colors[i].mV);
+										gGL.diffuseColor4ubv(hull_colors[i].mV);
 										LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals);
 
 										if (explode > 0.f)
@@ -5760,6 +5803,12 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
 {
 	mModelPreview->updateLodControls(lod);
 	refresh();
+
+	LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
+	if (lod_source_combo->getCurrentIndex() == LLModelPreview::GENERATE)
+	{ //rebuild LoD to update triangle counts
+		onLODParamCommit(lod, true);
+	}
 }
 
 void LLFloaterModelPreview::resetDisplayOptions()
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index ab319c30d5e89ccfd8e613b9b24f5a2f9e0316f8..e588418f7b1d7142fa07745040a176af93112f04 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -310,6 +310,15 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
 	typedef boost::signals2::signal<void (void)> model_loaded_signal_t;
 	typedef boost::signals2::signal<void (bool)> model_updated_signal_t;
 
+public:
+
+	typedef enum
+	{
+		LOD_FROM_FILE = 0,
+		GENERATE,
+		USE_LOD_ABOVE,
+	} eLoDMode;
+
 public:
 	LLModelPreview(S32 width, S32 height, LLFloater* fmp);
 	virtual ~LLModelPreview();
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 48484786f69191b2a2142e9612c09714351dab69..1eb7f4469a142e2bb1f9cd2f5f692b5531c28d1f 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -1055,6 +1055,17 @@ void commit_grid_mode(LLUICtrl *ctrl)
 	LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
 }
 
+// static
+void LLFloaterTools::setGridMode(S32 mode)
+{
+	LLFloaterTools* tools_floater = LLFloaterReg::getTypedInstance<LLFloaterTools>("build");
+	if (!tools_floater || !tools_floater->mComboGridMode)
+	{
+		return;
+	}
+
+	tools_floater->mComboGridMode->setCurrentByIndex(mode);
+}
 
 void LLFloaterTools::onClickGridOptions()
 {
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 7a19d093a42f7ad5ea7f1594a640870bb92c2b0d..ecb0092a6f092f1a20ba2a3213e7e9b5f8116c7f 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -107,6 +107,8 @@ class LLFloaterTools
 	bool selectedMediaEditable();
 	void updateLandImpacts();
 
+	static void setGridMode(S32 mode);
+
 private:
 	void refresh();
 	void refreshMedia();
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index 151cd2a1cd65f6e9cc37014520032378500ac8b1..e85d849c9ad3b0ddca38532d739eafe3a467e29f 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -219,7 +219,8 @@ void LLFloaterURLEntry::onBtnOK( void* userdata )
 	}
 
 	// Discover the MIME type only for "http" scheme.
-	if(scheme == "http" || scheme == "https")
+	if(!media_url.empty() && 
+	   (scheme == "http" || scheme == "https"))
 	{
 		LLHTTPClient::getHeaderOnly( media_url,
 			new LLMediaTypeResponder(self->getHandle()));
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 87b900da62ae5240173b064ce726e81149f65f8f..949de312be03883d5ecc7dcfefdee8a295385421 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2588,12 +2588,12 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
 		{			
 			cat_count = cat_array->count();
 		}
-	
+
 		// Move to next if current folder empty
 		if ((item_count == 0) && (cat_count == 0))
-	{
+		{
 			continue;
-	}
+		}
 
 		uuid_vec_t ids;
 		LLRightClickInventoryFetchObserver* outfit = NULL;
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 6e0f360cbc05174e8fde998bde64e2e8bec141e7..9ec5d7c20c4c60026f77cb98defd0b0da8b25c35 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -72,7 +72,6 @@ void LLManip::rebuild(LLViewerObject* vobj)
 	LLDrawable* drawablep = vobj->mDrawable;
 	if (drawablep && drawablep->getVOVolume())
 	{
-		
 		gPipeline.markRebuild(drawablep,LLDrawable::REBUILD_VOLUME, TRUE);
 		drawablep->setState(LLDrawable::MOVE_UNDAMPED); // force to UNDAMPED
 		drawablep->updateMove();
@@ -82,6 +81,14 @@ void LLManip::rebuild(LLViewerObject* vobj)
 			group->dirtyGeom();
 			gPipeline.markRebuild(group, TRUE);
 		}
+
+		LLViewerObject::const_child_list_t& child_list = vobj->getChildren();
+		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(), endIter = child_list.end();
+			 iter != endIter; ++iter)
+		{
+			LLViewerObject* child = *iter;
+			rebuild(child);
+		}
 	}
 }
 
diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp
index bf4f4bceed368e7c64249b444b58d8cd6030f18a..2b92b0b3d1c1e1ce216da214932f6dc02c015574 100644
--- a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp
+++ b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp
@@ -242,3 +242,4 @@ void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrent
 		LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
 	}
 }
+
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 92ac435f084926b63d8dae12567bd784dae83b39..1223615079772e274ff703f6ea17e85964ca2c5f 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -204,16 +204,30 @@ class LLMeshHeaderResponder : public LLCurl::Responder
 {
 public:
 	LLVolumeParams mMeshParams;
-	
+	bool mProcessed;
+
 	LLMeshHeaderResponder(const LLVolumeParams& mesh_params)
 		: mMeshParams(mesh_params)
 	{
-		LLMeshRepoThread::sActiveHeaderRequests++;
+		LLMeshRepoThread::incActiveHeaderRequests();
+		mProcessed = false;
 	}
 
 	~LLMeshHeaderResponder()
 	{
-		LLMeshRepoThread::sActiveHeaderRequests--;
+		if (!LLApp::isQuitting())
+		{
+			if (!mProcessed)
+			{ //something went wrong, retry
+				llwarns << "Timeout or service unavailable, retrying." << llendl;
+				LLMeshRepository::sHTTPRetryCount++;
+				LLMeshRepoThread::HeaderRequest req(mMeshParams);
+				LLMutexLock lock(gMeshRepo.mThread->mMutex);
+				gMeshRepo.mThread->mHeaderReqQ.push(req);
+			}
+
+			LLMeshRepoThread::decActiveHeaderRequests();
+		}
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -229,16 +243,27 @@ class LLMeshLODResponder : public LLCurl::Responder
 	S32 mLOD;
 	U32 mRequestedBytes;
 	U32 mOffset;
+	bool mProcessed;
 
 	LLMeshLODResponder(const LLVolumeParams& mesh_params, S32 lod, U32 offset, U32 requested_bytes)
 		: mMeshParams(mesh_params), mLOD(lod), mOffset(offset), mRequestedBytes(requested_bytes)
 	{
-		LLMeshRepoThread::sActiveLODRequests++;
+		LLMeshRepoThread::incActiveLODRequests();
+		mProcessed = false;
 	}
 
 	~LLMeshLODResponder()
 	{
-		LLMeshRepoThread::sActiveLODRequests--;
+		if (!LLApp::isQuitting())
+		{
+			if (!mProcessed)
+			{
+				llwarns << "Killed without being processed, retrying." << llendl;
+				LLMeshRepository::sHTTPRetryCount++;
+				gMeshRepo.mThread->lockAndLoadMeshLOD(mMeshParams, mLOD);
+			}
+			LLMeshRepoThread::decActiveLODRequests();
+		}
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -253,10 +278,17 @@ class LLMeshSkinInfoResponder : public LLCurl::Responder
 	LLUUID mMeshID;
 	U32 mRequestedBytes;
 	U32 mOffset;
+	bool mProcessed;
 
 	LLMeshSkinInfoResponder(const LLUUID& id, U32 offset, U32 size)
 		: mMeshID(id), mRequestedBytes(size), mOffset(offset)
 	{
+		mProcessed = false;
+	}
+
+	~LLMeshSkinInfoResponder()
+	{
+		llassert(mProcessed);
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -271,10 +303,17 @@ class LLMeshDecompositionResponder : public LLCurl::Responder
 	LLUUID mMeshID;
 	U32 mRequestedBytes;
 	U32 mOffset;
+	bool mProcessed;
 
 	LLMeshDecompositionResponder(const LLUUID& id, U32 offset, U32 size)
 		: mMeshID(id), mRequestedBytes(size), mOffset(offset)
 	{
+		mProcessed = false;
+	}
+
+	~LLMeshDecompositionResponder()
+	{
+		llassert(mProcessed);
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -289,10 +328,17 @@ class LLMeshPhysicsShapeResponder : public LLCurl::Responder
 	LLUUID mMeshID;
 	U32 mRequestedBytes;
 	U32 mOffset;
+	bool mProcessed;
 
 	LLMeshPhysicsShapeResponder(const LLUUID& id, U32 offset, U32 size)
 		: mMeshID(id), mRequestedBytes(size), mOffset(offset)
 	{
+		mProcessed = false;
+	}
+
+	~LLMeshPhysicsShapeResponder()
+	{
+		llassert(mProcessed);
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -638,16 +684,24 @@ void LLMeshRepoThread::loadMeshPhysicsShape(const LLUUID& mesh_id)
 	mPhysicsShapeRequests.insert(mesh_id);
 }
 
+void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
+{
+	if (!LLAppViewer::isQuitting())
+	{
+		loadMeshLOD(mesh_params, lod);
+	}
+}
 
-void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
-{ //protected by mSignal, no locking needed here
 
+
+void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
+{ //could be called from any thread
+	LLMutexLock lock(mMutex);
 	mesh_header_map::iterator iter = mMeshHeader.find(mesh_params.getSculptID());
 	if (iter != mMeshHeader.end())
 	{ //if we have the header, request LOD byte range
 		LODRequest req(mesh_params, lod);
 		{
-			LLMutexLock lock(mMutex);
 			mLODReqQ.push(req);
 			LLMeshRepository::sLODProcessing++;
 		}
@@ -665,7 +719,6 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 		}
 		else
 		{ //if no header request is pending, fetch header
-			LLMutexLock lock(mMutex);
 			mHeaderReqQ.push(req);
 			mPendingLOD[mesh_params].push_back(lod);
 		}
@@ -945,6 +998,34 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 	return ret;
 }
 
+//static
+void LLMeshRepoThread::incActiveLODRequests()
+{
+	LLMutexLock lock(gMeshRepo.mThread->mMutex);
+	++LLMeshRepoThread::sActiveLODRequests;
+}
+
+//static
+void LLMeshRepoThread::decActiveLODRequests()
+{
+	LLMutexLock lock(gMeshRepo.mThread->mMutex);
+	--LLMeshRepoThread::sActiveLODRequests;
+}
+
+//static
+void LLMeshRepoThread::incActiveHeaderRequests()
+{
+	LLMutexLock lock(gMeshRepo.mThread->mMutex);
+	++LLMeshRepoThread::sActiveHeaderRequests;
+}
+
+//static
+void LLMeshRepoThread::decActiveHeaderRequests()
+{
+	LLMutexLock lock(gMeshRepo.mThread->mMutex);
+	--LLMeshRepoThread::sActiveHeaderRequests;
+}
+
 //return false if failed to get header
 bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count)
 {
@@ -1821,6 +1902,8 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
+	mProcessed = true;
+	
 	// thread could have already be destroyed during logout
 	if( !gMeshRepo.mThread )
 	{
@@ -1838,11 +1921,13 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
 	{
 		if (status == 499 || status == 503)
 		{ //timeout or service unavailable, try again
+			llwarns << "Timeout or service unavailable, retrying." << llendl;
 			LLMeshRepository::sHTTPRetryCount++;
 			gMeshRepo.mThread->loadMeshLOD(mMeshParams, mLOD);
 		}
 		else
 		{
+			llassert(status == 499 || status == 503); //intentionally trigger a breakpoint
 			llwarns << "Unhandled status " << status << llendl;
 		}
 		return;
@@ -1881,6 +1966,8 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
+	mProcessed = true;
+
 	// thread could have already be destroyed during logout
 	if( !gMeshRepo.mThread )
 	{
@@ -1898,11 +1985,13 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason
 	{
 		if (status == 499 || status == 503)
 		{ //timeout or service unavailable, try again
+			llwarns << "Timeout or service unavailable, retrying." << llendl;
 			LLMeshRepository::sHTTPRetryCount++;
 			gMeshRepo.mThread->loadMeshSkinInfo(mMeshID);
 		}
 		else
 		{
+			llassert(status == 499 || status == 503); //intentionally trigger a breakpoint
 			llwarns << "Unhandled status " << status << llendl;
 		}
 		return;
@@ -1941,6 +2030,8 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
+	mProcessed = true;
+	
 	if( !gMeshRepo.mThread )
 	{
 		return;
@@ -1957,11 +2048,13 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r
 	{
 		if (status == 499 || status == 503)
 		{ //timeout or service unavailable, try again
+			llwarns << "Timeout or service unavailable, retrying." << llendl;
 			LLMeshRepository::sHTTPRetryCount++;
 			gMeshRepo.mThread->loadMeshDecomposition(mMeshID);
 		}
 		else
 		{
+			llassert(status == 499 || status == 503); //intentionally trigger a breakpoint
 			llwarns << "Unhandled status " << status << llendl;
 		}
 		return;
@@ -2000,6 +2093,8 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
+	mProcessed = true;
+
 	// thread could have already be destroyed during logout
 	if( !gMeshRepo.mThread )
 	{
@@ -2017,11 +2112,13 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re
 	{
 		if (status == 499 || status == 503)
 		{ //timeout or service unavailable, try again
+			llwarns << "Timeout or service unavailable, retrying." << llendl;
 			LLMeshRepository::sHTTPRetryCount++;
 			gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID);
 		}
 		else
 		{
+			llassert(status == 499 || status == 503); //intentionally trigger a breakpoint
 			llwarns << "Unhandled status " << status << llendl;
 		}
 		return;
@@ -2060,6 +2157,8 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
+	mProcessed = true;
+
 	// thread could have already be destroyed during logout
 	if( !gMeshRepo.mThread )
 	{
@@ -2078,8 +2177,12 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 		// TODO*: Add maximum retry logic, exponential backoff
 		// and (somewhat more optional than the others) retries
 		// again after some set period of time
+
+		llassert(status == 503 || status == 499);
+
 		if (status == 503 || status == 499)
 		{ //retry
+			llwarns << "Timeout or service unavailable, retrying." << llendl;
 			LLMeshRepository::sHTTPRetryCount++;
 			LLMeshRepoThread::HeaderRequest req(mMeshParams);
 			LLMutexLock lock(gMeshRepo.mThread->mMutex);
@@ -2087,6 +2190,10 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 
 			return;
 		}
+		else
+		{
+			llwarns << "Unhandled status." << llendl;
+		}
 	}
 
 	S32 data_size = buffer->countAfter(channels.in(), NULL);
@@ -2101,7 +2208,11 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 
 	LLMeshRepository::sBytesReceived += llmin(data_size, 4096);
 
-	if (!gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size))
+	bool success = gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);
+	
+	llassert(success);
+
+	if (!success)
 	{
 		llwarns
 			<< "Unable to parse mesh header: "
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 6e301c26a2ba78e226a8cd98234f3d522d19947a..8602271f84470e016ec1cd6f78502351e5b44876 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -322,7 +322,9 @@ class LLMeshRepoThread : public LLThread
 
 	virtual void run();
 
+	void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
 	void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
+
 	bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count);
 	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count);
 	bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size);
@@ -351,6 +353,10 @@ class LLMeshRepoThread : public LLThread
 	//  (should hold onto mesh_id and try again later if header info does not exist)
 	bool fetchMeshPhysicsShape(const LLUUID& mesh_id);
 
+	static void incActiveLODRequests();
+	static void decActiveLODRequests();
+	static void incActiveHeaderRequests();
+	static void decActiveHeaderRequests();
 
 };
 
@@ -407,7 +413,7 @@ class LLMeshUploadThread : public LLThread
 
 	void startRequest() { ++mPendingUploads; }
 	void stopRequest() { --mPendingUploads; }
-
+		
 	bool finished() { return mFinished; }
 	virtual void run();
 	void preStart();
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 93f7146fc8060d46d9e8c8a4724b0bbd6191ca66..eb6591eb39eeeb544a601091b2fefd7584156626 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -698,19 +698,28 @@ void LLPanelStandStopFlying::updatePosition()
 
 	S32 y_pos = 0;
 	S32 bottom_tb_center = 0;
-	if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
+	if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM))
 	{
 		y_pos = toolbar_bottom->getRect().getHeight();
 		bottom_tb_center = toolbar_bottom->getRect().getCenterX();
 	}
 
 	S32 left_tb_width = 0;
-	if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
+	if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT))
 	{
 		left_tb_width = toolbar_left->getRect().getWidth();
 	}
 
-	if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
+	if (!mStateManagementButtons.get())
+	{
+		LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
+		if (panel_ssf_container)
+		{
+			mStateManagementButtons = panel_ssf_container->getHandle();
+		}
+	}
+
+	if(LLPanel* panel_ssf_container = mStateManagementButtons.get())
 	{
 		panel_ssf_container->setOrigin(0, y_pos);
 	}
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index 744dd866d44a6d3f7f87a811ad6cd065e8f43569..c525d9dfdb6580d1c5bb1ea62c89fe01a3840cb1 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -172,6 +172,8 @@ class LLPanelStandStopFlying : public LLPanel
 	 */
 	LLHandle<LLPanel> mOriginalParent;
 
+	LLHandle<LLPanel> mStateManagementButtons;
+
 	/**
 	 * True if the panel is currently attached to the movement controls floater.
 	 * 
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 16c51138a9f21fd31fb32d4a638edc5dd844b7e2..34cb27d5ce47b77261181ecacb553fc0a20db269 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -353,7 +353,8 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
 
 		if (from_id.isNull())
 		{
-			llwarns << " from_id for notification " << notification->getName() << " is null " << llendl;
+			// Normal behavior for system generated messages, don't spam.
+			// llwarns << " from_id for notification " << notification->getName() << " is null " << llendl;
 			return;
 		}
 
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index fb1adc7ddff5911a5f8d9fd3e976408418b417fa..4cad96fdc7f51e6f8ddae4d7aa781a4e10824409 100644
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -84,6 +84,11 @@ bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& pay
 	return false;
 }
 
+// Storing or loading too many persistent notifications will severely hurt 
+// viewer load times, possibly to the point of failing to log in. Example case
+// from MAINT-994 is 821 notifications. 
+static const S32 MAX_PERSISTENT_NOTIFICATIONS = 250;
+
 void LLPersistentNotificationStorage::saveNotifications()
 {
 	// TODO - think about save optimization.
@@ -114,6 +119,13 @@ void LLPersistentNotificationStorage::saveNotifications()
 		}
 
 		data.append(notification->asLLSD());
+
+		if (data.size() >= MAX_PERSISTENT_NOTIFICATIONS)
+		{
+			llwarns << "Too many persistent notifications."
+					<< " Saved " << MAX_PERSISTENT_NOTIFICATIONS << " of " << history_channel->size() << " persistent notifications." << llendl;
+			break;
+		}
 	}
 
 	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
@@ -124,9 +136,6 @@ void LLPersistentNotificationStorage::loadNotifications()
 {
 	LLResponderRegistry::registerResponders();
 
-	LLNotifications::instance().getChannel("Persistent")->
-		connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1));
-
 	llifstream notify_file(mFileName.c_str());
 	if (!notify_file.is_open())
 	{
@@ -158,29 +167,48 @@ void LLPersistentNotificationStorage::loadNotifications()
 		findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
 
 	LLNotifications& instance = LLNotifications::instance();
-
+	S32 processed_notifications = 0;
 	for (LLSD::array_const_iterator notification_it = data.beginArray();
 		notification_it != data.endArray();
 		++notification_it)
 	{
 		LLSD notification_params = *notification_it;
-		LLNotificationPtr notification(new LLNotification(notification_params));
 
-		LLNotificationResponderPtr responder(LLResponderRegistry::
-			createResponder(notification_params["name"], notification_params["responder"]));
-		notification->setResponseFunctor(responder);
+		if (instance.templateExists(notification_params["name"].asString()))
+		{
+			LLNotificationPtr notification(new LLNotification(notification_params));
 
-		instance.add(notification);
+			LLNotificationResponderPtr responder(LLResponderRegistry::
+				createResponder(notification_params["name"], notification_params["responder"]));
+			notification->setResponseFunctor(responder);
 
-		// hide script floaters so they don't confuse the user and don't overlap startup toast
-		LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false);
+			instance.add(notification);
 
-		if(notification_channel)
+			// hide script floaters so they don't confuse the user and don't overlap startup toast
+			LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false);
+
+			if(notification_channel)
+			{
+				// hide saved toasts so they don't confuse the user
+				notification_channel->hideToast(notification->getID());
+			}
+		}
+		else
+		{
+			llwarns << "Failed to find template for persistent notification " << notification_params["name"].asString() << llendl;
+		}
+
+		++processed_notifications;
+		if (processed_notifications >= MAX_PERSISTENT_NOTIFICATIONS)
 		{
-			// hide saved toasts so they don't confuse the user
-			notification_channel->hideToast(notification->getID());
+			llwarns << "Too many persistent notifications."
+					<< " Processed " << MAX_PERSISTENT_NOTIFICATIONS << " of " << data.size() << " persistent notifications." << llendl;
+			break;
 		}
 	}
+
+	LLNotifications::instance().getChannel("Persistent")->
+		connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1));
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index d42056ef9d50736c3cd4c2f6582c2a011dc9c657..6b9edcb07c6f890a3835d5e2b09271d778209adf 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1186,7 +1186,7 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show, BOOL dis
 
 void LLPanelEditWearable::showDefaultSubpart()
 {
-        changeCamera(3);
+        changeCamera(0);
 }
 
 void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index)
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 28cfb5b282874d69f8e692a31b0f7325c3836e64..fabb8daa6eb4f731340410ea475131f4aada895b 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1174,6 +1174,8 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
 
 	if (command_name == "share")
 	{
+		LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
+		if (!current_item) return FALSE;
 		LLSidepanelInventory* parent = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 		return parent ? parent->canShare() : FALSE;
 	}
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 35e2e96bab8effdac176544724408faa4ba72339..36234b953660b65f3188cea306ed74a02e92a7c2 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -186,8 +186,11 @@ class LLPanelOutfitEditGearMenu
 	// Populate the menu with items like "New Skin", "New Pants", etc.
 	static void populateCreateWearableSubmenus(LLMenuGL* menu)
 	{
-		LLView* menu_clothes	= gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE);
-		LLView* menu_bp			= gMenuHolder->getChildView("COF.Geear.New_Body_Parts", FALSE);
+        // MAINT-2276...these menus are created as dummies because they are not available
+        // when this function is called. This prevents their parent from popping up later.
+        //
+		//LLView* menu_clothes	= gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE);
+		//LLView* menu_bp			= gMenuHolder->getChildView("COF.Geear.New_Body_Parts", FALSE);
 
 		for (U8 i = LLWearableType::WT_SHAPE; i != (U8) LLWearableType::WT_COUNT; ++i)
 		{
@@ -200,8 +203,11 @@ class LLPanelOutfitEditGearMenu
 			p.on_click.function_name = "Wearable.Create";
 			p.on_click.parameter = LLSD(type_name);
 
-			LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ?
-				menu_clothes : menu_bp;
+            //LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp;
+            // This is a work-around for MAINT-2276 wherein the parent toggleable menu does not appear
+            // It puts everything under one menu, but that menu appears, which is better than not.
+            // 
+			LLView* parent =  menu;
 			LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent);
 		}
 	}
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 8027783bd83ba0276d3f0dcdd6cc517a792dc257..4e6128018d4289e7ac86e339f06c8100bb5dc7f6 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -425,7 +425,7 @@ void LLPanelPermissions::refresh()
 		}
 	}
 	
-	getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
+	getChildView("button set group")->setEnabled(root_selected && owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
 
 	getChildView("Name:")->setEnabled(TRUE);
 	LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name");
diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index e26fcc74bdb462f814801836d945f7018322d574..5f5258bbceb05bb120259f1ba25dcefe75f4130b 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -241,7 +241,7 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
 			mBaseNormals[i].clear();
 			mBaseBinormals[i].clear();
 			mTexCoords[i].clear();
-            mWeights[i] = 0.f;
+			mWeights[i] = 0.f;
         }
         mNumVertices = numVertices;
         return TRUE;
diff --git a/indra/newview/llpolymesh.h b/indra/newview/llpolymesh.h
index 850171d1697db3bc6586be8a6500e413c517bc51..28da230541a0a422881fccb26790616faab7204c 100644
--- a/indra/newview/llpolymesh.h
+++ b/indra/newview/llpolymesh.h
@@ -400,6 +400,8 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
 // LLPolySkeletalDeformation
 // A set of joint scale data for deforming the avatar mesh
 //-----------------------------------------------------------------------------
+
+LL_ALIGN_PREFIX(16)
 class LLPolySkeletalDistortion : public LLViewerVisualParam
 {
 public:
@@ -436,13 +438,14 @@ class LLPolySkeletalDistortion : public LLViewerVisualParam
 	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
 
 protected:
+	LL_ALIGN_16(LLVector4a	mDefaultVec);
+
 	typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
 	joint_vec_map_t mJointScales;
 	joint_vec_map_t mJointOffsets;
-	LLVector4a	mDefaultVec;
 	// Backlink only; don't make this an LLPointer.
 	LLVOAvatar *mAvatar;
-};
+} LL_ALIGN_POSTFIX(16);
 
 #endif // LL_LLPOLYMESH_H
 
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp
index bd96608641769057b451f8ab9bda537061b46044..495fdc348c043f9da78394d2e1da58887f9ad097 100644
--- a/indra/newview/llpolymorph.cpp
+++ b/indra/newview/llpolymorph.cpp
@@ -73,9 +73,11 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) :
 {
 	const S32 numVertices = mNumIndices;
 
-	mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
-	mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
-	mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	U32 size = sizeof(LLVector4a)*numVertices;
+
+	mCoords = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
+	mNormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
+	mBinormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
 	mTexCoords = new LLVector2[numVertices];
 	mVertexIndices = new U32[numVertices];
 	
@@ -121,9 +123,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
 	//-------------------------------------------------------------------------
 	// allocate vertices
 	//-------------------------------------------------------------------------
-	mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
-	mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
-	mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
+	
+	U32 size = sizeof(LLVector4a)*numVertices;
+	
+	mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
+	mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
+	mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
+	
 	mTexCoords = new LLVector2[numVertices];
 	// Actually, we are allocating more space than we need for the skiplist
 	mVertexIndices = new U32[numVertices];
diff --git a/indra/newview/llpolymorph.h b/indra/newview/llpolymorph.h
index 678599d7e19664af4c870d1a21cd4e49acc28d24..24940c52e0fa390cb529822cea09cda021a7480b 100644
--- a/indra/newview/llpolymorph.h
+++ b/indra/newview/llpolymorph.h
@@ -41,6 +41,7 @@ class LLWearable;
 //-----------------------------------------------------------------------------
 // LLPolyMorphData()
 //-----------------------------------------------------------------------------
+LL_ALIGN_PREFIX(16)
 class LLPolyMorphData
 {
 public:
@@ -75,12 +76,13 @@ class LLPolyMorphData
 
 	F32					mTotalDistortion;	// vertex distortion summed over entire morph
 	F32					mMaxDistortion;		// maximum single vertex distortion in a given morph
-	LLVector4a			mAvgDistortion;		// average vertex distortion, to infer directionality of the morph
+	LL_ALIGN_16(LLVector4a			mAvgDistortion);		// average vertex distortion, to infer directionality of the morph
 	LLPolyMeshSharedData*	mMesh;
 
 private:
 	void freeData();
-};
+} LL_ALIGN_POSTFIX(16);
+
 
 //-----------------------------------------------------------------------------
 // LLPolyVertexMask()
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index bdbb1bb7970fd2ba726ff1191dcf4e286b2b5fb1..0079b3bab8c295c799c30f9ff6a154291044d3c6 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -211,7 +211,6 @@ LLSelectMgr::LLSelectMgr()
 
 	mGridMode = GRID_MODE_WORLD;
 	gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD);
-	mGridValid = FALSE;
 
 	mSelectedObjects = new LLObjectSelection();
 	mHoverObjects = new LLObjectSelection();
@@ -1170,7 +1169,6 @@ void LLSelectMgr::setGridMode(EGridMode mode)
 	mGridMode = mode;
 	gSavedSettings.setS32("GridMode", mode);
 	updateSelectionCenter();
-	mGridValid = FALSE;
 }
 
 void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale)
@@ -1271,7 +1269,6 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
 	origin = mGridOrigin;
 	rotation = mGridRotation;
 	scale = mGridScale;
-	mGridValid = TRUE;
 }
 
 //-----------------------------------------------------------------------------
@@ -2941,248 +2938,241 @@ BOOL LLSelectMgr::selectGetRootsCopy()
 	return TRUE;
 }
 
-//-----------------------------------------------------------------------------
-// selectGetCreator()
-// Creator information only applies to root objects.
-//-----------------------------------------------------------------------------
-BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name)
+struct LLSelectGetFirstTest
 {
-	BOOL identical = TRUE;
-	BOOL first = TRUE;
-	LLUUID first_id;
-	for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
-		 iter != getSelection()->root_object_end(); iter++ )
+	LLSelectGetFirstTest() : mIdentical(true), mFirst(true)	{ }
+	virtual ~LLSelectGetFirstTest() { }
+
+	// returns false to break out of the iteration.
+	bool checkMatchingNode(LLSelectNode* node)
 	{
-		LLSelectNode* node = *iter;	
-		if (!node->mValid)
+		if (!node || !node->mValid)
 		{
-			return FALSE;
+			return false;
 		}
 
-		if (first)
+		if (mFirst)
 		{
-			first_id = node->mPermissions->getCreator();
-			first = FALSE;
+			mFirstValue = getValueFromNode(node);
+			mFirst = false;
 		}
 		else
 		{
-			if ( !(first_id == node->mPermissions->getCreator() ) )
+			if ( mFirstValue != getValueFromNode(node) )
 			{
-				identical = FALSE;
-				break;
+				mIdentical = false;
+				// stop testing once we know not all selected are identical.
+				return false;
 			}
 		}
-	}
-	if (first_id.isNull())
-	{
-		name = LLTrans::getString("AvatarNameNobody");
-		return FALSE;
+		// continue testing.
+		return true;
 	}
 	
-	result_id = first_id;
+	bool mIdentical;
+	LLUUID mFirstValue;
 	
-	if (identical)
-	{
-		name = LLSLURL("agent", first_id, "inspect").getSLURLString();
-	}
-	else
-	{
-		name = LLTrans::getString("AvatarNameMultiple");
-	}
-
-	return identical;
-}
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node) = 0;
 
+private:
+	bool mFirst;
+};
 
-//-----------------------------------------------------------------------------
-// selectGetOwner()
-// Owner information only applies to roots.
-//-----------------------------------------------------------------------------
-BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name)
+void LLSelectMgr::getFirst(LLSelectGetFirstTest* test)
 {
-	BOOL identical = TRUE;
-	BOOL first = TRUE;
-	BOOL first_group_owned = FALSE;
-	LLUUID first_id;
-	for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
-		 iter != getSelection()->root_object_end(); iter++ )
+	if (gSavedSettings.getBOOL("EditLinkedParts"))
+{
+		for (LLObjectSelection::valid_iterator iter = getSelection()->valid_begin();
+			iter != getSelection()->valid_end(); ++iter )
 	{
-		LLSelectNode* node = *iter;	
-		if (!node->mValid)
+			if (!test->checkMatchingNode(*iter))
 		{
-			return FALSE;
+				break;
+			}
 		}
-		
-		if (first)
-		{
-			node->mPermissions->getOwnership(first_id, first_group_owned);
-			first = FALSE;
 		}
 		else
 		{
-			LLUUID owner_id;
-			BOOL is_group_owned = FALSE;
-			if (!(node->mPermissions->getOwnership(owner_id, is_group_owned))
-				|| owner_id != first_id || is_group_owned != first_group_owned)
+		for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
+			iter != getSelection()->root_object_end(); ++iter )
+		{
+			if (!test->checkMatchingNode(*iter))
 			{
-				identical = FALSE;
 				break;
 			}
 		}
 	}
-	if (first_id.isNull())
-	{
-		return FALSE;
 	}
 
-	result_id = first_id;
-	
-	if (identical)
+//-----------------------------------------------------------------------------
+// selectGetCreator()
+// Creator information only applies to roots unless editing linked parts.
+//-----------------------------------------------------------------------------
+struct LLSelectGetFirstCreator : public LLSelectGetFirstTest
 	{
-		BOOL public_owner = (first_id.isNull() && !first_group_owned);
-		if (first_group_owned)
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node)
 		{
-			name = LLSLURL("group", first_id, "inspect").getSLURLString();
+		return node->mPermissions->getCreator();
 		}
-		else if(!public_owner)
+};
+
+BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name)
 		{
-			name = LLSLURL("agent", first_id, "inspect").getSLURLString();
-		}
-		else
+	LLSelectGetFirstCreator test;
+	getFirst(&test);
+
+	if (test.mFirstValue.isNull())
 		{
 			name = LLTrans::getString("AvatarNameNobody");
+		return FALSE;
 		}
+	
+	result_id = test.mFirstValue;
+	
+	if (test.mIdentical)
+	{
+		name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString();
 	}
 	else
 	{
 		name = LLTrans::getString("AvatarNameMultiple");
 	}
 
-	return identical;
+	return test.mIdentical;
 }
 
-
 //-----------------------------------------------------------------------------
-// selectGetLastOwner()
-// Owner information only applies to roots.
+// selectGetOwner()
+// Owner information only applies to roots unless editing linked parts.
 //-----------------------------------------------------------------------------
-BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name)
-{
-	BOOL identical = TRUE;
-	BOOL first = TRUE;
-	LLUUID first_id;
-	for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
-		 iter != getSelection()->root_object_end(); iter++ )
+struct LLSelectGetFirstOwner : public LLSelectGetFirstTest
 	{
-		LLSelectNode* node = *iter;	
-		if (!node->mValid)
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node)
 		{
-			return FALSE;
+		// Don't use 'getOwnership' since we return a reference, not a copy.
+		// Will return LLUUID::null if unowned (which is not allowed and should never happen.)
+		return node->mPermissions->isGroupOwned() ? node->mPermissions->getGroup() : node->mPermissions->getOwner();
 		}
+};
 
-		if (first)
-		{
-			first_id = node->mPermissions->getLastOwner();
-			first = FALSE;
-		}
-		else
+BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name)
 		{
-			if ( !(first_id == node->mPermissions->getLastOwner() ) )
-			{
-				identical = FALSE;
-				break;
-			}
-		}
-	}
-	if (first_id.isNull())
+	LLSelectGetFirstOwner test;
+	getFirst(&test);
+
+	if (test.mFirstValue.isNull())
 	{
 		return FALSE;
 	}
 
-	result_id = first_id;
+	result_id = test.mFirstValue;
 	
-	if (identical)
+	if (test.mIdentical)
 	{
-		BOOL public_owner = (first_id.isNull());
-		if(!public_owner)
+		bool group_owned = selectIsGroupOwned();
+		if (group_owned)
 		{
-			name = LLSLURL("agent", first_id, "inspect").getSLURLString();
+			name = LLSLURL("group", test.mFirstValue, "inspect").getSLURLString();
 		}
 		else
 		{
-			name.assign("Public or Group");
+			name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString();
 		}
 	}
 	else
 	{
-		name.assign( "" );
+		name = LLTrans::getString("AvatarNameMultiple");
 	}
 
-	return identical;
+	return test.mIdentical;
 }
 
-
 //-----------------------------------------------------------------------------
-// selectGetGroup()
-// Group information only applies to roots.
+// selectGetLastOwner()
+// Owner information only applies to roots unless editing linked parts.
 //-----------------------------------------------------------------------------
-BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id)
+struct LLSelectGetFirstLastOwner : public LLSelectGetFirstTest
 {
-	BOOL identical = TRUE;
-	BOOL first = TRUE;
-	LLUUID first_id;
-	for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
-		 iter != getSelection()->root_object_end(); iter++ )
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node)
+{
+		return node->mPermissions->getLastOwner();
+	}
+};
+
+BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name)
 	{
-		LLSelectNode* node = *iter;	
-		if (!node->mValid)
+	LLSelectGetFirstLastOwner test;
+	getFirst(&test);
+
+	if (test.mFirstValue.isNull())
 		{
 			return FALSE;
 		}
 
-		if (first)
+	result_id = test.mFirstValue;
+	
+	if (test.mIdentical)
 		{
-			first_id = node->mPermissions->getGroup();
-			first = FALSE;
+		name = LLSLURL("agent", test.mFirstValue, "inspect").getSLURLString();
 		}
 		else
 		{
-			if ( !(first_id == node->mPermissions->getGroup() ) )
-			{
-				identical = FALSE;
-				break;
+		name.assign( "" );
 			}
+
+	return test.mIdentical;
 		}
+
+//-----------------------------------------------------------------------------
+// selectGetGroup()
+// Group information only applies to roots unless editing linked parts.
+//-----------------------------------------------------------------------------
+struct LLSelectGetFirstGroup : public LLSelectGetFirstTest
+{
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node)
+	{
+		return node->mPermissions->getGroup();
 	}
+};
 
-	result_id = first_id;
+BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id)
+{
+	LLSelectGetFirstGroup test;
+	getFirst(&test);
 
-	return identical;
+	result_id = test.mFirstValue;
+	return test.mIdentical;
 }
 
 //-----------------------------------------------------------------------------
 // selectIsGroupOwned()
-// Only operates on root nodes.  
-// Returns TRUE if all have valid data and they are all group owned.
+// Only operates on root nodes unless editing linked parts.  
+// Returns TRUE if the first selected is group owned.
 //-----------------------------------------------------------------------------
-BOOL LLSelectMgr::selectIsGroupOwned()
-{
-	BOOL found_one = FALSE;
-	for (LLObjectSelection::root_object_iterator iter = getSelection()->root_object_begin();
-		 iter != getSelection()->root_object_end(); iter++ )
+struct LLSelectGetFirstGroupOwner : public LLSelectGetFirstTest
 	{
-		LLSelectNode* node = *iter;	
-		if (!node->mValid)
+protected:
+	virtual const LLUUID& getValueFromNode(LLSelectNode* node)
 		{
-			return FALSE;
-		}
-		found_one = TRUE;
-		if (!node->mPermissions->isGroupOwned())
+		if (node->mPermissions->isGroupOwned())
 		{
-			return FALSE;
+			return node->mPermissions->getGroup();
 		}
+		return LLUUID::null;
 	}	
-	return found_one ? TRUE : FALSE;
+};
+
+BOOL LLSelectMgr::selectIsGroupOwned()
+{
+	LLSelectGetFirstGroupOwner test;
+	getFirst(&test);
+
+	return test.mFirstValue.notNull() ? TRUE : FALSE;
 }
 
 //-----------------------------------------------------------------------------
@@ -4985,7 +4975,11 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
 		} func(id);
 		LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func);
 
-		if (node)
+		if (!node)
+		{
+			llwarns << "Couldn't find object " << id << " selected." << llendl;
+		}
+		else
 		{
 			if (node->mInventorySerial != inv_serial)
 			{
@@ -5056,13 +5050,6 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
 
 	dialog_refresh_all();
 
-	// silly hack to allow 'save into inventory' 
-	if(gPopupMenuView->getVisible())
-	{
-		gPopupMenuView->setItemEnabled(SAVE_INTO_INVENTORY,
-									   enable_save_into_inventory(NULL));
-	}
-
 	// hack for left-click buy object
 	LLToolPie::selectionPropertiesReceived();
 }
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index ecbb20df1bb1292f7e580765588cc28ba5e796f8..cc78e358691dcb5b6f6f3138d3874a4278c24fd5 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -343,6 +343,9 @@ typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
 extern template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
 #endif
 
+// For use with getFirstTest()
+struct LLSelectGetFirstTest;
+
 class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 {
 public:
@@ -745,6 +748,9 @@ class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 	static void packGodlikeHead(void* user_data);
 	static bool confirmDelete(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle);
 
+	// Get the first ID that matches test and whether or not all ids are identical in selected objects.
+	void getFirst(LLSelectGetFirstTest* test);
+
 public:
 	// Observer/callback support for when object selection changes or
 	// properties are received/updated
@@ -763,8 +769,6 @@ class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 	LLVector3				mGridOrigin;
 	LLVector3				mGridScale;
 	EGridMode				mGridMode;
-	BOOL					mGridValid;
-
 
 	BOOL					mTEMode;			// render te
 	LLVector3d				mSelectionCenterGlobal;
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 8fb56eb6d8de2f52be74e902d8bcea2ad1bc20b9..986ac14140d13cbafc5754b7e0446b1c33d0a3d9 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -101,6 +101,8 @@ BOOL LLSidepanelTaskInfo::postBuild()
 	mDetailsBtn = getChild<LLButton>("details_btn");
 	mDetailsBtn->setClickedCallback(boost::bind(&LLSidepanelTaskInfo::onDetailsButtonClicked, this));
 
+	mDeedBtn = getChild<LLButton>("button deed");
+
 	mLabelGroupName = getChild<LLNameBox>("Group Name Proxy");
 
 	childSetCommitCallback("Object Name",						LLSidepanelTaskInfo::onCommitName,this);
@@ -263,7 +265,7 @@ void LLSidepanelTaskInfo::disableAll()
 
 void LLSidepanelTaskInfo::refresh()
 {
-	LLButton* btn_deed_to_group = getChild<LLButton>("button deed");
+	LLButton* btn_deed_to_group = mDeedBtn; 
 	if (btn_deed_to_group)
 	{	
 		std::string deedText;
diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h
index 124229af064908f3e08b26d373dc8acb10efc174..05edcda5ed0bff322478443f081cb03ac9b4cbb6 100644
--- a/indra/newview/llsidepaneltaskinfo.h
+++ b/indra/newview/llsidepaneltaskinfo.h
@@ -113,6 +113,7 @@ class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
 	LLButton*					mPayBtn;
 	LLButton*					mBuyBtn;
 	LLButton*					mDetailsBtn;
+	LLButton*					mDeedBtn;
 
 protected:
 	LLViewerObject*				getObject();
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 0e2109c4afe2b9d3dd38e281184f31be6d622ec2..53f5658815e7e4bbd2d94ac63650cf29423e327c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -274,7 +274,7 @@ LLSpatialGroup::~LLSpatialGroup()
 	{
 		llerrs << "Illegal deletion of LLSpatialGroup!" << llendl;
 	}*/
-	
+
 	if (gDebugGL)
 	{
 		gPipeline.checkReferences(this);
@@ -985,7 +985,7 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) : LLv
 
 	mViewAngle.splat(0.f);
 	mLastUpdateViewAngle.splat(-1.f);
-	
+
 	sg_assert(mOctreeNode->getListenerCount() == 0);
 	setState(SG_INITIAL_STATE_MASK);
 	gPipeline.markRebuild(this, TRUE);
@@ -1175,7 +1175,7 @@ void LLSpatialGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* en
 void LLSpatialGroup::handleDestruction(const TreeNode* node)
 {
 	setState(DEAD);
-
+	
 	for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
 	{
 		LLViewerOctreeEntry* entry = *i;
@@ -1186,7 +1186,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
 				((LLDrawable*)entry->getDrawable())->setGroup(NULL);
 			}
 			else
-			{
+		{
 				llerrs << "No Drawable found in the entry." << llendl;
 			}
 		}
@@ -1503,14 +1503,14 @@ LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32
 	mBufferUsage = buffer_usage;
 	mDepthMask = FALSE;
 	mSlopRatio = 0.25f;
-	mInfiniteFarClip = FALSE;	
+	mInfiniteFarClip = FALSE;
 
 	new LLSpatialGroup(mOctree, this);
 }
 
 
 LLSpatialPartition::~LLSpatialPartition()
-{	
+{
 }
 
 LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
@@ -1519,12 +1519,12 @@ LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
 
 	//keep drawable from being garbage collected
 	LLPointer<LLDrawable> ptr = drawablep;
-			
+		
 	if(!drawablep->getGroup())
 	{
-		assert_octree_valid(mOctree);
+	assert_octree_valid(mOctree);
 		mOctree->insert(drawablep->getEntry());
-		assert_octree_valid(mOctree);
+	assert_octree_valid(mOctree);
 	}	
 	
 	LLSpatialGroup* group = drawablep->getSpatialGroup();
@@ -1636,7 +1636,7 @@ class LLOctreeCull : public LLViewerOctreeCull
 		
 		return false;
 	}
-		
+	
 	virtual S32 frustumCheck(const LLviewerOctreeGroup* group)
 	{
 		S32 res = AABBInFrustumNoFarClipGroupBounds(group);
@@ -1831,7 +1831,7 @@ class LLOctreeSelect : public LLOctreeCull
 		{
 			LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
 			if(!drawable)
-			{
+		{
 				continue;
 			}
 			if (!drawable->isDead())
@@ -2019,8 +2019,6 @@ BOOL LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera)
 
 S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select)
 {
-	llassert(results != NULL && for_select);
-
 #if LL_OCTREE_PARANOIA_CHECK
 	((LLSpatialGroup*)mOctree->getListener(0))->checkStates();
 #endif
@@ -3143,7 +3141,7 @@ void renderPhysicsShapes(LLSpatialGroup* group)
 	{
 		LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
 		if(!drawable)
-		{
+	{
 			continue;
 		}
 		LLVOVolume* volume = drawable->getVOVolume();
@@ -3783,10 +3781,10 @@ class LLOctreeRenderNonOccluded : public OctreeTraveler
 		{
 			LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
 			if(!drawable)
-			{
+		{
 				continue;
 			}
-
+					
 			if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
 			{
 				renderBoundingBox(drawable);			
@@ -3869,7 +3867,7 @@ class LLOctreeRenderNonOccluded : public OctreeTraveler
 						{
 							if (index < 255)
 							{
-								if (facep->mDrawInfo->mTextureList.size()<= index)
+								if (facep->mDrawInfo->mTextureList.size() <= index)
 								{
 									llerrs << "Face texture index out of bounds." << llendl;
 								}
@@ -3979,7 +3977,7 @@ class LLOctreePushBBoxVerts : public OctreeTraveler
 		{
 			LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
 			if(!drawable)
-			{
+		{
 				continue;
 			}
 			renderBoundingBox(drawable, FALSE);			
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index a2e2bf45d666a347b371c278864ce3cb164e4df4..b592e73403b72a14b0c03ef3ee280bc735235edf 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -228,7 +228,7 @@ class LLSpatialGroup : public LLviewerOctreeGroup
 	typedef std::map<U32, drawmap_elem_t > draw_map_t;	
 	typedef std::vector<LLPointer<LLVertexBuffer> > buffer_list_t;
 	typedef std::map<LLFace*, buffer_list_t> buffer_texture_map_t;
-	typedef std::map<U32, buffer_texture_map_t> buffer_map_t;	
+	typedef std::map<U32, buffer_texture_map_t> buffer_map_t;
 
 	struct CompareDistanceGreater
 	{
@@ -304,7 +304,7 @@ class LLSpatialGroup : public LLviewerOctreeGroup
 	void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
 
 	LLSpatialGroup* getParent();
-	
+
 	BOOL addObject(LLDrawable *drawablep);
 	BOOL removeObject(LLDrawable *drawablep, BOOL from_octree = FALSE);
 	BOOL updateInGroup(LLDrawable *drawablep, BOOL immediate = FALSE); // Update position if it's in the group
@@ -323,7 +323,7 @@ class LLSpatialGroup : public LLviewerOctreeGroup
 
 	void setState(U32 state)       {mState |= state;}
 	void dirtyGeom() { setState(GEOM_DIRTY); }
-	void dirtyMesh() { setState(MESH_DIRTY); }		
+	void dirtyMesh() { setState(MESH_DIRTY); }
 
 	void drawObjectBox(LLColor4 col);
 
@@ -332,7 +332,7 @@ class LLSpatialGroup : public LLviewerOctreeGroup
 	virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face);
 	virtual void handleDestruction(const TreeNode* node);
 	virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
-	
+
 //-------------------
 //for atlas use
 //-------------------
@@ -395,7 +395,7 @@ class LLSpatialGroup : public LLviewerOctreeGroup
 
 	U32 mBufferUsage;
 	draw_map_t mDrawMap;
-		
+	
 	F32 mDistance;
 	F32 mDepth;
 	F32 mLastUpdateDistance;
@@ -464,7 +464,7 @@ class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManag
 	void resetVertexBuffers();
 	BOOL isOcclusionEnabled();
 	BOOL getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax);
-	
+
 public:
 	LLSpatialBridge* mBridge; // NULL for non-LLSpatialBridge instances, otherwise, mBridge == this
 							// use a pointer instead of making "isBridge" and "asBridge" virtual so it's safe
@@ -478,7 +478,7 @@ class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManag
 	U32 mLODPeriod;	//number of frames between LOD updates for a given spatial group (staggered by mLODSeed)
 	U32 mVertexDataMask;
 	F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25);
-	BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering	
+	BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering
 };
 
 // class for creating bridges between spatial partitions
@@ -513,7 +513,7 @@ class LLSpatialBridge : public LLDrawable, public LLSpatialPartition
 
 };
 
-class LLCullResult
+class LLCullResult 
 {
 public:
 	LLCullResult();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
old mode 100755
new mode 100644
index 2effec7d3aa53a9bfec98a0575b14db9a4ed3882..cf2b491d6c5bb985f3cca37c46319cb6912a5f72
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -3303,7 +3303,7 @@ bool process_login_success_response()
 		// replace the default help URL format
 		gSavedSettings.setString("HelpURLFormat",text);
 	}
-			
+
 	std::string home_location = response["home"];
 	if(!home_location.empty())
 	{
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
old mode 100755
new mode 100644
diff --git a/indra/newview/lltexlayerparams.h b/indra/newview/lltexlayerparams.h
index fffe20208f4a1bb8d6c1cf32ab1d0d13f1c69fa6..c812199796f91a839a1c3e575248fbc5506a99c6 100644
--- a/indra/newview/lltexlayerparams.h
+++ b/indra/newview/lltexlayerparams.h
@@ -58,6 +58,7 @@ class LLTexLayerParam : public LLViewerVisualParam
 // LLTexLayerParamAlpha
 // 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL_ALIGN_PREFIX(16)
 class LLTexLayerParamAlpha : public LLTexLayerParam
 {
 public:
@@ -65,8 +66,6 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 	LLTexLayerParamAlpha( LLVOAvatar* avatar );
 	/*virtual*/ ~LLTexLayerParamAlpha();
 
-	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
-
 	void* operator new(size_t size)
 	{
 		return ll_aligned_malloc_16(size);
@@ -77,6 +76,8 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 		ll_aligned_free_16(ptr);
 	}
 
+	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
+
 	// LLVisualParam Virtual functions
 	///*virtual*/ BOOL		parseData(LLXmlTreeNode* node);
 	/*virtual*/ void		apply( ESex avatar_sex ) {}
@@ -104,7 +105,7 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 	LLPointer<LLImageRaw>	mStaticImageRaw;
 	BOOL					mNeedsCreateTexture;
 	BOOL					mStaticImageInvalid;
-	LLVector4a				mAvgDistortionVec;
+	LL_ALIGN_16(LLVector4a				mAvgDistortionVec);
 	F32						mCachedEffectiveWeight;
 
 public:
@@ -114,7 +115,7 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 
 	typedef std::list< LLTexLayerParamAlpha* > param_alpha_ptr_list_t;
 	static param_alpha_ptr_list_t sInstances;
-};
+} LL_ALIGN_POSTFIX(16);
 class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo
 {
 	friend class LLTexLayerParamAlpha;
@@ -138,6 +139,8 @@ class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo
 // LLTexLayerParamColor
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+LL_ALIGN_PREFIX(16)
 class LLTexLayerParamColor : public LLTexLayerParam
 {
 public:
@@ -151,7 +154,6 @@ class LLTexLayerParamColor : public LLTexLayerParam
 
 	LLTexLayerParamColor( LLTexLayerInterface* layer );
 	LLTexLayerParamColor( LLVOAvatar* avatar );
-	/* virtual */ ~LLTexLayerParamColor();
 
 	void* operator new(size_t size)
 	{
@@ -163,6 +165,8 @@ class LLTexLayerParamColor : public LLTexLayerParam
 		ll_aligned_free_16(ptr);
 	}
 
+	/* virtual */ ~LLTexLayerParamColor();
+
 	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
 
 	// LLVisualParam Virtual functions
@@ -186,8 +190,8 @@ class LLTexLayerParamColor : public LLTexLayerParam
 protected:
 	virtual void onGlobalColorChanged(bool upload_bake) {}
 private:
-	LLVector4a				mAvgDistortionVec;
-};
+	LL_ALIGN_16(LLVector4a				mAvgDistortionVec);
+} LL_ALIGN_POSTFIX(16);
 
 class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo
 {
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
old mode 100644
new mode 100755
index 0dc2601e60e25739b20801737f5f0bf903dd3817..8bf7bcc398de7f9928b6d3e974361ede15f920ab
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -353,13 +353,13 @@ class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler
 
 	// Threads:  Tmain
 	/*virtual*/ bool deleteOK(); // called from update()
-	
+
 	~LLTextureFetchWorker();
 
 	// Threads:  Ttf
 	// Locks:  Mw
 	S32 callbackHttpGet(LLCore::HttpResponse * response,
-						 bool partial, bool success);
+						bool partial, bool success);
 
 	// Threads:  Ttc
 	void callbackCacheRead(bool success, LLImageFormatted* image,
@@ -384,7 +384,7 @@ class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler
 	bool getCanUseHTTP() const { return mCanUseHTTP; }
 
 	LLTextureFetch & getFetcher() { return *mFetcher; }
-	
+
 	// Inherited from LLCore::HttpHandler
 	// Threads:  Ttf
 	virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
@@ -563,7 +563,7 @@ class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler
 	U8 mImageCodec;
 
 	LLViewerAssetStats::duration_t mMetricsStartTime;
-			
+
 	LLCore::HttpHandle		mHttpHandle;				// Handle of any active request
 	LLCore::BufferArray	*	mHttpBufferArray;			// Refcounted pointer to response data 
 	int						mHttpPolicyClass;
@@ -571,7 +571,7 @@ class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler
 	unsigned int			mHttpReplySize;				// Actual received data size
 	unsigned int			mHttpReplyOffset;			// Actual received data offset
 	bool					mHttpHasResource;			// Counts against Fetcher's mHttpSemaphore
-		
+
 	// State history
 	U32						mCacheReadCount;
 	U32						mCacheWriteCount;
@@ -1349,16 +1349,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			recordTextureDone(false);
 		}
 		else
-			{
+		{
 			mFetcher->addToNetworkQueue(this); // failsafe
 			setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
 			recordTextureStart(false);
-			}
-		return false;
 		}
+		return false;
+	}
 	
 	if (mState == WAIT_HTTP_RESOURCE)
-		{
+	{
 		// NOTE:
 		// control the number of the http requests issued for:
 		// 1, not openning too many file descriptors at the same time;
@@ -1367,19 +1367,19 @@ bool LLTextureFetchWorker::doWork(S32 param)
 		// If it looks like we're busy, keep this request here.
 		// Otherwise, advance into the HTTP states.
 		if (mFetcher->getHttpWaitersCount() || ! acquireHttpSemaphore())
-			{
+		{
 			mState = WAIT_HTTP_RESOURCE2;
 			setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
 			mFetcher->addHttpWaiter(this->mID);
 			++mResourceWaitCount;
 			return false;
-			}
+		}
 		
 		mState = SEND_HTTP_REQ;
 		// *NOTE:  You must invoke releaseHttpSemaphore() if you transition
 		// to a state other than SEND_HTTP_REQ or WAIT_HTTP_REQ or abort
 		// the request.
-		}
+	}
 
 	if (mState == WAIT_HTTP_RESOURCE2)
 	{
@@ -1395,33 +1395,33 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			return true; // abort
 		}
 
-			mFetcher->removeFromNetworkQueue(this, false);
+		mFetcher->removeFromNetworkQueue(this, false);
 			
-			S32 cur_size = 0;
-			if (mFormattedImage.notNull())
+		S32 cur_size = 0;
+		if (mFormattedImage.notNull())
+		{
+			cur_size = mFormattedImage->getDataSize(); // amount of data we already have
+			if (mFormattedImage->getDiscardLevel() == 0)
 			{
-				cur_size = mFormattedImage->getDataSize(); // amount of data we already have
-				if (mFormattedImage->getDiscardLevel() == 0)
+				if (cur_size > 0)
 				{
-					if(cur_size > 0)
-					{
-						// We already have all the data, just decode it
-						mLoadedDiscard = mFormattedImage->getDiscardLevel();
-						setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
-						mState = DECODE_IMAGE;
+					// We already have all the data, just decode it
+					mLoadedDiscard = mFormattedImage->getDiscardLevel();
+					setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
+					mState = DECODE_IMAGE;
 					releaseHttpSemaphore();
-						return false;
-					}
-					else
-					{
+					return false;
+				}
+				else
+				{
 					releaseHttpSemaphore();
-						return true ; //abort.
-					}
+					return true; // abort.
 				}
 			}
-			mRequestedSize = mDesiredSize;
-			mRequestedDiscard = mDesiredDiscard;
-			mRequestedSize -= cur_size;
+		}
+		mRequestedSize = mDesiredSize;
+		mRequestedDiscard = mDesiredDiscard;
+		mRequestedSize -= cur_size;
 		mRequestedOffset = cur_size;
 		if (mRequestedOffset)
 		{
@@ -1437,20 +1437,20 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			mRequestedOffset -= 1;
 			mRequestedSize += 1;
 		}
-			
+		
 		mHttpHandle = LLCORE_HTTP_HANDLE_INVALID;
-			if (!mUrl.empty())
-			{
-				mRequestedTimer.reset();
-				mLoaded = FALSE;
+		if (!mUrl.empty())
+		{
+			mRequestedTimer.reset();
+			mLoaded = FALSE;
 			mGetStatus = LLCore::HttpStatus();
-				mGetReason.clear();
+			mGetReason.clear();
 			LL_DEBUGS("Texture") << "HTTP GET: " << mID << " Offset: " << mRequestedOffset
-									 << " Bytes: " << mRequestedSize
-									 << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << mFetcher->mMaxBandwidth
-									 << LL_ENDL;
+								 << " Bytes: " << mRequestedSize
+								 << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << mFetcher->mMaxBandwidth
+								 << LL_ENDL;
 
-				// Will call callbackHttpGet when curl request completes
+			// Will call callbackHttpGet when curl request completes
 			mHttpHandle = mFetcher->mHttpRequest->requestGetByteRange(mHttpPolicyClass,
 																	  mWorkPriority,
 																	  mUrl,
@@ -1459,14 +1459,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
 																	  mFetcher->mHttpOptions,
 																	  mFetcher->mHttpHeaders,
 																	  this);
-			}
+		}
 		if (LLCORE_HTTP_HANDLE_INVALID == mHttpHandle)
-			{
-				llwarns << "HTTP GET request failed for " << mID << llendl;
-				resetFormattedData();
+		{
+			llwarns << "HTTP GET request failed for " << mID << llendl;
+			resetFormattedData();
 			releaseHttpSemaphore();
-				return true; // failed
-			}
+			return true; // failed
+		}
 
 		mHttpActive = true;
 		mFetcher->addToHTTPQueue(mID);
@@ -1474,8 +1474,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
 		setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
 		mState = WAIT_HTTP_REQ;	
 		
-			// fall through
-		}
+		// fall through
+	}
 	
 	if (mState == WAIT_HTTP_REQ)
 	{
@@ -1497,15 +1497,15 @@ bool LLTextureFetchWorker::doWork(S32 param)
 
 					llwarns << "Texture missing from server (404): " << mUrl << llendl;
 
-					//roll back to try UDP
-					if(mCanUseNET)
+					// roll back to try UDP
+					if (mCanUseNET)
 					{
-						mState = INIT ;
-						mCanUseHTTP = false ;
+						mState = INIT;
+						mCanUseHTTP = false;
 						mUrl.clear();
 						setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
 						releaseHttpSemaphore();
-						return false ;
+						return false;
 					}
 				}
 				else if (http_service_unavail == mGetStatus)
@@ -1525,23 +1525,23 @@ bool LLTextureFetchWorker::doWork(S32 param)
 							<< llendl;
 				}
 
-					mUrl.clear();
-					if (cur_size > 0)
-					{
-						// Use available data
-						mLoadedDiscard = mFormattedImage->getDiscardLevel();
-						setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
-						mState = DECODE_IMAGE;
+				mUrl.clear();
+				if (cur_size > 0)
+				{
+					// Use available data
+					mLoadedDiscard = mFormattedImage->getDiscardLevel();
+					setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
+					mState = DECODE_IMAGE;
 					releaseHttpSemaphore();
-						return false; 
-					}
+					return false; 
+				}
 
 				// Fail harder
-						resetFormattedData();
-						mState = DONE;
+				resetFormattedData();
+				mState = DONE;
 				releaseHttpSemaphore();
-						return true; // failed
-					}
+				return true; // failed
+			}
 			
 			// Clear the url since we're done with the fetch
 			// Note: mUrl is used to check is fetching is required so failure to clear it will force an http fetch
@@ -1550,17 +1550,17 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			{
 				mUrl.clear();
 			}
-
+			
 			if (! mHttpBufferArray || ! mHttpBufferArray->size())
 			{
 				// no data received.
 				if (mHttpBufferArray)
-			{
+				{
 					mHttpBufferArray->release();
 					mHttpBufferArray = NULL;
 				}
 
-				//abort.
+				// abort.
 				mState = DONE;
 				releaseHttpSemaphore();
 				return true;
@@ -1628,7 +1628,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			
 			mLoadedDiscard = mRequestedDiscard;
 			mState = DECODE_IMAGE;
-			if(mWriteToCacheState != NOT_WRITE)
+			if (mWriteToCacheState != NOT_WRITE)
 			{
 				mWriteToCacheState = SHOULD_WRITE ;
 			}
@@ -1655,7 +1655,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 		static LLCachedControl<bool> textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled");
 
 		setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
-		if(textures_decode_disabled)
+		if (textures_decode_disabled)
 		{
 			// for debug use, don't decode
 			mState = DONE;
@@ -1885,7 +1885,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe
 		{
 			gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ;
 		}
-}
+	}
 
 	mFetcher->removeFromHTTPQueue(mID, data_size);
 	
@@ -2066,7 +2066,7 @@ bool LLTextureFetchWorker::processSimulatorPackets()
 // Threads:  Ttf
 // Locks:  Mw
 S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
-										   bool partial, bool success)
+										  bool partial, bool success)
 {
 	S32 data_size = 0 ;
 
@@ -2086,10 +2086,11 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
 		// get length of stream:
 		LLCore::BufferArray * body(response->getBody());
 		data_size = body ? body->size() : 0;
-	
+
 		LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL;
 		if (data_size > 0)
 		{
+			LLViewerStatsRecorder::instance().textureFetch(data_size);
 			// *TODO: set the formatted image data here directly to avoid the copy
 
 			// Hold on to body for later copy
@@ -2164,6 +2165,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
 	mLoaded = TRUE;
 	setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
 
+	LLViewerStatsRecorder::instance().log(0.2f);
 	return data_size ;
 }
 
@@ -2366,7 +2368,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
 
 LLTextureFetch::~LLTextureFetch()
 {
-	clearDeleteList() ;
+	clearDeleteList();
 
 	while (! mCommands.empty())
 	{
@@ -2374,7 +2376,7 @@ LLTextureFetch::~LLTextureFetch()
 		mCommands.erase(mCommands.begin());
 		delete req;
 	}
-	
+
 	if (mHttpOptions)
 	{
 		mHttpOptions->release();
@@ -2650,7 +2652,7 @@ U32 LLTextureFetch::getTotalNumHTTPRequests()
 	U32 size = mTotalHTTPRequests;
 	mNetworkQueueMutex.unlock();										// -Mfq
 
-	return size ;
+	return size;
 }
 
 // call lockQueue() first!
@@ -2672,7 +2674,7 @@ LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id)
 {
 	LLMutexLock lock(&mQueueMutex);										// +Mfq
 
-	return getWorkerAfterLock(id) ;
+	return getWorkerAfterLock(id);
 }																		// -Mfq
 
 
@@ -2830,7 +2832,7 @@ S32 LLTextureFetch::update(F32 max_time_ms)
 
 	{
 		mNetworkQueueMutex.lock();										// +Mfnq
-		mMaxBandwidth = band_width ;
+		mMaxBandwidth = band_width;
 
 		add(LLStatViewer::TEXTURE_KBIT, mHTTPTextureBits);
 		mHTTPTextureBits = 0;
@@ -2856,7 +2858,7 @@ S32 LLTextureFetch::update(F32 max_time_ms)
 		commonUpdate();
 	}
 
-	if(mFetchDebugger)
+	if (mFetchDebugger)
 	{
 		mFetchDebugger->tryToStopDebug(); //check if need to stop debugger.
 	}
@@ -2864,7 +2866,7 @@ S32 LLTextureFetch::update(F32 max_time_ms)
 	return res;
 }
 
-//called in the MAIN thread after the TextureCacheThread shuts down.
+// called in the MAIN thread after the TextureCacheThread shuts down.
 //
 // Threads:  Tmain
 void LLTextureFetch::shutDownTextureCacheThread() 
@@ -2876,7 +2878,7 @@ void LLTextureFetch::shutDownTextureCacheThread()
 	}
 }
 	
-//called in the MAIN thread after the ImageDecodeThread shuts down.
+// called in the MAIN thread after the ImageDecodeThread shuts down.
 //
 // Threads:  Tmain
 void LLTextureFetch::shutDownImageDecodeThread() 
@@ -2920,7 +2922,7 @@ void LLTextureFetch::threadedUpdate()
 #endif
 	
 	commonUpdate();
-
+	
 #if 0
 	const F32 INFO_TIME = 1.0f; 
 	static LLFrameTimer info_timer;
@@ -2965,46 +2967,46 @@ void LLTextureFetch::sendRequestListToSimulators()
 	work_request_map_t requests;
 	{
 		LLMutexLock lock2(&mNetworkQueueMutex);							// +Mfnq
-	for (queue_t::iterator iter = mNetworkQueue.begin(); iter != mNetworkQueue.end(); )
-	{
-		queue_t::iterator curiter = iter++;
-		LLTextureFetchWorker* req = getWorker(*curiter);
-		if (!req)
-		{
-			mNetworkQueue.erase(curiter);
-			continue; // paranoia
-		}
-		if ((req->mState != LLTextureFetchWorker::LOAD_FROM_NETWORK) &&
-			(req->mState != LLTextureFetchWorker::LOAD_FROM_SIMULATOR))
-		{
-			// We already received our URL, remove from the queue
-			llwarns << "Worker: " << req->mID << " in mNetworkQueue but in wrong state: " << req->mState << llendl;
-			mNetworkQueue.erase(curiter);
-			continue;
-		}
-		if (req->mID == mDebugID)
-		{
-			mDebugCount++; // for setting breakpoints
-		}
-		if (req->mSentRequest == LLTextureFetchWorker::SENT_SIM &&
-			req->mTotalPackets > 0 &&
-			req->mLastPacket >= req->mTotalPackets-1)
+		for (queue_t::iterator iter = mNetworkQueue.begin(); iter != mNetworkQueue.end(); )
 		{
-			// We have all the packets... make sure this is high priority
+			queue_t::iterator curiter = iter++;
+			LLTextureFetchWorker* req = getWorker(*curiter);
+			if (!req)
+			{
+				mNetworkQueue.erase(curiter);
+				continue; // paranoia
+			}
+			if ((req->mState != LLTextureFetchWorker::LOAD_FROM_NETWORK) &&
+				(req->mState != LLTextureFetchWorker::LOAD_FROM_SIMULATOR))
+			{
+				// We already received our URL, remove from the queue
+				llwarns << "Worker: " << req->mID << " in mNetworkQueue but in wrong state: " << req->mState << llendl;
+				mNetworkQueue.erase(curiter);
+				continue;
+			}
+			if (req->mID == mDebugID)
+			{
+				mDebugCount++; // for setting breakpoints
+			}
+			if (req->mSentRequest == LLTextureFetchWorker::SENT_SIM &&
+				req->mTotalPackets > 0 &&
+				req->mLastPacket >= req->mTotalPackets-1)
+			{
+				// We have all the packets... make sure this is high priority
 // 			req->setPriority(LLWorkerThread::PRIORITY_HIGH | req->mWorkPriority);
-			continue;
-		}
-		F32 elapsed = req->mRequestedTimer.getElapsedTimeF32();
-		{
-			F32 delta_priority = llabs(req->mRequestedPriority - req->mImagePriority);
-			if ((req->mSimRequestedDiscard != req->mDesiredDiscard) ||
-				(delta_priority > MIN_DELTA_PRIORITY && elapsed >= MIN_REQUEST_TIME) ||
-				(elapsed >= SIM_LAZY_FLUSH_TIMEOUT))
+				continue;
+			}
+			F32 elapsed = req->mRequestedTimer.getElapsedTimeF32();
 			{
-				requests[req->mHost].insert(req);
+				F32 delta_priority = llabs(req->mRequestedPriority - req->mImagePriority);
+				if ((req->mSimRequestedDiscard != req->mDesiredDiscard) ||
+					(delta_priority > MIN_DELTA_PRIORITY && elapsed >= MIN_REQUEST_TIME) ||
+					(elapsed >= SIM_LAZY_FLUSH_TIMEOUT))
+				{
+					requests[req->mHost].insert(req);
+				}
 			}
 		}
-	}
 	}																	// -Mfnq
 
 	for (work_request_map_t::iterator iter1 = requests.begin();
@@ -3086,49 +3088,49 @@ void LLTextureFetch::sendRequestListToSimulators()
 	// Send cancelations
 	{
 		LLMutexLock lock2(&mNetworkQueueMutex);							// +Mfnq
-	if (gMessageSystem && !mCancelQueue.empty())
-	{
-		for (cancel_queue_t::iterator iter1 = mCancelQueue.begin();
-			 iter1 != mCancelQueue.end(); ++iter1)
+		if (gMessageSystem && !mCancelQueue.empty())
 		{
-			LLHost host = iter1->first;
-			if (host == LLHost::invalid)
+			for (cancel_queue_t::iterator iter1 = mCancelQueue.begin();
+				 iter1 != mCancelQueue.end(); ++iter1)
 			{
-				host = gAgent.getRegionHost();
-			}
-			S32 request_count = 0;
-			for (queue_t::iterator iter2 = iter1->second.begin();
-				 iter2 != iter1->second.end(); ++iter2)
-			{
-				if (0 == request_count)
+				LLHost host = iter1->first;
+				if (host == LLHost::invalid)
 				{
-					gMessageSystem->newMessageFast(_PREHASH_RequestImage);
-					gMessageSystem->nextBlockFast(_PREHASH_AgentData);
-					gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
-					gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+					host = gAgent.getRegionHost();
 				}
-				gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
-				gMessageSystem->addUUIDFast(_PREHASH_Image, *iter2);
-				gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, -1);
-				gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, 0);
-				gMessageSystem->addU32Fast(_PREHASH_Packet, 0);
-				gMessageSystem->addU8Fast(_PREHASH_Type, 0);
+				S32 request_count = 0;
+				for (queue_t::iterator iter2 = iter1->second.begin();
+					 iter2 != iter1->second.end(); ++iter2)
+				{
+					if (0 == request_count)
+					{
+						gMessageSystem->newMessageFast(_PREHASH_RequestImage);
+						gMessageSystem->nextBlockFast(_PREHASH_AgentData);
+						gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+						gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+					}
+					gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
+					gMessageSystem->addUUIDFast(_PREHASH_Image, *iter2);
+					gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, -1);
+					gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, 0);
+					gMessageSystem->addU32Fast(_PREHASH_Packet, 0);
+					gMessageSystem->addU8Fast(_PREHASH_Type, 0);
 // 				llinfos << "CANCELING IMAGE REQUEST: " << (*iter2) << llendl;
 
-				request_count++;
-				if (request_count >= IMAGES_PER_REQUEST)
+					request_count++;
+					if (request_count >= IMAGES_PER_REQUEST)
+					{
+						gMessageSystem->sendSemiReliable(host, NULL, NULL);
+						request_count = 0;
+					}
+				}
+				if (request_count > 0 && request_count < IMAGES_PER_REQUEST)
 				{
 					gMessageSystem->sendSemiReliable(host, NULL, NULL);
-					request_count = 0;
 				}
 			}
-			if (request_count > 0 && request_count < IMAGES_PER_REQUEST)
-			{
-				gMessageSystem->sendSemiReliable(host, NULL, NULL);
-			}
+			mCancelQueue.clear();
 		}
-		mCancelQueue.clear();
-	}
 	}																	// -Mfnq
 }
 
@@ -3210,7 +3212,11 @@ bool LLTextureFetch::receiveImageHeader(const LLHost& host, const LLUUID& id, U8
 		return false;
 	}
 
-	worker->lockWorkMutex();											// +Mw
+	LLViewerStatsRecorder::instance().textureFetch(data_size);
+	LLViewerStatsRecorder::instance().log(0.1f);
+
+	worker->lockWorkMutex();
+
 
 	//	Copy header data into image object
 	worker->mImageCodec = codec;
@@ -3258,7 +3264,11 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
 		return false;
 	}
 
-	worker->lockWorkMutex();											// +Mw
+	LLViewerStatsRecorder::instance().textureFetch(data_size);
+	LLViewerStatsRecorder::instance().log(0.1f);
+
+	worker->lockWorkMutex();
+
 	
 	res = worker->insertPacket(packet_num, data, data_size);
 	
@@ -3275,7 +3285,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
 		removeFromNetworkQueue(worker, true); // failsafe
 	}
 
-	if(packet_num >= (worker->mTotalPackets - 1))
+	if (packet_num >= (worker->mTotalPackets - 1))
 	{
 		static LLCachedControl<bool> log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog");
 		static LLCachedControl<bool> log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator");
@@ -3303,7 +3313,7 @@ BOOL LLTextureFetch::isFromLocalCache(const LLUUID& id)
 	if (worker)
 	{
 		worker->lockWorkMutex();										// +Mw
-		from_cache = worker->mInLocalCache ;
+		from_cache = worker->mInLocalCache;
 		worker->unlockWorkMutex();										// -Mw
 	}
 
@@ -3762,7 +3772,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
 	if (S32_MAX == ++report_sequence)
 		report_sequence = 0;
 	reporting_started = true;
-
+	
 	// Limit the size of the stats report if necessary.
 	
 	sd["truncated"] = truncate_viewer_metrics(10, sd);
@@ -4092,7 +4102,7 @@ void LLTextureFetchDebugger::tryToStopDebug()
 			{
 				mTextureCache->readComplete(mFetchingHistory[i].mCacheHandle, true);
 			}
-		}	
+ 		}	
 		break;
 	case WRITE_CACHE:
 		for(S32 i = 0 ; i < size; i++)
@@ -4331,7 +4341,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
 	if (mNbCurlRequests > HTTP_REQUESTS_IN_QUEUE_LOW_WATER)
 	{
 		return mNbCurlRequests;
-	}	
+	}
 	
 	S32 size = mFetchingHistory.size();
 	for (S32 i = 0 ; i < size ; i++)
@@ -4348,7 +4358,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
 		requestedSize = llmax(0,requestedSize);
 		// We request the whole file if the size was set to an absurdly high value (meaning all file)
 		requestedSize = (requestedSize == 33554432 ? 0 : requestedSize);
-		
+
 		LLCore::HttpHandle handle = mFetcher->getHttpRequest().requestGetByteRange(mHttpPolicyClass,
 																				   LLWorkerThread::PRIORITY_LOWBITS,
 																				   texture_url,
@@ -4361,7 +4371,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
 		{
 			mHandleToFetchIndex[handle] = i;
 			mFetchingHistory[i].mHttpHandle = handle;
-		mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS;
+			mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS;
 			mNbCurlRequests++;
 			// Hack
 			if (mNbCurlRequests == HTTP_REQUESTS_IN_QUEUE_HIGH_WATER)	// emulate normal pipeline
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index 2e398023fe1275392d0c9100fde0c38b1f88f89e..4dcb9dd4b82698b6b3ea266db715e3e7e65b185e 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -65,8 +65,8 @@ class LLTextureFetch : public LLWorkerThread
 	class TFRequest;
 	
     // Threads:  Tmain
-	/*virtual*/ S32 update(F32 max_time_ms);	
-
+	/*virtual*/ S32 update(F32 max_time_ms);
+	
 	// called in the main thread after the TextureCacheThread shuts down.
     // Threads:  Tmain
 	void shutDownTextureCacheThread();
@@ -126,8 +126,8 @@ class LLTextureFetch : public LLWorkerThread
 	void dump();
 
 	// Threads:  T*
-	S32 getNumRequests() ;
-	
+	S32 getNumRequests();
+
 	// Threads:  T*
 	S32 getNumHTTPRequests();
 
@@ -220,7 +220,7 @@ class LLTextureFetch : public LLWorkerThread
 	void getStateStats(U32 * cache_read, U32 * cache_write, U32 * res_wait);
 
 	// ----------------------------------
-
+	
 protected:
 	// Threads:  T* (but Ttf in practice)
 	void addToNetworkQueue(LLTextureFetchWorker* worker);
@@ -240,7 +240,7 @@ class LLTextureFetch : public LLWorkerThread
 	//
 	// Threads:  T*
 	void removeRequest(LLTextureFetchWorker* worker, bool cancel);
-
+	
 	// Overrides from the LLThread tree
 	// Locks:  Ct
 	bool runCondition();
@@ -313,7 +313,7 @@ class LLTextureFetch : public LLWorkerThread
 
 	LLTextureCache* mTextureCache;
 	LLImageDecodeThread* mImageDecodeThread;
-
+	
 	// Map of all requests by UUID
 	typedef std::map<LLUUID,LLTextureFetchWorker*> map_t;
 	map_t mRequestMap;													// Mfq
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index da7b25937705094898cb34518a5b998778911454..548cb7da7b4e08d366984a7cfa602cf6499714cb 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -76,7 +76,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
 	mShowToolbars(true),
 	mDragToolbarButton(NULL),
 	mDragItem(NULL),
-	mToolbarsLoaded(false)
+	mToolbarsLoaded(false),
+	mBottomToolbarPanel(NULL)
 {
 	for (S32 i = 0; i < TOOLBAR_COUNT; i++)
 	{
@@ -100,6 +101,7 @@ BOOL LLToolBarView::postBuild()
 	mToolbars[TOOLBAR_LEFT]   = getChild<LLToolBar>("toolbar_left");
 	mToolbars[TOOLBAR_RIGHT]  = getChild<LLToolBar>("toolbar_right");
 	mToolbars[TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom");
+	mBottomToolbarPanel = getChild<LLView>("bottom_toolbar_panel");
 
 	for (int i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
 	{
@@ -535,8 +537,8 @@ void LLToolBarView::draw()
 	for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
 	{
 		mToolbars[i]->getParent()->setVisible(mShowToolbars 
-												&& (mToolbars[i]->hasButtons() 
-													|| isToolDragged()));
+											&& (mToolbars[i]->hasButtons() 
+											|| isToolDragged()));
 	}
 
 	// Draw drop zones if drop of a tool is active
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index 9c4194ebed1ce1c78a40f24bcd579d40f752e63f..7125dd9990495e64bb020bdc760881480bbf8060 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -108,7 +108,8 @@ class LLToolBarView : public LLUICtrl
 	static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
 	static void resetDragTool(LLToolBarButton* toolbarButton);
 	LLInventoryObject* getDragItem();
-
+	LLView* getBottomToolbar() { return mBottomToolbarPanel; }
+	LLToolBar* getToolbar(EToolBarLocation toolbar) { return mToolbars[toolbar]; }
 	bool isModified() const;
 	
 protected:
@@ -133,6 +134,7 @@ class LLToolBarView : public LLUICtrl
 	LLToolBarButton*	mDragToolbarButton;
 	LLInventoryObject*	mDragItem;
 	bool				mShowToolbars;
+	LLView*				mBottomToolbarPanel;
 };
 
 extern LLToolBarView* gToolBarView;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 3cd761b73b52cbf0b932e8480d8cf79784645f9c..a0c12df834f436072149be4a5e18694a8aa19bfb 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -125,9 +125,10 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask)
 	mPick.mKeyMask = mask;
 
 	// claim not handled so UI focus stays same
-	
-	handleRightClickPick();
-	
+	if(gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+	{
+		handleRightClickPick();
+	}
 	return FALSE;
 }
 
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index dec1615246ccd50dc22ef0b6ef779f69915ea173..051f5f44853240d6fd397b0eca9d83ea31e5452a 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -72,6 +72,8 @@
 #include "llpanellogin.h"
 #include "llpaneltopinfobar.h"
 #include "llspellcheck.h"
+#include "llslurl.h"
+#include "llstartup.h"
 #include "llupdaterservice.h"
 
 // Third party library includes
@@ -496,6 +498,20 @@ bool handleForceShowGrid(const LLSD& newvalue)
 	return true;
 }
 
+bool handleLoginLocationChanged()
+{
+	/*
+	 * This connects the default preference setting to the state of the login
+	 * panel if it is displayed; if you open the preferences panel before
+	 * logging in, and change the default login location there, the login
+	 * panel immediately changes to match your new preference.
+	 */
+	std::string new_login_location = gSavedSettings.getString("LoginLocation");
+	LL_DEBUGS("AppInit")<<new_login_location<<LL_ENDL;
+	LLStartUp::setStartSLURL(LLSLURL(new_login_location));
+	return true;
+}
+
 bool handleSpellCheckChanged()
 {
 	if (gSavedSettings.getBOOL("SpellCheck"))
@@ -721,6 +737,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2));
 	gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
 	gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
+	gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged));
 }
 
 #if TEST_CACHED_CONTROL
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 47059b0b8c3f9bad975f76dce650f7e935c5d3a5..2df028de69c098fcf3f58c64c4c0f316b62fa332 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -316,9 +316,13 @@ LOG_CLASS(LLViewerMediaWebProfileResponder);
 	/* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
 	{
 		LL_WARNS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
-		LL_WARNS("MediaAuth") << content << LL_ENDL;
+
+		LLSD stripped_content = content;
+		stripped_content.erase("set-cookie");
+		LL_WARNS("MediaAuth") << stripped_content << LL_ENDL;
 
 		std::string cookie = content["set-cookie"].asString();
+		LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL;
 
 		LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost);
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index d66287f172ecd8995a36f8c4944786db0069b42e..eebf4f0beaedebb2264a35a45698a712aa55c6de 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -167,7 +167,6 @@ LLContextMenu	*gMenuAttachmentSelf = NULL;
 LLContextMenu	*gMenuAttachmentOther = NULL;
 LLContextMenu	*gMenuLand	= NULL;
 
-const std::string SAVE_INTO_INVENTORY("Save Object Back to My Inventory");
 const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents");
 
 LLMenuGL* gAttachSubMenu = NULL;
@@ -312,7 +311,6 @@ void handle_grab_baked_texture(void*);
 BOOL enable_grab_baked_texture(void*);
 void handle_dump_region_object_cache(void*);
 
-BOOL enable_save_into_inventory(void*);
 BOOL enable_save_into_task_inventory(void*);
 
 BOOL enable_detach(const LLSD& = LLSD());
@@ -1645,6 +1643,54 @@ class LLAdvancedForceParamsToDefault : public view_listener_t
 };
 
 
+//////////////////////////
+//   ANIMATION SPEED    //
+//////////////////////////
+
+// Utility function to set all AV time factors to the same global value
+static void set_all_animation_time_factors(F32	time_factor)
+{
+	LLMotionController::setCurrentTimeFactor(time_factor);
+	for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
+		iter != LLCharacter::sInstances.end(); ++iter)
+	{
+		(*iter)->setAnimTimeFactor(time_factor);
+	}
+}
+
+class LLAdvancedAnimTenFaster : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		//llinfos << "LLAdvancedAnimTenFaster" << llendl;
+		F32 time_factor = LLMotionController::getCurrentTimeFactor();
+		time_factor = llmin(time_factor + 0.1f, 2.f);	// Upper limit is 200% speed
+		set_all_animation_time_factors(time_factor);
+		return true;
+	}
+};
+
+class LLAdvancedAnimTenSlower : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		//llinfos << "LLAdvancedAnimTenSlower" << llendl;
+		F32 time_factor = LLMotionController::getCurrentTimeFactor();
+		time_factor = llmax(time_factor - 0.1f, 0.1f);	// Lower limit is at 10% of normal speed
+		set_all_animation_time_factors(time_factor);
+		return true;
+	}
+};
+
+class LLAdvancedAnimResetAll : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		set_all_animation_time_factors(1.f);
+		return true;
+	}
+};
+
 
 //////////////////////////
 // RELOAD VERTEX SHADER //
@@ -3915,6 +3961,8 @@ class LLViewToggleUI : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
 	{
+		if(gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+		{
 		LLNotification::Params params("ConfirmHideUI");
 		params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2));
 		LLSD substitutions;
@@ -3924,7 +3972,7 @@ class LLViewToggleUI : public view_listener_t
 		substitutions["SHORTCUT"] = "Ctrl+Shift+U";
 #endif
 		params.substitutions = substitutions;
-		if (gViewerWindow->getUIVisibility())
+			if (!gSavedSettings.getBOOL("HideUIControls"))
 		{
 			// hiding, so show notification
 			LLNotifications::instance().add(params);
@@ -3933,7 +3981,7 @@ class LLViewToggleUI : public view_listener_t
 		{
 			LLNotifications::instance().forceResponse(params, 0);
 		}
-
+		}
 		return true;
 	}
 
@@ -3943,8 +3991,9 @@ class LLViewToggleUI : public view_listener_t
 
 		if (option == 0) // OK
 		{
-			gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility());
-			LLPanelStandStopFlying::getInstance()->setVisible(gViewerWindow->getUIVisibility());
+			gViewerWindow->setUIVisibility(gSavedSettings.getBOOL("HideUIControls"));
+			LLPanelStandStopFlying::getInstance()->setVisible(gSavedSettings.getBOOL("HideUIControls"));
+			gSavedSettings.setBOOL("HideUIControls",!gSavedSettings.getBOOL("HideUIControls"));
 		}
 	}
 };
@@ -4773,18 +4822,6 @@ BOOL sitting_on_selection()
 	return (gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == root_object);
 }
 
-class LLToolsSaveToInventory : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		if(enable_save_into_inventory(NULL))
-		{
-			derez_objects(DRD_SAVE_INTO_AGENT_INVENTORY, LLUUID::null);
-		}
-		return true;
-	}
-};
-
 class LLToolsSaveToObjectInventory : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -7077,50 +7114,6 @@ bool LLHasAsset::operator()(LLInventoryCategory* cat,
 	return FALSE;
 }
 
-BOOL enable_save_into_inventory(void*)
-{
-	// *TODO: clean this up
-	// find the last root
-	LLSelectNode* last_node = NULL;
-	for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
-		 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
-	{
-		last_node = *iter;
-	}
-
-#ifdef HACKED_GODLIKE_VIEWER
-	return TRUE;
-#else
-# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
-	if (!LLGridManager::getInstance()->isInProductionGrid()
-        && gAgent.isGodlike())
-	{
-		return TRUE;
-	}
-# endif
-	// check all pre-req's for save into inventory.
-	if(last_node && last_node->mValid && !last_node->mItemID.isNull()
-	   && (last_node->mPermissions->getOwner() == gAgent.getID())
-	   && (gInventory.getItem(last_node->mItemID) != NULL))
-	{
-		LLViewerObject* obj = last_node->getObject();
-		if( obj && !obj->isAttachment() )
-		{
-			return TRUE;
-		}
-	}
-	return FALSE;
-#endif
-}
-
-class LLToolsEnableSaveToInventory : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		bool new_value = enable_save_into_inventory(NULL);
-		return new_value;
-	}
-};
 
 BOOL enable_save_into_task_inventory(void*)
 {
@@ -7502,6 +7495,7 @@ class LLToolsUseSelectionForGrid : public view_listener_t
 		} func;
 		LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func);
 		LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT);
+		LLFloaterTools::setGridMode((S32)GRID_MODE_REF_OBJECT);
 		return true;
 	}
 };
@@ -8329,7 +8323,6 @@ void initialize_menus()
 	commit.add("Tools.LookAtSelection", boost::bind(&handle_look_at_selection, _2));
 	commit.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take));
 	commit.add("Tools.TakeCopy", boost::bind(&handle_take_copy));
-	view_listener_t::addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory");
 	view_listener_t::addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory");
 	view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction");
 
@@ -8341,7 +8334,6 @@ void initialize_menus()
 	enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy));
 	enable.add("Tools.VisibleBuyObject", boost::bind(&tools_visible_buy_object));
 	enable.add("Tools.VisibleTakeObject", boost::bind(&tools_visible_take_object));
-	view_listener_t::addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory");
 	view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory");
 
 	view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding");
@@ -8452,6 +8444,11 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale");
 	view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale");
 	
+	// Advanced > Character > Animation Speed
+	view_listener_t::addMenu(new LLAdvancedAnimTenFaster(), "Advanced.AnimTenFaster");
+	view_listener_t::addMenu(new LLAdvancedAnimTenSlower(), "Advanced.AnimTenSlower");
+	view_listener_t::addMenu(new LLAdvancedAnimResetAll(), "Advanced.AnimResetAll");
+
 	// Advanced > Character (toplevel)
 	view_listener_t::addMenu(new LLAdvancedForceParamsToDefault(), "Advanced.ForceParamsToDefault");
 	view_listener_t::addMenu(new LLAdvancedReloadVertexShader(), "Advanced.ReloadVertexShader");
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 3515aa4302cfe614340fae22d1134ba8781f6935..2eb458fa0237e1ea9233db1adf5f75971731b7db 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -49,7 +49,6 @@ void show_context_menu( S32 x, S32 y, MASK mask );
 void show_build_mode_context_menu(S32 x, S32 y, MASK mask);
 void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y);
 void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y);
-BOOL enable_save_into_inventory(void*);
 void handle_reset_view();
 void handle_cut(void*);
 void handle_copy(void*);
@@ -159,8 +158,6 @@ class LLViewerMenuHolderGL : public LLMenuHolderGL
 	LLSafeHandle<LLObjectSelection> mObjectSelection;
 };
 
-extern const std::string SAVE_INTO_INVENTORY;
-
 extern LLMenuBarGL*		gMenuBarView;
 //extern LLView*			gMenuBarHolder;
 extern LLMenuGL*		gEditMenu;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 483e42d2960f468d90fe1e138ad72f312dbdcd93..4b1c9c55743225db52546c83e5a07d34cfcfaa21 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4490,7 +4490,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
 {
 	LLFastTimer t(FTM_PROCESS_OBJECTS);
 
-	LLUUID id;
+	LLUUID		id;
 
 	U32 ip = mesgsys->getSenderIP();
 	U32 port = mesgsys->getSenderPort();
@@ -4532,22 +4532,22 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
 			continue;
 		}
 
-		LLViewerObject *objectp = gObjectList.findObject(id);
-		if (objectp)
-		{
-			// Display green bubble on kill
-			if ( gShowObjectUpdates )
+			LLViewerObject *objectp = gObjectList.findObject(id);
+			if (objectp)
 			{
-				LLColor4 color(0.f,1.f,0.f,1.f);
-				gPipeline.addDebugBlip(objectp->getPositionAgent(), color);
-			}
+				// Display green bubble on kill
+				if ( gShowObjectUpdates )
+				{
+					LLColor4 color(0.f,1.f,0.f,1.f);
+					gPipeline.addDebugBlip(objectp->getPositionAgent(), color);
+				}
 
-			// Do the kill
-			gObjectList.killObject(objectp);
-		}
+				// Do the kill
+				gObjectList.killObject(objectp);
+			}
 
 		if(delete_object)
-		{
+			{
 			regionp->killCacheEntry(local_id);
 		}
 
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 556b4375a9aa6603f89d23bdc1aa58f1aae041ec..d5d804bc578e31c66fa945990e3c213579fee03f 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -350,7 +350,7 @@ void LLViewerObject::markDead()
 			childp = mChildList.back();
 			if (childp->getPCode() != LL_PCODE_LEGACY_AVATAR)
 			{
-				//llinfos << "Marking child " << childp->getLocalID() << " as dead." << llendl;				
+				//llinfos << "Marking child " << childp->getLocalID() << " as dead." << llendl;
 				childp->setParent(NULL); // LLViewerObject::markDead 1
 				childp->markDead();
 			}
@@ -1056,11 +1056,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 
 	if(mesgsys != NULL)
 	{
-		U16 time_dilation16;
-		mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16);
-		F32 time_dilation = ((F32) time_dilation16) / 65535.f;
-		mTimeDilation = time_dilation;
-		mRegionp->setTimeDilation(time_dilation);
+	U16 time_dilation16;
+	mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16);
+	F32 time_dilation = ((F32) time_dilation16) / 65535.f;
+	mTimeDilation = time_dilation;
+	mRegionp->setTimeDilation(time_dilation);
 	}
 
 	// this will be used to determine if we've really changed position
@@ -1373,7 +1373,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 					coloru.mV[3] = 255 - coloru.mV[3];
 					mText->setColor(LLColor4(coloru));
 					mText->setString(temp_string);
-					
+
 					setChanged(MOVED | SILHOUETTE);
 				}
 				else if (mText.notNull())
@@ -1870,7 +1870,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 
 				if(mesgsys != NULL)
 				{
-					LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+				LLViewerObjectList::getUUIDFromLocal(parent_uuid,
 														parent_id,
 														mesgsys->getSenderIP(),
 														mesgsys->getSenderPort());
@@ -2009,7 +2009,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 
 					if(mesgsys != NULL)
 					{
-						LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+					LLViewerObjectList::getUUIDFromLocal(parent_uuid,
 														parent_id,
 														gMessageSystem->getSenderIP(),
 														gMessageSystem->getSenderPort());
@@ -2161,14 +2161,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 	// doing all the parenting, etc above?
 	if(mesgsys != NULL)
 	{
-		U32 packet_id = mesgsys->getCurrentRecvPacketID(); 
-		if (packet_id < mLatestRecvPacketID && 
-			mLatestRecvPacketID - packet_id < 65536)
-		{
-			//skip application of this message, it's old
-			return retval;
-		}
-		mLatestRecvPacketID = packet_id;
+	U32 packet_id = mesgsys->getCurrentRecvPacketID(); 
+	if (packet_id < mLatestRecvPacketID && 
+		mLatestRecvPacketID - packet_id < 65536)
+	{
+		//skip application of this message, it's old
+		return retval;
+	}
+	mLatestRecvPacketID = packet_id;
 	}
 
 	// Set the change flags for scale
@@ -2225,7 +2225,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 		|| (new_angv != old_angv))
 	{
 		if (new_rot != mPreviousRotation)
-	{
+		{
 			resetRot();
 		}
 		else if (new_angv != old_angv)
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 1e79042012c0f3e534ef4b183ffea0cc805c3e3a..942eb678233bc9f9323bc2b396a85242040ee274 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -647,7 +647,7 @@ class LLViewerObject
 	LLPointer<LLHUDText> mText;
 	LLPointer<LLHUDIcon> mIcon;
 
-	static	BOOL				sUseSharedDrawables;
+	static			BOOL		sUseSharedDrawables;
 	static	LLTrace::MemStatHandle	sMemStat;
 
 protected:
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 0700ac025c26d5235544e91d1a763b826a99a443..5ccb19ab2e3d19e789c11ef6e4efed1e4bbd1b3c 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -262,7 +262,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	// so that the drawable parent is set properly
 	if(msg != NULL)
 	{
-		findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
+	findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
 	}
 	else
 	{
@@ -451,9 +451,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 
 		if (compressed)
 		{
-			S32	uncompressed_length = 2048;
-			compressed_dp.reset();			
-			
+			S32							uncompressed_length = 2048;
+			compressed_dp.reset();
+
 			uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
 			mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
 			compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
@@ -626,9 +626,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 					bCached = true;
 					LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp, flags);
 					recorder.cacheFullUpdate(local_id, update_type, result, objectp, msg_size);
-				}
 			}
 #endif
+		}
 		}
 		else
 		{
@@ -2023,7 +2023,7 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L
 
 	return objectp;
 }
- 
+
 LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp,
 												 const LLUUID &uuid, const U32 local_id, const LLHost &sender)
 {
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index b052c87064da6e550722fe15d9576f5ef96d85e0..d8f9ecf2484c43085cb54e199ab2895a348af322 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -393,8 +393,8 @@ LLViewerRegion::~LLViewerRegion()
 	delete mParcelOverlay;
 	delete mImpl->mLandp;
 	delete mImpl->mEventPoll;
-	LLHTTPSender::clearSender(mImpl->mHost);	
-
+	LLHTTPSender::clearSender(mImpl->mHost);
+	
 	std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer());
 
 	saveObjectCache();
@@ -1117,8 +1117,8 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
 	max_update_time -= update_timer.getElapsedTimeF32();
 	if(max_update_time < 0.f || mImpl->mCacheMap.empty())
 	{
-		return did_update;
-	}
+	return did_update;
+}
 
 	sCurRegionp = this;
 
@@ -1879,12 +1879,12 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec
 }
 
 LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id)
-{
+	{
 	LLVOCacheEntry* entry = getCacheEntry(local_id);
 	removeFromVOCacheTree(entry);
-
+		
 	return entry;
-}
+	}
 
 LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id)
 {
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index dd86ef4f3440d20192c9ec05d404819ae28a024e..78775c7205a0778946978faf24b0a75715252edb 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2029,18 +2029,19 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 	if (success)
 	{
 		gObjectPreviewProgram.mName = "Simple Shader";
-		gObjectPreviewProgram.mFeatures.calculatesLighting = true;
-		gObjectPreviewProgram.mFeatures.calculatesAtmospherics = true;
-		gObjectPreviewProgram.mFeatures.hasGamma = true;
-		gObjectPreviewProgram.mFeatures.hasAtmospherics = true;
-		gObjectPreviewProgram.mFeatures.hasLighting = true;
+		gObjectPreviewProgram.mFeatures.calculatesLighting = false;
+		gObjectPreviewProgram.mFeatures.calculatesAtmospherics = false;
+		gObjectPreviewProgram.mFeatures.hasGamma = false;
+		gObjectPreviewProgram.mFeatures.hasAtmospherics = false;
+		gObjectPreviewProgram.mFeatures.hasLighting = false;
 		gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0;
 		gObjectPreviewProgram.mFeatures.disableTextureIndex = true;
 		gObjectPreviewProgram.mShaderFiles.clear();
 		gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER_ARB));
-		gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gObjectPreviewProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
 		success = gObjectPreviewProgram.createShader(NULL, NULL);
+		gObjectPreviewProgram.mFeatures.hasLighting = true;
 	}
 
 	if (success)
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
old mode 100755
new mode 100644
index 0e2c53ee5b9800ca0b42ad45bdc7286925cd7504..fa4eb73180ed875fa36917eac1153f2c79bb4c19
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -526,8 +526,8 @@ void send_stats()
 		}
 		else
 		{
-		shader_level = 3;
-	}
+			shader_level = 3;
+		}
 	}
 	else if (gPipeline.canUseWindLightShadersOnObjects())
 	{
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 00e8c66b54bc8dfe009054d5fa7e7637ac2caa32..e94ba2316304e5f6922b8605847948d48edbad0b 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -216,7 +216,7 @@ class LLViewerStats : public LLSingleton<LLViewerStats>
 		U32 mCountOfNextUpdatesToIgnore;
 
 		inline StatsAccumulator()
-		{	
+		{
 			reset();
 		}
 
@@ -315,7 +315,7 @@ class LLViewerStats : public LLSingleton<LLViewerStats>
 private:
 	LLTrace::Recording				mRecording;
 
-	F64								mLastTimeDiff;  // used for time stat updates
+	F64 mLastTimeDiff;  // used for time stat updates
 };
 
 static const F32 SEND_STATS_PERIOD = 300.0f;
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index 482f6a77a3f30a179c353d6bba0ab0348f5fc996..61d0f02fc121ada57923524f708cb5ac0f353b5e 100644
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -222,15 +222,15 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
 			}
 		}
 		else
-		{
+	{
 			//llwarns << "Couldn't open " << STATS_FILE_NAME << " for logging." << llendl;
 			return;
 		}
 	}
 
-	std::ostringstream data_msg;
+		std::ostringstream data_msg;
 
-	data_msg << getTimeSinceStart()
+		data_msg << getTimeSinceStart()
 		<< "\t " << mObjectCacheHitCount
 		<< "\t" << mObjectCacheMissFullCount
 		<< "\t" << mObjectCacheMissCrcCount
@@ -250,7 +250,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
 		<< "\t" << (mObjectTerseUpdatesSize * 8 / delta_time)
 		<< "\t" << (mObjectCacheMissResponsesSize * 8 / delta_time)
 		<< "\t" << (mTextureFetchSize * 8 / delta_time)
-		<< "\n";
+			<< "\n";
 
 	if (fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile ) != data_msg.str().size())
 	{
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 76210563bb3f923edd37f709e19fcc46a9a9d0bf..7edfa6adfabcb6825ab1a03960cebc7975ce2f2c 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1931,13 +1931,13 @@ void LLViewerFetchedTexture::updateVirtualSize()
 				{
 					if (getBoostLevel() == LLViewerTexture::BOOST_NONE && 
 						drawable->getVObj() && drawable->getVObj()->isSelected())
-		{
+					{
 						setBoostLevel(LLViewerTexture::BOOST_SELECTED);
 					}
-			addTextureStats(facep->getVirtualSize()) ;
-			setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
-		}
-	}
+					addTextureStats(facep->getVirtualSize()) ;
+					setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
+				}
+			}
 		}
 	}
 
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
old mode 100755
new mode 100644
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 899ef985ffb59636b9f1f6603c6b81f31a67f9cf..0066c0972012cd6ab2ff2d80ad102d4e7a89d360 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1710,11 +1710,11 @@ bool LLUIImageList::initFromFile()
 	// add components defined in the rest of the skin paths
 	while (++pi != pend)
 	{
-	LLXMLNodePtr update_root;
+		LLXMLNodePtr update_root;
 		if (LLXMLNode::parseFile(*pi, update_root, NULL))
-	{
+		{
 			parser.readXUI(update_root, images, *pi);
-	}
+		}
 	}
 
 	if (!images.validateBlock()) return false;
diff --git a/indra/newview/llviewervisualparam.h b/indra/newview/llviewervisualparam.h
index 3bc95cbfbfbf42d5963232cd744cfbc08807270f..2826e6c31661b8877b57cbcb214bbbf4c8083385 100644
--- a/indra/newview/llviewervisualparam.h
+++ b/indra/newview/llviewervisualparam.h
@@ -65,6 +65,7 @@ class LLViewerVisualParamInfo : public LLVisualParamInfo
 // VIRTUAL CLASS
 // a viewer side interface class for a generalized parametric modification of the avatar mesh
 //-----------------------------------------------------------------------------
+LL_ALIGN_PREFIX(16)
 class LLViewerVisualParam : public LLVisualParam
 {
 public:
@@ -104,6 +105,6 @@ class LLViewerVisualParam : public LLVisualParam
 
 	BOOL				getCrossWearable() const 	{ return getInfo()->mCrossWearable; }
 
-};
+} LL_ALIGN_POSTFIX(16);
 
 #endif // LL_LLViewerVisualParam_H
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0bd0b2a769ab660a944bb2f7b39bf295dec0b920..fea44a38c6a8d07b51146c27702be899750c8d4b 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1935,9 +1935,9 @@ void LLViewerWindow::initWorldUI()
 	panel_ssf_container->addChild(panel_stand_stop_flying);
 
 	panel_ssf_container->setVisible(TRUE);
-
-	LLMenuOptionPathfindingRebakeNavmesh::getInstance()->initialize();
 	
+	LLMenuOptionPathfindingRebakeNavmesh::getInstance()->initialize();
+
 	// Load and make the toolbars visible
 	// Note: we need to load the toolbars only *after* the user is logged in and IW
 	if (gToolBarView)
@@ -4275,12 +4275,12 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
 
 		if (!reset_deferred)
 		{
-		// if image cropping or need to enlarge the scene, compute a scale_factor
-		F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
-		snapshot_width  = (S32)(ratio * image_width) ;
-		snapshot_height = (S32)(ratio * image_height) ;
-		scale_factor = llmax(1.0f, 1.0f / ratio) ;
-	}
+			// if image cropping or need to enlarge the scene, compute a scale_factor
+			F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
+			snapshot_width  = (S32)(ratio * image_width) ;
+			snapshot_height = (S32)(ratio * image_height) ;
+			scale_factor = llmax(1.0f, 1.0f / ratio) ;
+		}
 	}
 	
 	if (show_ui && scale_factor > 1.f)
@@ -4482,7 +4482,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
 	{
 		send_agent_resume();
 	}
-
+	
 	return ret;
 }
 
@@ -5001,7 +5001,7 @@ S32 LLViewerWindow::getChatConsoleBottomPad()
 	S32 offset = 0;
 
 	if(gToolBarView)
-		offset += gToolBarView->getChild<LLView>("bottom_toolbar_panel")->getRect().getHeight();
+		offset += gToolBarView->getBottomToolbar()->getRect().getHeight();
 
 	return offset;
 }
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
old mode 100755
new mode 100644
index 4ecb7f2fc7d2cd19c4e052f53fc30d9ae0453008..427555211764589930b5f24ca0f187c41ed8a350
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -810,7 +810,7 @@ U32  LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys,
 		// unpack the texture UUIDs to the texture slots
 		if(mesgsys != NULL)
 		{
-			retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
+		retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
 		}
 		// need to trigger a few operations to get the avatar to use the new bakes
 		for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
@@ -2216,7 +2216,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics()
 	{
 		LLCurlRequest::headers_t headers;
 		LLHTTPClient::post(caps_url,
-							msg,
+						   msg,
 						   new ViewerAppearanceChangeMetricsResponder(report_sequence,
 																	  report_sequence,
 																	  reporting_started));
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2056aed0ad6521003ed4e5d612a335eda24610e8..12f268d3243d8f9b09dda43a5e530cf398ac83c1 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1138,16 +1138,28 @@ void LLVOVolume::sculpt()
 		S32 current_discard = getVolume()->getSculptLevel() ;
 		if(current_discard < -2)
 		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
+			static S32 low_sculpty_discard_warning_count = 100;
+			if (++low_sculpty_discard_warning_count >= 100)
+			{	// Log first time, then every 100 afterwards otherwise this can flood the logs
+				llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() 
+					<< " at " << current_discard 
 				<< " is less than -2." << llendl;
+				low_sculpty_discard_warning_count = 0;
+			}
 			
 			// corrupted volume... don't update the sculpty
 			return;
 		}
 		else if (current_discard > MAX_DISCARD_LEVEL)
 		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
+			static S32 high_sculpty_discard_warning_count = 100;
+			if (++high_sculpty_discard_warning_count >= 100)
+			{	// Log first time, then every 100 afterwards otherwise this can flood the logs
+				llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() 
+					<< " at " << current_discard 
 				<< " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl;
+				high_sculpty_discard_warning_count = 0;
+			}
 			
 			// corrupted volume... don't update the sculpty			
 			return;
@@ -1483,7 +1495,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
 
 	updateRadius();
 	mDrawable->movePartition();
-			
+				
 	return res;
 }
 
@@ -4024,10 +4036,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 	else
 	{
 		model_mat = &(drawable->getRegion()->mRenderMatrix);
-		if (model_mat->isIdentity())
-		{
-			model_mat = NULL;
-		}
 	}
 
 	//drawable->getVObj()->setDebugText(llformat("%d", drawable->isState(LLDrawable::ANIMATED_CHILD)));
@@ -4644,10 +4652,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 			LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
 			if(drawablep)
 			{
-				drawablep->clearState(LLDrawable::REBUILD_ALL);
-			}
+			drawablep->clearState(LLDrawable::REBUILD_ALL);
 		}
 	}
+	}
 
 	group->mLastUpdateTime = gFrameTimeSeconds;
 	group->mBuilt = 1.f;
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index aba9df24c9704f38bcfb1d222e512199591886db..12eea513da524350260574b50381692a789ed15d 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -652,8 +652,8 @@ void LLWorld::updateVisibilities()
 void LLWorld::updateRegions(F32 max_update_time)
 {
 	LLTimer update_timer;
-	BOOL did_one = FALSE;	
-
+	BOOL did_one = FALSE;
+	
 	// Perform idle time updates for the regions (and associated surfaces)
 	for (region_list_t::iterator iter = mRegionList.begin();
 		 iter != mRegionList.end(); ++iter)
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 355fa1350b437275f02edb429c4b761765c0321c..26ceaf512a058d36a801ff55ee5a7c7617aed8d6 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -762,7 +762,16 @@ void LLPipeline::resizeScreenTexture()
 		GLuint resX = gViewerWindow->getWorldViewWidthRaw();
 		GLuint resY = gViewerWindow->getWorldViewHeightRaw();
 	
-		allocateScreenBuffer(resX,resY);
+		if (!allocateScreenBuffer(resX,resY))
+		{ //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled
+			//NOTE: if the session closes successfully after this call, deferred rendering will be 
+			// disabled on future sessions
+			if (LLPipeline::sRenderDeferred)
+			{
+				gSavedSettings.setBOOL("RenderDeferred", FALSE);
+				LLPipeline::refreshCachedSettings();
+			}
+		}
 	}
 }
 
@@ -780,7 +789,7 @@ void LLPipeline::allocatePhysicsBuffer()
 bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 {
 	refreshCachedSettings();
-
+	
 	bool save_settings = sRenderDeferred;
 	if (save_settings)
 	{
@@ -815,7 +824,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 
 LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY)
 {
-	//try to allocate screen buffers at requested resolution and samples
+	// try to allocate screen buffers at requested resolution and samples
 	// - on failure, shrink number of samples and try again
 	// - if not multisampled, shrink resolution and try again (favor X resolution over Y)
 	// Make sure to call "releaseScreenBuffers" after each failure to cleanup the partially loaded state
@@ -2063,10 +2072,10 @@ void check_references(LLSpatialGroup* group, LLFace* face)
 		LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
 		if(drawable)
 		{
-			check_references(drawable, face);
-		}
+		check_references(drawable, face);
 	}			
 }
+}
 
 void LLPipeline::checkReferences(LLFace* face)
 {
@@ -2470,7 +2479,7 @@ void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)
 	}
 
 	assertInitialized();
-		
+	
 	if (!group->mSpatialPartition->mRenderByGroup)
 	{ //render by drawable
 		sCull->pushDrawableGroup(group);
@@ -3223,7 +3232,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 		}
 	}
 		
-	postSort(camera);
+	postSort(camera);	
 
 	LLSceneMonitor::getInstance()->fetchQueryResult();
 }
@@ -6100,7 +6109,7 @@ void LLPipeline::enableLightsPreview()
 	
 	LLVector4 light_pos(dir0, 0.0f);
 
-	LLLightState* light = gGL.getLight(0);
+	LLLightState* light = gGL.getLight(1);
 
 	light->enable();
 	light->setPosition(light_pos);
@@ -6112,7 +6121,7 @@ void LLPipeline::enableLightsPreview()
 
 	light_pos = LLVector4(dir1, 0.f);
 
-	light = gGL.getLight(1);
+	light = gGL.getLight(2);
 	light->enable();
 	light->setPosition(light_pos);
 	light->setDiffuse(diffuse1);
@@ -6122,7 +6131,7 @@ void LLPipeline::enableLightsPreview()
 	light->setSpotCutoff(180.f);
 
 	light_pos = LLVector4(dir2, 0.f);
-	light = gGL.getLight(2);
+	light = gGL.getLight(3);
 	light->enable();
 	light->setPosition(light_pos);
 	light->setDiffuse(diffuse2);
diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
index ea44fd493ec01de3a596bbc1615712aaf0d61981..178987962b8d5fcd56c0ce9224226d578f8917bb 100644
--- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
@@ -6,7 +6,7 @@
  height="570"
  help_topic="sidebar_inventory"
  min_width="333"
- min_height="560"
+ min_height="570"
  name="floater_my_inventory"
  save_rect="true"
  save_visibility="true"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
index e91f5af3d53cdf4db7f768b3887cc285a3ef804a..29720a680b21d1353e5c2ecfe5f15624d675b632 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
@@ -3,7 +3,7 @@
  layout="topleft"
  left="0"
  mouse_opaque="false"
- can_tear_off="true"
+ can_tear_off="false"
  name="menu_inventory_add"
  visible="false">
             <menu
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 7e5b5ed1e9b554475b6106cd79e601dc544d11ac..a52c2b3192fb38bee58c9ca1f31ef7bb07d8f0a6 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -884,14 +884,6 @@
 			<menu_item_call.on_enable
                function="Tools.EnableTakeCopy" />
           </menu_item_call>
-          <menu_item_call
-			 label="Save Back to My Inventory"
-			 name="Save Object Back to My Inventory">
-			<menu_item_call.on_click
-               function="Tools.SaveToInventory" />
-			<menu_item_call.on_enable
-               function="Tools.EnableSaveToInventory" />
-          </menu_item_call>
           <menu_item_call
 			 label="Save Back to Object Contents"
 			 name="Save Object Back to Object Contents">
@@ -3222,6 +3214,40 @@
                      parameter="AllowSelectAvatar" />
                 </menu_item_check>
             </menu>
+            <menu
+             create_jump_keys="true"
+             label="Animation Speed"
+             name="Animation Speed"
+             tear_off="true">
+                <menu_item_call
+                 label="All Animations 10% Faster"
+                 name="All Animations 10 Faster">
+                    <menu_item_call.on_click
+                     function="Advanced.AnimTenFaster" />
+                </menu_item_call>
+                <menu_item_call
+                 label="All Animations 10% Slower"
+                 name="All Animations 10 Slower">
+                    <menu_item_call.on_click
+                     function="Advanced.AnimTenSlower" />
+                </menu_item_call>
+                <menu_item_call
+                 label="Reset All Animation Speed"
+                 name="Reset All Animation Speed">
+                    <menu_item_call.on_click
+                     function="Advanced.AnimResetAll" />
+                </menu_item_call>
+				<menu_item_check
+				 label="Slow Motion Animations"
+				 name="Slow Motion Animations">
+					<menu_item_check.on_check
+					 function="CheckControl"
+					 parameter="SlowMotionAnimation" />
+					<menu_item_check.on_click
+					 function="ToggleControl"
+					 parameter="SlowMotionAnimation" />
+				</menu_item_check>
+            </menu>
             <menu_item_call
              label="Force Params to Default"
              name="Force Params to Default">
@@ -3238,16 +3264,6 @@
                  function="Advanced.ToggleAnimationInfo"
                  parameter="" />
             </menu_item_check>
-            <menu_item_check
-             label="Slow Motion Animations"
-             name="Slow Motion Animations">
-                <menu_item_check.on_check
-                 function="CheckControl"
-                 parameter="SlowMotionAnimation" />
-                <menu_item_check.on_click
-                 function="ToggleControl"
-                 parameter="SlowMotionAnimation" />
-            </menu_item_check>
             <menu_item_check
              label="Show Look At"
              name="Show Look At">
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9dae77a3042bf7ed48036c3e7f5968be78d64bf8..c8f5cbb2b015209d797cfd0c4e0a88495f95285d 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1291,6 +1291,45 @@ Visit [_URL] for more information?
     <tag>fail</tag>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="AMDOldDriver"
+   type="alertmodal">
+    There is likely a newer driver for your graphics chip.  Updating graphics drivers can substantially improve performance.
+
+    Visit [_URL] to check for driver updates?
+    <tag>confirm</tag>
+    <url option="0" name="url">
+      http://support.amd.com/us/Pages/AMDSupportHub.aspx
+    </url>
+    <usetemplate
+     ignoretext="My graphics driver is out of date"
+     name="okcancelignore"
+     notext="No"
+     yestext="Yes"/>
+    <tag>fail</tag>
+  </notification>
+
+  <notification
+ icon="alertmodal.tga"
+ name="NVIDIAOldDriver"
+ type="alertmodal">
+    There is likely a newer driver for your graphics chip.  Updating graphics drivers can substantially improve performance.
+
+    Visit [_URL] to check for driver updates?
+    <tag>confirm</tag>
+    <url option="0" name="url">
+      http://www.nvidia.com/Download/index.aspx?lang=en-us
+    </url>
+    <usetemplate
+     ignoretext="My graphics driver is out of date"
+     name="okcancelignore"
+     notext="No"
+     yestext="Yes"/>
+    <tag>fail</tag>
+  </notification>
+
+
   <notification
    icon="alertmodal.tga"
    name="UnknownGPU"
@@ -6744,7 +6783,7 @@ Is this OK?
    type="notify">
 Warning: The object &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; wants total access to your Linden Dollars account. If you allow access, it can remove funds from your account at any time, or empty your account completely, on an ongoing basis with no additional warnings.
   
-It is rare that such a request is legitimate. Do not allow access if you do not fully understand why it wants access to your account.
+Do not allow access if you do not fully understand why it wants access to your account.
 
   <tag>confirm</tag>
     <form name="form">
@@ -8252,4 +8291,1651 @@ Attempt cancelled.
      yestext="Yes"/>
   </notification>
 
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarFrozen"
+   type="notify">
+   <tag>fail</tag>
+[AV_FREEZER] has frozen you. You cannot move or interact with the world.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarFrozenDuration"
+   type="notify">
+   <tag>fail</tag>
+[AV_FREEZER] has frozen you for [AV_FREEZE_TIME] seconds. You cannot move or interact with the world.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="YouFrozeAvatar"
+   type="notify">
+   <tag>fail</tag>
+Avatar frozen.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarHasUnFrozenYou"
+   type="notify">
+   <tag>fail</tag>
+[AV_FREEZER] has unfrozen you.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarUnFrozen"
+   type="notify">
+   <tag>fail</tag>
+Avatar unfrozen.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarFreezeFailure"
+   type="notify">
+   <tag>fail</tag>
+Freeze failed because you don't have admin permission for that parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarFreezeThaw"
+   type="notify">
+   <tag>fail</tag>
+Your freeze expired, go about your business.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarCantFreeze"
+   type="notify">
+   <tag>fail</tag>
+Sorry, can't freeze that user.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NowOwnObject"
+   type="notify">
+   <tag>fail</tag>
+You are now the owner of object [OBJECT_NAME]
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantRezOnLand"
+   type="notify">
+   <tag>fail</tag>
+Can't rez object at [OBJECT_POS] because the owner of this land does not allow it.  Use the land tool to see land ownership.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RezFailTooManyRequests"
+   type="notify">
+   <tag>fail</tag>
+Object can not be rezzed because there are too many requests.
+  </notification>
+ 
+  <notification
+   icon="alertmodal.tga"
+   name="SitFailCantMove"
+   type="notify">
+   <tag>fail</tag>
+You cannot sit because you cannot move at this time.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SitFailNotAllowedOnLand"
+   type="notify">
+   <tag>fail</tag>
+You cannot sit because you are not allowed on that land.
+  </notification>
+ 
+  <notification
+   icon="alertmodal.tga"
+   name="SitFailNotSameRegion"
+   type="notify">
+   <tag>fail</tag>
+Try moving closer.  Can't sit on object because
+it is not in the same region as you.
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="NoNewObjectRegionFull"
+   type="notify">
+   <tag>fail</tag>
+Unable to create new object. The region is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="FailedToPlaceObject"
+   type="notify">
+   <tag>fail</tag>
+Failed to place object at specified location.  Please try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoOwnNoGardening"
+   type="notify">
+   <tag>fail</tag>
+You Can't create trees and grass on land you don't own.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoCopyPermsNoObject"
+   type="notify">
+   <tag>fail</tag>
+Copy failed because you lack permission to copy the object '[OBJ_NAME]'.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoTransPermsNoObject"
+   type="notify">
+   <tag>fail</tag>
+Copy failed because the object '[OBJ_NAME]' cannot be transferred to you.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AddToNavMeshNoCopy"
+   type="notify">
+   <tag>fail</tag>
+Copy failed because the object '[OBJ_NAME]' contributes to navmesh.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="DupeWithNoRootsSelected"
+   type="notify">
+   <tag>fail</tag>
+Duplicate with no root objects selected.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDupeCuzRegionIsFull"
+   type="notify">
+   <tag>fail</tag>
+Can't duplicate objects because the region is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDupeCuzParcelNotFound"
+   type="notify">
+   <tag>fail</tag>
+Can't duplicate objects - Can't find the parcel they are on.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateCuzParcelFull"
+   type="notify">
+   <tag>fail</tag>
+Can't create object because 
+the parcel is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RezAttemptFailed"
+   type="notify">
+   <tag>fail</tag>
+Attempt to rez an object failed.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ToxicInvRezAttemptFailed"
+   type="notify">
+   <tag>fail</tag>
+Unable to create item that has caused problems on this region.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="InvItemIsBlacklisted"
+   type="notify">
+   <tag>fail</tag>
+That inventory item has been blacklisted.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoCanRezObjects"
+   type="notify">
+   <tag>fail</tag>
+You are not currently allowed to create objects.
+  </notification>
+ 
+  <notification
+   icon="alertmodal.tga"
+   name="LandSearchBlocked"
+   type="notify">
+   <tag>fail</tag>
+Land Search Blocked.
+You have performed too many land searches too quickly.
+Please try again in a minute.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NotEnoughResourcesToAttach"
+   type="notify">
+   <tag>fail</tag>
+Not enough script resources available to attach object!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="YouDiedAndGotTPHome"
+   type="notify">
+   <tag>fail</tag>
+You died and have been teleported to your home location
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="EjectComingSoon"
+   type="notify">
+   <tag>fail</tag>
+You are no longer allowed here and have [EJECT_TIME] seconds to leave.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoEnterServerFull"
+   type="notify">
+   <tag>fail</tag>
+You can't enter this region because 
+the server is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SaveBackToInvDisabled"
+   type="notify">
+   <tag>fail</tag>
+Save Back To Inventory has been disabled.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoExistNoSaveToContents"
+   type="notify">
+   <tag>fail</tag>
+Cannot save '[OBJ_NAME]' to object contents because the object it was rezzed from no longer exists.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoModNoSaveToContents"
+   type="notify">
+   <tag>fail</tag>
+Cannot save '[OBJ_NAME]' to object contents because you do not have permission to modify the object '[DEST_NAME]'.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoSaveBackToInvDisabled"
+   type="notify">
+   <tag>fail</tag>
+Cannot save '[OBJ_NAME]' back to inventory -- this operation has been disabled.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoCopyNoSelCopy"
+   type="notify">
+   <tag>fail</tag>
+You cannot copy your selection because you do not have permission to copy the object '[OBJ_NAME]'.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoTransNoSelCopy"
+   type="notify">
+   <tag>fail</tag>
+You cannot copy your selection because the object '[OBJ_NAME]' is not transferrable.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoTransNoCopy"
+   type="notify">
+   <tag>fail</tag>
+You cannot copy your selection because the object '[OBJ_NAME]' is not transferrable.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermsNoRemoval"
+   type="notify">
+   <tag>fail</tag>
+Removal of the object '[OBJ_NAME]' from the simulator is disallowed by the permissions system.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoModNoSaveSelection"
+   type="notify">
+   <tag>fail</tag>
+Cannot save your selection because you do not have permission to modify the object '[OBJ_NAME]'.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoCopyNoSaveSelection"
+   type="notify">
+   <tag>fail</tag>
+Cannot save your selection because the object '[OBJ_NAME]' is not copyable.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoModNoTaking"
+   type="notify">
+   <tag>fail</tag>
+You cannot take your selection because you do not have permission to modify the object '[OBJ_NAME]'.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RezDestInternalError"
+   type="notify">
+   <tag>fail</tag>
+Internal Error: Unknown destination type.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="DeleteFailObjNotFound"
+   type="notify">
+   <tag>fail</tag>
+Delete failed because object not found
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SorryCantEjectUser"
+   type="notify">
+   <tag>fail</tag>
+Sorry, can't eject that user.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RegionSezNotAHome"
+   type="notify">
+   <tag>fail</tag>
+This region does not allow you to set your home location here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="HomeLocationLimits"
+   type="notify">
+   <tag>fail</tag>
+You can only set your 'Home Location' on your land or at a mainland Infohub.
+   </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="HomePositionSet"
+   type="notify">
+   <tag>fail</tag>
+Home position set.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarEjected"
+   type="notify">
+   <tag>fail</tag>
+Avatar ejected.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AvatarEjectFailed"
+   type="notify">
+   <tag>fail</tag>
+Eject failed because you don't have admin permission for that parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectParcelFull"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because the parcel is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectParcelPerms"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because your objects are not allowed on this parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectParcelResources"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because there are not enough resources for this object on this parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectRegionVersion"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because the other region is running an older version which does not support receiving this object via region crossing.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectNavMesh"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because you cannot modify the navmesh across region boundaries.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantMoveObjectWTF"
+   type="notify">
+   <tag>fail</tag>
+Can't move object '[OBJECT_NAME]' to
+[OBJ_POSITION] in region [REGION_NAME] because of an unknown reason. ([FAILURE_TYPE])
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermModifyObject"
+   type="notify">
+   <tag>fail</tag>
+You don't have permission to modify that object
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantEnablePhysObjContributesToNav"
+   type="notify">
+   <tag>fail</tag>
+Can't enable physics for an object that contributes to the navmesh.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantEnablePhysKeyframedObj"
+   type="notify">
+   <tag>fail</tag>
+Can't enable physics for keyframed objects.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantEnablePhysNotEnoughLandResources"
+   type="notify">
+   <tag>fail</tag>
+Can't enable physics for object -- insufficient land resources.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantEnablePhysCostTooGreat"
+   persist="true"
+   type="notify">
+   <tag>fail</tag>
+Can't enable physics for object with physics resource cost greater than [MAX_OBJECTS]
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PhantomWithConcavePiece"
+   type="notify">
+   <tag>fail</tag>
+This object cannot have a concave piece because it is phantom and contributes to the navmesh.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableAddItem"
+   type="notify">
+   <tag>fail</tag>
+Unable to add item!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableEditItem"
+   type="notify">
+   <tag>fail</tag>
+Unable to edit this!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermToEdit"
+   type="notify">
+   <tag>fail</tag>
+Not permitted to edit this.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermToCopyInventory"
+   type="notify">
+   <tag>fail</tag>
+Not permitted to copy that inventory.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSaveItemDoesntExist"
+   type="notify">
+   <tag>fail</tag>
+Cannot save to object contents: Item no longer exists.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSaveItemAlreadyExists"
+   type="notify">
+   <tag>fail</tag>
+Cannot save to object contents: Item with that name already exists in inventory
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSaveModifyAttachment"
+   type="notify">
+   <tag>fail</tag>
+Cannot save to object contents: This would modify the attachment permissions.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TooManyScripts"
+   type="notify">
+   <tag>fail</tag>
+Too many scripts.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableAddScript"
+   type="notify">
+   <tag>fail</tag>
+Unable to add script!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AssetServerTimeoutObjReturn"
+   type="notify">
+   <tag>fail</tag>
+Asset server didn't respond in a timely fashion.  Object returned to sim.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RegionDisablePhysicsShapes"
+   type="notify">
+   <tag>fail</tag>
+This region does not have physics shapes enabled.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoModNavmeshAcrossRegions"
+   type="notify">
+   <tag>fail</tag>
+You cannot modify the navmesh across region boundaries.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoSetPhysicsPropertiesOnObjectType"
+   type="notify">
+   <tag>fail</tag>
+Cannot set physics properties on that object type.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoSetRootPrimWithNoShape"
+   type="notify">
+   <tag>fail</tag>
+Cannot set root prim to have no shape.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoRegionSupportPhysMats"
+   type="notify">
+   <tag>fail</tag>
+This region does not have physics materials enabled.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="OnlyRootPrimPhysMats"
+   type="notify">
+   <tag>fail</tag>
+Only root prims may have their physics materials adjusted.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoSupportCharacterPhysMats"
+   type="notify">
+   <tag>fail</tag>
+Setting physics materials on characters is not yet supported.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="InvalidPhysMatProperty"
+   type="notify">
+   <tag>fail</tag>
+One or more of the specified physics material properties was invalid.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermsAlterStitchingMeshObj"
+   type="notify">
+   <tag>fail</tag>
+You may not alter the stitching type of a mesh object.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPermsAlterShapeMeshObj"
+   type="notify">
+   <tag>fail</tag>
+You may not alter the shape of a mesh object
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="FullRegionCantEnter"
+   type="notify">
+   <tag>fail</tag>
+You can't enter this region because \nthe region is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedOwnersDiffer"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- owners differ
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedNoModNavmeshAcrossRegions"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- cannot modify the navmesh across region boundaries.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedNoPermToEdit"
+   type="notify">
+   <tag>fail</tag>
+Link failed because you do not have edit permission.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedTooManyPrims"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- too many primitives
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedCantLinkNoCopyNoTrans"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- cannot link no-copy with no-transfer
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedNothingLinkable"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- nothing linkable.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedTooManyPathfindingChars"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- too many pathfinding characters
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedInsufficientLand"
+   type="notify">
+   <tag>fail</tag>
+Link failed -- insufficient land resources
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LinkFailedTooMuchPhysics"
+   type="notify">
+   <tag>fail</tag>
+Object uses too many physics resources -- its dynamics have been disabled.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedHomeByObjectOnParcel"
+   persist="true"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported home by the object '[OBJECT_NAME]' on the parcel '[PARCEL_NAME]'
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedHomeByObject"
+   persist="true"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported home by the object '[OBJECT_NAME]'
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedByAttachment"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported by an attachment on [ITEM_ID]
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedByObjectOnParcel"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported by the object '[OBJECT_NAME]' on the parcel '[PARCEL_NAME]'
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedByObjectOwnedBy"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported by the object '[OBJECT_NAME]' owned by [OWNER_ID]
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportedByObjectUnknownUser"
+   type="notify">
+   <tag>fail</tag>
+You have been teleported by the object '[OBJECT_NAME]' owned by an unknown user.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateObjectRegionFull"
+   type="notify">
+   <tag>fail</tag>
+Unable to create requested object. The region is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttackMultipleObjOneSpot"
+   type="notify">
+   <tag>fail</tag>
+You can't attach multiple objects to one spot.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateMultipleObjAtLoc"
+   type="notify">
+   <tag>fail</tag>
+You can't create multiple objects here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableToCreateObjTimeOut"
+   type="notify">
+   <tag>fail</tag>
+Unable to create requested object. Object is missing from database.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableToCreateObjUnknown"
+   type="notify">
+   <tag>fail</tag>
+Unable to create requested object. The request timed out. Please try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableToCreateObjMissingFromDB"
+   type="notify">
+   <tag>fail</tag>
+Unable to create requested object. Please try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RezFailureTookTooLong"
+   type="notify">
+   <tag>fail</tag>
+Rez failed, requested object took too long to load.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="FailedToPlaceObjAtLoc"
+   type="notify">
+   <tag>fail</tag>
+Failed to place object at specified location.  Please try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreatePlantsOnLand"
+   type="notify">
+   <tag>fail</tag>
+You cannot create plants on this land.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantRestoreObjectNoWorldPos"
+   type="notify">
+   <tag>fail</tag>
+Cannot restore object. No world position found.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantRezObjectInvalidMeshData"
+   type="notify">
+   <tag>fail</tag>
+Unable to rez object because its mesh data is invalid.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantRezObjectTooManyScripts"
+   type="notify">
+   <tag>fail</tag>
+Unable to rez object because there are already too many scripts in this region.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateObjectNoAccess"
+   type="notify">
+   <tag>fail</tag>
+Your access privileges don't allow you to create objects there.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateObject"
+   type="notify">
+   <tag>fail</tag>
+You are not currently allowed to create objects.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="InvalidObjectParams"
+   type="notify">
+   <tag>fail</tag>
+Invalid object parameters
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDuplicateObjectNoAcess"
+   type="notify">
+   <tag>fail</tag>
+Your access privileges don't allow you to duplicate objects here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantChangeShape"
+   type="notify">
+   <tag>fail</tag>
+You are not allowed to change this shape.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoAccessToClaimObjects"
+   type="notify">
+   <tag>fail</tag>
+Your access privileges don't allow you to claim objects here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="DeedFailedNoPermToDeedForGroup"
+   type="notify">
+   <tag>fail</tag>
+Deed failed because you do not have permission to deed objects for your group.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="NoPrivsToBuyObject"
+   type="notify">
+   <tag>fail</tag>
+Your access privileges don't allow you to buy objects here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachObjectAvatarSittingOnIt"
+   type="notify">
+   <tag>fail</tag>
+Cannot attach object because an avatar is sitting on it.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="WhyAreYouTryingToWearShrubbery"
+   type="notify">
+   <tag>fail</tag>
+Trees and grasses cannot be worn as attachments.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachGroupOwnedObjs"
+   type="notify">
+   <tag>fail</tag>
+Cannot attach group-owned objects.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachObjectsNotOwned"
+   type="notify">
+   <tag>fail</tag>
+Cannot attach objects that you don't own.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachNavmeshObjects"
+   type="notify">
+   <tag>fail</tag>
+Cannot attach objects that contribute to navmesh.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachObjectNoMovePermissions"
+   type="notify">
+   <tag>fail</tag>
+Cannot attach object because you do not have permission to move it.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantAttachNotEnoughScriptResources"
+   type="notify">
+   <tag>fail</tag>
+Not enough script resources available to attach object!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropItemTrialUser"
+   type="notify">
+   <tag>fail</tag>
+You can't drop objects here; try the Free Trial area.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropMeshAttachment"
+   type="notify">
+   <tag>fail</tag>
+You can't drop mesh attachments. Detach to inventory and then rez in world.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropAttachmentNoPermission"
+   type="notify">
+   <tag>fail</tag>
+Failed to drop attachment: you don't have permission to drop there.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropAttachmentInsufficientLandResources"
+   type="notify">
+   <tag>fail</tag>
+Failed to drop attachment: insufficient available land resource.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropAttachmentInsufficientResources"
+   type="notify">
+   <tag>fail</tag>
+Failed to drop attachments: insufficient available resources.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDropObjectFullParcel"
+   type="notify">
+   <tag>fail</tag>
+Cannot drop object here.  Parcel is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantTouchObjectBannedFromParcel"
+   type="notify">
+   <tag>fail</tag>
+Can't touch/grab this object because you are banned from the land parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PlzNarrowDeleteParams"
+   type="notify">
+   <tag>fail</tag>
+Please narrow your delete parameters.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UnableToUploadAsset"
+   type="notify">
+   <tag>fail</tag>
+Unable to upload asset.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantTeleportCouldNotFindUser"
+   type="notify">
+   <tag>fail</tag>
+Could not find user to teleport home
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="GodlikeRequestFailed"
+   type="notify">
+   <tag>fail</tag>
+godlike request failed
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="GenericRequestFailed"
+   type="notify">
+   <tag>fail</tag>
+generic request failed
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantUploadPostcard"
+   type="notify">
+   <tag>fail</tag>
+Unable to upload postcard.  Try again later.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantFetchInventoryForGroupNotice"
+   type="notify">
+   <tag>fail</tag>
+Unable to fetch inventory details for the group notice.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSendGroupNoticeNotPermitted"
+   type="notify">
+   <tag>fail</tag>
+Unable to send group notice -- not permitted.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSendGroupNoticeCantConstructInventory"
+   type="notify">
+   <tag>fail</tag>
+Unable to send group notice -- could not construct inventory.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantParceInventoryInNotice"
+   type="notify">
+   <tag>fail</tag>
+Unable to parse inventory in notice.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TerrainUploadFailed"
+   type="notify">
+   <tag>fail</tag>
+Terrain upload failed.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TerrainFileWritten"
+   type="notify">
+   <tag>fail</tag>
+Terrain file written.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TerrainFileWrittenStartingDownload"
+   type="notify">
+   <tag>fail</tag>
+Terrain file written, starting download...
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TerrainBaked"
+   type="notify">
+   <tag>fail</tag>
+Terrain baked.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="TenObjectsDisabledPlzRefresh"
+   type="notify">
+   <tag>fail</tag>
+Only the first 10 selected objects have been disabled. Refresh and make additional selections if required.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UpdateViewerBuyParcel"
+   type="notify">
+   <tag>fail</tag>
+You need to update your viewer to buy this parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LandBuyAccessBlocked"
+   type="notify">
+   <tag>fail</tag>
+You can't buy this land due to your maturity Rating. You may need to validate your age and/or install the latest Viewer. Please go to the Knowledge Base for details on accessing areas with this maturity Rating.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuyParcelNotForSale"
+   type="notify">
+   <tag>fail</tag>
+Unable to buy, this parcel is not for sale.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuySalePriceOrLandAreaChanged"
+   type="notify">
+   <tag>fail</tag>
+Unable to buy, the sale price or land area has changed.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuyParcelNotAuthorized"
+   type="notify">
+   <tag>fail</tag>
+You are not the authorized buyer for this parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuyParcelAwaitingPurchaseAuth"
+   type="notify">
+   <tag>fail</tag>
+You cannot purchase this parcel because it is already awaiting purchase aut
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuildOverflowParcel"
+   type="notify">
+   <tag>fail</tag>
+You cannot build objects here because doing so would overflow the parcel.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SelectedMultipleOwnedLand"
+   type="notify">
+   <tag>fail</tag>
+You selected land with different owners. Please select a smaller area and try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantJoinTooFewLeasedParcels"
+   type="notify">
+   <tag>fail</tag>
+Not enough leased parcels in selection to join.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDivideLandMultipleParcelsSelected"
+   type="notify">
+   <tag>fail</tag>
+Can't divide land.\nThere is more than one parcel selected.\nTry selecting a smaller piece of land.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDivideLandCantFindParcel"
+   type="notify">
+   <tag>fail</tag>
+Can't divide land.\nCan't find the parcel.\nPlease report with Help -> Reprt Bug...
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDivideLandWholeParcelSelected"
+   type="notify">
+   <tag>fail</tag>
+Can't divide land. Whole parcel is selected.\nTry selecting a smaller piece of land.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LandHasBeenDivided"
+   type="notify">
+   <tag>fail</tag>
+Land has been divided.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PassPurchased"
+   type="notify">
+   <tag>fail</tag>
+You purchased a pass.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RegionDisallowsClassifieds"
+   type="notify">
+   <tag>fail</tag>
+Region does not allow classified advertisements.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LandPassExpireSoon"
+   type="notify">
+   <tag>fail</tag>
+Your pass to this land is about to expire.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSitNoSuitableSurface"
+   type="notify">
+   <tag>fail</tag>
+There is no suitable surface to sit on, try another spot.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSitNoRoom"
+   type="notify">
+   <tag>fail</tag>
+No room to sit here, try another spot.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AutopilotCanceled"
+   type="notify">
+   <tag>fail</tag>
+Autopilot canceled
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ClaimObjectFailedNoPermission"
+   type="notify">
+   <tag>fail</tag>
+Claim object failed because you don't have permission
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ClaimObjectFailedNoMoney"
+   type="notify">
+   <tag>fail</tag>
+Claim object failed because you don't have enough L$.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDeedGroupLand"
+   type="notify">
+   <tag>fail</tag>
+Cannot deed group-owned land.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="BuyObjectFailedNoMoney"
+   type="notify">
+   <tag>fail</tag>
+Buy object failed because you don't have enough L$.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="BuyInventoryFailedNoMoney"
+   type="notify">
+   <tag>fail</tag>
+Buy inventory failed because you do not have enough L$
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="BuyPassFailedNoMoney"
+   type="notify">
+   <tag>fail</tag>
+You don't have enough L$ to buy a pass to this land.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantBuyPassTryAgain"
+   type="notify">
+   <tag>fail</tag>
+Unable to buy pass right now.  Try again later.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateObjectParcelFull"
+   type="notify">
+   <tag>fail</tag>
+Can't create object because \nthe parcel is full.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="FailedPlacingObject"
+   type="notify">
+   <tag>fail</tag>
+Failed to place object at specified location.  Please try again.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateLandmarkForEvent"
+   type="notify">
+   <tag>fail</tag>
+Unable to create landmark for event.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="GodBeatsFreeze"
+   type="notify">
+   <tag>fail</tag>
+Your godlike powers break the freeze!
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SpecialPowersRequestFailedLogged"
+   type="notify">
+   <tag>fail</tag>
+Request for special powers failed. This request has been logged.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ExpireExplanation"
+   type="notify">
+   <tag>fail</tag>
+The system is currently unable to process your request. The request timed out.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="DieExplanation"
+   type="notify">
+   <tag>fail</tag>
+The system is unable to process your request.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="AddPrimitiveFailure"
+   type="notify">
+   <tag>fail</tag>
+Insufficient funds to create primitve.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="RezObjectFailure"
+   type="notify">
+   <tag>fail</tag>
+Insufficient funds to create object.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ResetHomePositionNotLegal"
+   type="notify">
+   <tag>fail</tag>
+Reset Home position since Home wasn't legal.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantInviteRegionFull"
+   type="notify">
+   <tag>fail</tag>
+You cannot currently invite anyone to your location because the region is full. Try again later.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantSetHomeAtRegion"
+   type="notify">
+   <tag>fail</tag>
+This region does not allow you to set your home location here.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ListValidHomeLocations"
+   type="notify">
+   <tag>fail</tag>
+You can only set your 'Home Location' on your land or at a mainland Infohub.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SetHomePosition"
+   type="notify">
+   <tag>fail</tag>
+Home position set.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDerezInventoryError"
+   type="notify">
+   <tag>fail</tag>
+Cannot derez object due to inventory fault.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateRequestedInv"
+   type="notify">
+   <tag>fail</tag>
+Cannot create requested inventory.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateRequestedInvFolder"
+   type="notify">
+   <tag>fail</tag>
+Cannot create requested inventory folder.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateInventory"
+   type="notify">
+   <tag>fail</tag>
+Cannot create that inventory.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateLandmark"
+   type="notify">
+   <tag>fail</tag>
+Cannot create landmark.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantCreateOutfit"
+   type="notify">
+   <tag>fail</tag>
+Cannot create outfit right now. Try again in a minute.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="InventoryNotForSale"
+   type="notify">
+   <tag>fail</tag>
+Inventory is not for sale.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantFindInvItem"
+   type="notify">
+   <tag>fail</tag>
+Unable to find inventory item.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantFindObject"
+   type="notify">
+   <tag>fail</tag>
+Unable to find object.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantTransfterMoneyRegionDisabled"
+   type="notify">
+   <tag>fail</tag>
+Money transfers to objects are currently disabled in this region.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantPayNoAgent"
+   type="notify">
+   <tag>fail</tag>
+Could not figure out who to pay.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="CantDonateToPublicObjects"
+   type="notify">
+   <tag>fail</tag>
+You cannot give L$ to public objects.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="InventoryCreationInWorldObjectFailed"
+   type="notify">
+   <tag>fail</tag>
+Inventory creation on in-world object failed.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="UserBalanceOrLandUsageError"
+   type="notify">
+   <tag>fail</tag>
+An internal error prevented us from properly updating your viewer.  The L$ balance or parcel holdings displayed in your viewer may not reflect your actual balance on the servers.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LargePrimAgentIntersect"
+   type="notify">
+   <tag>fail</tag>
+Cannot create large prims that intersect other players.  Please re-try when other players have moved.
+  </notification>
+
 </notifications>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 849f3ef73d6a714c1f3e84a3998b103d337ca80b..cd243d40a4e653ddd8aa3fe035a755abb6f9ad56 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -147,12 +147,12 @@
      height="12"
      layout="topleft"
      left_delta="87"
-     name="ShadersPrefText3"
+     name="ShadersPrefText2"
      top_delta="0"
      width="80">
         Mid
     </text>
-  <text
+    <text
      type="string"
      length="1"
      follows="left|top"
@@ -163,8 +163,8 @@
      name="ShadersPrefText3"
      top_delta="0"
      width="80">
-      High
-  </text>
+        High
+    </text>
     <text
      type="string"
      length="1"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
index f1ae14809f531ce73d948065ec5e5230beda1301..6ee8fc3a4c57ddd69de2c3c8ee49922ea890cb2f 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
@@ -1,36 +1,36 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-    height="570"
-    layout="topleft"
-    name="object properties"
-    help_topic="object_properties"
-    title="Object Profile"
-    width="333">
-  <panel.string
-      name="text deed continued">
-    Deed
-  </panel.string>
-  <panel.string
-      name="text deed">
-    Deed
-  </panel.string>
-  <panel.string
-      name="text modify info 1">
-    You can modify this object
-  </panel.string>
-  <panel.string
-      name="text modify info 2">
-    You can modify these objects
-  </panel.string>
-  <panel.string
-      name="text modify info 3">
-    You can't modify this object
-  </panel.string>
-  <panel.string
-      name="text modify info 4">
-    You can't modify these objects
-  </panel.string>
-  <panel.string
+	 height="570"
+	 layout="topleft"
+	 name="object properties"
+	 help_topic="object_properties"
+	 title="Object Profile"
+	 width="333">
+	 <panel.string
+	  name="text deed continued">
+		Deed
+	 </panel.string>
+	<panel.string
+	 name="text deed">
+		Deed
+	</panel.string>
+            <panel.string
+             name="text modify info 1">
+                You can modify this object
+            </panel.string>
+            <panel.string
+             name="text modify info 2">
+                You can modify these objects
+            </panel.string>
+            <panel.string
+             name="text modify info 3">
+                You can't modify this object
+            </panel.string>
+            <panel.string
+             name="text modify info 4">
+                You can't modify these objects
+            </panel.string>
+            <panel.string
       name="text modify info 5">
     You can't modify this object across a region boundary
   </panel.string>
@@ -39,403 +39,403 @@
     You can't modify these objects across a region boundary
   </panel.string>
   <panel.string
-      name="text modify warning">
-    This object has linked parts
-  </panel.string>
-  <panel.string
-      name="Cost Default">
-    Price: L$
-  </panel.string>
-  <panel.string
-      name="Cost Total">
-    Total Price: L$
-  </panel.string>
-  <panel.string
-      name="Cost Per Unit">
-    Price Per: L$
-  </panel.string>
-  <panel.string
-      name="Cost Mixed">
-    Mixed Price
-  </panel.string>
-  <panel.string
-      name="Sale Mixed">
-    Mixed Sale
-  </panel.string>
-  <button
-      follows="top|left"
-      height="24"
-      image_hover_unselected="BackButton_Over"
-      image_pressed="BackButton_Press"
-      image_unselected="BackButton_Off"
-      layout="topleft"
-      left="8"
-      name="back_btn"
-      tab_stop="false"
-      top="0"
-      width="30"
-      use_draw_context_alpha="false" />
-  <text
-      follows="top|left|right"
-      font="SansSerifHuge"
-      height="26"
-      layout="topleft"
-      left_pad="10"
-      name="title"
-      text_color="LtGray"
-      top="0"
-      use_ellipses="true"
-      value="Object Profile"
-      width="290" />
-  <text
-      follows="top|left"
-      height="13"
-      layout="topleft"
-      left="45"
-      name="where"
-      text_color="LtGray_50"
-      value="(Inworld)"
-      width="150" />
-  <panel
-      follows="all"
-      height="490"
-      label=""
-      layout="topleft"
-      left="10"
-      help_topic=""
-      name="properties_panel"
-      top="45"
-      width="313"
-      background_visible="true"
-      bg_alpha_color="DkGray2">
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="10"
-        layout="topleft"
-        left="5"
-        name="Name:"
-        top="10"
-        width="78">
-      Name:
-    </text>
-    <line_editor
-        border_style="line"
-        border_thickness="1"
-        follows="left|top|right"
-        height="20"
-        layout="topleft"
-        left_delta="78"
-        max_length_bytes="63"
-        name="Object Name"
-        top_delta="0"
-        width="225" />
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="10"
-        layout="topleft"
-        left="5"
-        name="Description:"
-        top_pad="10"
-        width="78">
-      Description:
-    </text>
-    <line_editor
-        border_style="line"
-        border_thickness="1"
-        follows="left|top|right"
-        height="23"
-        layout="topleft"
-        name="Object Description"
-        select_on_focus="true"
-        left_delta="78"
-        max_length_bytes="127"
-        top_delta="-5"
-        width="225"/>
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="23"
-        layout="topleft"
-        left="5"
-        name="CreatorNameLabel"
-        top_pad="12"
-        width="78">
-      Creator:
-    </text>
-    <text
-        type="string"
-        follows="left|right|top"
-        font="SansSerifSmall"
-        height="15"
-        layout="topleft"
-        left_pad="0"
-        name="Creator Name"
-        top_delta="0"
-        translate="false"
-        use_ellipses="true" 
-        width="225">
-      TestString PleaseIgnore
-    </text>
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="23"
-        layout="topleft"
-        left="5"
-        name="Owner:"
-        top_pad="15"
-        width="78">
-      Owner:
-    </text>
-    <text
-        type="string"
-        follows="left|right|top"
-        font="SansSerifSmall"
-        height="15"
-        layout="topleft"
-        left_pad="0"
-        name="Owner Name"
-        top_delta="0"
-        translate="false"
-        use_ellipses="true" 
-        width="225">
-      TestString PleaseIgnore
-    </text>
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="23"
-        layout="topleft"
-        left="5"
-        name="Group_label"
-        top_pad="15"
-        width="78">
-      Group:
-    </text>
+             name="text modify warning">
+                This object has linked parts
+            </panel.string>
+            <panel.string
+             name="Cost Default">
+                Price: L$
+            </panel.string>
+            <panel.string
+             name="Cost Total">
+                Total Price: L$
+            </panel.string>
+            <panel.string
+             name="Cost Per Unit">
+                Price Per: L$
+            </panel.string>
+            <panel.string
+             name="Cost Mixed">
+                Mixed Price
+            </panel.string>
+            <panel.string
+             name="Sale Mixed">
+                Mixed Sale
+            </panel.string>
     <button
-        follows="top|left"
-        height="10"
-        image_disabled="Activate_Checkmark"
-        image_selected="Activate_Checkmark"
-        image_unselected="Activate_Checkmark"
-        image_color="White_50"
-        layout="topleft"
-        left_pad="0"
-        top_delta="0"
-        name="button set group"
-        tab_stop="false"
-        tool_tip="Choose a group to share this object's permissions"
-        width="10" />
-    <name_box
-        follows="left|top"
-        height="18"
-        initial_value="Loading..."
-        layout="topleft"
-        left_pad="5"
-        top_delta="-1"
-        name="Group Name Proxy"
-        width="150" />
-    <button
-        follows="top|left"
-        height="23"
-        label="Deed"
-        label_selected="Deed"
-        layout="topleft"
-        name="button deed"
-        top_pad="0"
-        left="81"
-        tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."
-        width="100" />
-    <text
-        type="string"
-        length="1"
-        follows="left|top"
-        height="9"
-        layout="topleft"
-        top_pad="5"
-        left="5"
-        name="label click action"
-        width="280">
-      Click to:
-    </text>
-    <combo_box
-        follows="left|top"
-        height="23"
-        layout="topleft"
-        name="clickaction"
-        width="168"
-        left="81">
-      <combo_box.item
-          label="Touch  (default)"
-          name="Touch/grab(default)"
+     follows="top|left"
+     height="24"
+     image_hover_unselected="BackButton_Over"
+     image_pressed="BackButton_Press"
+     image_unselected="BackButton_Off"
+     layout="topleft"
+     left="8"
+     name="back_btn"
+     tab_stop="false"
+     top="0"
+     width="30"
+     use_draw_context_alpha="false" />
+        <text
+     follows="top|left|right"
+     font="SansSerifHuge"
+     height="26"
+     layout="topleft"
+     left_pad="10"
+     name="title"
+     text_color="LtGray"
+     top="0"
+     use_ellipses="true"
+     value="Object Profile"
+     width="290" />
+	    <text
+     follows="top|left"
+     height="13"
+     layout="topleft"
+     left="45"
+     name="where"
+     text_color="LtGray_50"
+     value="(Inworld)"
+     width="150" />
+	<panel
+         follows="all"
+         height="490"
+         label=""
+         layout="topleft"
+         left="10"
+         help_topic=""
+         name="properties_panel"
+         top="45"
+         width="313"
+   background_visible="true"
+   bg_alpha_color="DkGray2">
+	    	    <text
+		     type="string"
+		     length="1"
+		     follows="left|top"
+		     height="10"
+		     layout="topleft"
+		     left="5"
+             name="Name:"
+		     top="10"
+		     width="78">
+	        Name:
+	    </text>
+	    <line_editor
+		     border_style="line"
+		     border_thickness="1"
+	    	 follows="left|top|right"
+		     height="20"
+		     layout="topleft"
+	    	 left_delta="78"
+		     max_length_bytes="63"
+             name="Object Name"
+	    	 top_delta="0"
+		     width="225" />
+	    <text
+	    type="string"
+	    length="1"
+	    follows="left|top"
+	    height="10"
+	    layout="topleft"
+	    left="5"
+             name="Description:"
+	    top_pad="10"
+	    width="78">
+	        Description:
+	    </text>
+            <line_editor
+	     border_style="line"
+    	     border_thickness="1"
+             follows="left|top|right"
+             height="23"
+             layout="topleft"
+             name="Object Description"
+             select_on_focus="true"
+    		 left_delta="78"
+		     max_length_bytes="127"
+	    	 top_delta="-5"
+	    	 width="225"/>
+	    <text
+		     type="string"
+		     length="1"
+		     follows="left|top"
+		     height="23"
+		     layout="topleft"
+    		 left="5"
+		 name="CreatorNameLabel"
+		  top_pad="12"
+		     width="78">
+	        Creator:
+    	</text>
+	    <text
+		     type="string"
+     follows="left|right|top"
+     font="SansSerifSmall"
+     height="15"
+     layout="topleft"
+     left_pad="0"
+             name="Creator Name"
+		     top_delta="0"
+		     translate="false"
+         use_ellipses="true" 
+		     width="225">
+	        TestString PleaseIgnore
+	     </text>
+	    <text
+			 type="string"
+			 length="1"
+			 follows="left|top"
+			 height="23"
+			layout="topleft"
+			left="5"
+			name="Owner:"
+			top_pad="15"
+			 width="78">
+			    Owner:
+	     </text>
+	     <text
+			    type="string"
+			    follows="left|right|top"
+			    font="SansSerifSmall"
+			    height="15"
+			    layout="topleft"
+			    left_pad="0"
+			    name="Owner Name"
+			    top_delta="0"
+			    translate="false"
+          use_ellipses="true" 
+			    width="225">
+			    TestString PleaseIgnore
+	     </text>
+	    	    <text
+			 type="string"
+			 length="1"
+			 follows="left|top"
+			 height="23"
+			 layout="topleft"
+			 left="5"
+			name="Group_label"
+			top_pad="15"
+			width="78">
+			    Group:
+	     </text>
+      		<button
+			 follows="top|left"
+			 height="10"
+			 image_disabled="Activate_Checkmark"
+			 image_selected="Activate_Checkmark"
+			 image_unselected="Activate_Checkmark"
+			 image_color="White_50"
+			 layout="topleft"
+			 left_pad="0"
+			 top_delta="0"
+			 name="button set group"
+			 tab_stop="false"
+			 tool_tip="Choose a group to share this object's permissions"
+			 width="10" />
+            <name_box
+             follows="left|top"
+             height="18"
+             initial_value="Loading..."
+             layout="topleft"
+             left_pad="5"
+             top_delta="-1"
+             name="Group Name Proxy"
+             width="150" />
+            <button
+             follows="top|left"
+             height="23"
+             label="Deed"
+             label_selected="Deed"
+             layout="topleft"
+             name="button deed"
+             top_pad="0"
+             left="81"
+             tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."
+             width="100" />
+            <text
+             type="string"
+             length="1"
+             follows="left|top"
+             height="9"
+             layout="topleft"
+             top_pad="5"
+             left="5"
+             name="label click action"
+             width="280">
+                Click to:
+            </text>
+            <combo_box
+             follows="left|top"
+             height="23"
+             layout="topleft"
+             name="clickaction"
+             width="168"
+             left="81">
+                <combo_box.item
+                 label="Touch  (default)"
+                 name="Touch/grab(default)"
           value="Touch" />
-      <combo_box.item
-          label="Sit on object"
-          name="Sitonobject"
+                <combo_box.item
+                 label="Sit on object"
+                 name="Sitonobject"
           value="Sit" />
-      <combo_box.item
-          label="Buy object"
-          name="Buyobject"
+                <combo_box.item
+                 label="Buy object"
+                 name="Buyobject"
           value="Buy" />
-      <combo_box.item
-          label="Pay object"
-          name="Payobject"
+                <combo_box.item
+                 label="Pay object"
+                 name="Payobject"
           value="Pay" />
-      <combo_box.item
-          label="Open"
-          name="Open"
-          value="Open" />
+                <combo_box.item
+                 label="Open"
+                 name="Open"
+                 value="Open" />
        <combo_box.item
           label="Zoom"
           name="Zoom"
           value="Zoom" />
-    </combo_box>
-    <panel
-        border="false"
-        follows="left|top"
-        layout="topleft"
-        mouse_opaque="false"
-        background_visible="true"
-        bg_alpha_color="DkGray"
-        name="perms_inv"
-        left="0"
-        top_pad="15"
-        height="135"
-        width="313">
-      <text
-          type="string"
-          length="1"
+            </combo_box>
+	 <panel
+         border="false"
+         follows="left|top"
+         layout="topleft"
+         mouse_opaque="false"
+         background_visible="true"
+         bg_alpha_color="DkGray"
+         name="perms_inv"
+         left="0"
+         top_pad="15"
+         height="135"
+         width="313">
+	  <text
+             type="string"
+             length="1"
           left="5"
-          top_pad="15"
-          text_color="EmphasisColor"
-          height="15"
-          follows="left|top|right"
-          layout="topleft"
-          name="perm_modify"
-          width="310">
-        You can modify this object
-      </text>
-      <text
-          type="string"
-          length="1"
-          follows="left|top"
-          height="16"
-          layout="topleft"
-          left="10"
-          name="Anyone can:"
-          top_pad="8"
-          width="100">
-        Anyone:
-      </text>
-      <check_box
-          height="18"
-          label="Copy"
-          layout="topleft"
-          left_pad="0"
-          name="checkbox allow everyone copy"
-          top_delta="-2"
-          width="90" />
-      <check_box
-          height="18"
-          label="Move"
-          layout="topleft"
-          name="checkbox allow everyone move"
-          left_pad="0"
-          width="150" />
-      <text
-          type="string"
-          length="1"
-          follows="left|top"
-          height="16"
-          layout="topleft"
-          left="10"
-          name="GroupLabel"
-          top_pad="8"
-          width="100">
-        Group:
-      </text>
-      <check_box
-          height="18"
-          label="Share"
-          layout="topleft"
-          left_pad="90"
-          top_delta="-2"
-          name="checkbox share with group"
-          tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
-          width="150" />
-      <text
-          type="string"
-          length="1"
-          follows="left|top"
-          height="16"
-          layout="topleft"
-          left="10"
-          name="NextOwnerLabel"
-          top_pad="8"
-          width="200"
-          word_wrap="true">
-        Next owner:
-      </text>
-      <check_box
-          height="18"
-          label="Modify"
-          layout="topleft"
-          left="20"
-          top_pad="0"
-          name="checkbox next owner can modify"
-          width="90" />
-      <check_box
-          height="18"
-          label="Copy"
-          layout="topleft"
-          left_pad="0"
-          name="checkbox next owner can copy"
-          width="90" />
-      <check_box
-          height="18"
-          label="Transfer"
-          layout="topleft"
-          left_pad="0"
-          name="checkbox next owner can transfer"
-          tool_tip="Next owner can give away or resell this object"
-          width="106" />
-    </panel>
-    <check_box
-        height="23"
-        label="For Sale"
-        layout="topleft"
-        left="20"
-        name="checkbox for sale"
-        top_pad="10"
-        width="100" />
-    <combo_box
-        height="23"
-        left_pad="0"
-        layout="topleft"
-        follows="left|top"
-        name="sale type"
-        width="170">
-      <combo_box.item
-          name="Copy"
-          label="Copy"
-          value="2" />
-      <combo_box.item
-          name="Contents"
-          label="Contents"
-          value="3" />
-      <combo_box.item
-          name="Original"
-          label="Original"
-          value="1" />
-    </combo_box>
-    <spinner
+             top_pad="15"
+             text_color="EmphasisColor"
+	     height="15"
+             follows="left|top|right"
+             layout="topleft"
+             name="perm_modify"
+             width="310">
+                You can modify this object
+            </text>
+	  	    <text
+			 type="string"
+			 length="1"
+			 follows="left|top"
+			 height="16"
+			 layout="topleft"
+			 left="10"
+               name="Anyone can:"
+			 top_pad="8"
+			 width="100">
+			Anyone:
+	    </text>
+	    <check_box
+			 height="18"
+			 label="Copy"
+			 layout="topleft"
+			 left_pad="0"
+             name="checkbox allow everyone copy"
+			 top_delta="-2"
+			 width="90" />
+	    <check_box
+             height="18"
+             label="Move"
+             layout="topleft"
+             name="checkbox allow everyone move"
+			 left_pad="0"
+             width="150" />
+	       	<text
+			 type="string"
+			 length="1"
+			 follows="left|top"
+			 height="16"
+			 layout="topleft"
+			 left="10"
+			 name="GroupLabel"
+			 top_pad="8"
+			 width="100">
+			Group:
+    	</text>
+			    <check_box
+			 height="18"
+			 label="Share"
+			 layout="topleft"
+			 left_pad="90"
+			 top_delta="-2"
+             name="checkbox share with group"
+			 tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
+			 width="150" />
+	    	    <text
+			 type="string"
+			 length="1"
+			 follows="left|top"
+			 height="16"
+			 layout="topleft"
+			 left="10"
+			 name="NextOwnerLabel"
+			 top_pad="8"
+			 width="200"
+			 word_wrap="true">
+			Next owner:
+	    </text>
+	    <check_box
+			 height="18"
+			 label="Modify"
+			 layout="topleft"
+			 left="20"
+			 top_pad="0"
+             name="checkbox next owner can modify"
+			 width="90" />
+	    <check_box
+			 height="18"
+			 label="Copy"
+			 layout="topleft"
+			 left_pad="0"
+             name="checkbox next owner can copy"
+			 width="90" />
+	    <check_box
+			 height="18"
+			 label="Transfer"
+			 layout="topleft"
+			 left_pad="0"
+             name="checkbox next owner can transfer"
+			 tool_tip="Next owner can give away or resell this object"
+			 width="106" />
+	    </panel>
+	    <check_box
+			 height="23"
+			 label="For Sale"
+			 layout="topleft"
+			 left="20"
+             name="checkbox for sale"
+			 top_pad="10"
+			 width="100" />
+		<combo_box
+			 height="23"
+			 left_pad="0"
+			 layout="topleft"
+			 follows="left|top"
+            name="sale type"
+			 width="170">
+        <combo_box.item
+           name="Copy"
+           label="Copy"
+           value="2" />
+        <combo_box.item
+           name="Contents"
+           label="Contents"
+           value="3" />
+        <combo_box.item
+           name="Original"
+           label="Original"
+           value="1" />
+	    </combo_box>
+		<spinner
         follows="left|top"
         decimal_digits="0"
         increment="1"
@@ -449,17 +449,17 @@
         min_val="1"
         height="20"
         max_val="999999999" />
-    <check_box
-        height="20"
-        width="110"
-        top_pad="6"
-        label="Show in search"
-        layout="topleft"
-        left="120"
-        name="search_check"
-        tool_tip="Let people see this object in search results" />
-    <text
-        type="string"
+      <check_box
+	   height="20"
+	   width="110"
+	   top_pad="6"
+	   label="Show in search"
+       layout="topleft"
+	   left="120"
+       name="search_check"
+       tool_tip="Let people see this object in search results" />
+            <text
+             type="string"
         follows="left|top"
         name="pathfinding_attributes_label"
         top_pad="6"
@@ -470,7 +470,7 @@
     <text
         type="string"
         follows="left|top"
-        text_color="EmphasisColor"
+             text_color="EmphasisColor"
         name="pathfinding_attributes_value"
         width="130"
         word_wrap="false"
@@ -479,120 +479,120 @@
     <text
         type="string"
         text_color="EmphasisColor"
-        length="1"
+             length="1"
         top_pad="10"
-        follows="left|top"
-        layout="topleft"
-        left="10"
-        name="B:"
-        height="10"
-        width="50">
-      B:
-    </text>
-    <text
-        type="string"
-        text_color="White"
-        length="1"
-        follows="left|top"
-        layout="topleft"
-        left_pad="0"
-        name="O:"
-        height="10"
-        width="50">
-      O:
-    </text>
-    <text
-        type="string"
-        text_color="EmphasisColor"
-        length="1"
-        follows="left|top"
-        layout="topleft"
-        left_pad="0"
-        name="G:"
-        height="10"
-        width="50">
-      G:
-    </text>
-    <text
-        type="string"
-        text_color="White"
-        length="1"
-        follows="left|top"
-        left_pad="0"
-        layout="topleft"
-        name="E:"
-        height="10"
-        width="50">
-      E:
-    </text>
-    <text
-        type="string"
-        text_color="EmphasisColor"
-        length="1"
-        follows="left|top"
-        layout="topleft"
-        left_pad="0"
-        name="N:"
-        height="10"
-        width="50">
-      N:
-    </text>
-    <text
-        type="string"
-        text_color="White"
-        length="1"
-        follows="left|top"
-        layout="topleft"
-        left_pad="0"
-        name="F:"
-        height="10"
-        width="50">
-      F:
-    </text>
-  </panel>
-  <panel
-      height="25"
-      layout="bottomright"
-      name="button_panel"
-      left="5"
-      bottom="5"
-      width="313">
-    <button
-        follows="bottom|left"
-        height="23"
-        label="Open"
-        layout="topleft"
-        left="5"
-        name="open_btn"
-        top="0"
-        width="73" />
-    <button
-        follows="bottom|left"
-        height="23"
-        label="Pay"
-        layout="topleft"
-        left_pad="5"
-        name="pay_btn"
-        top="0"
-        width="73" />
-    <button
-        follows="bottom|left"
-        height="23"
-        label="Buy"
-        layout="topleft"
-        left_pad="5"
-        name="buy_btn"
-        top="0"
-        width="73" />
-    <button
-        follows="bottom|left"
-        height="23"
-        label="Details"
-        layout="topleft"
-        left_pad="5"
-        name="details_btn"
-        top="0"
-        width="74" />
+             follows="left|top"
+             layout="topleft"
+             left="10"
+             name="B:"
+             height="10"
+             width="50">
+                B:
+            </text>
+            <text
+             type="string"
+             text_color="White"
+             length="1"
+             follows="left|top"
+             layout="topleft"
+             left_pad="0"
+             name="O:"
+             height="10"
+             width="50">
+                O:
+            </text>
+            <text
+             type="string"
+             text_color="EmphasisColor"
+             length="1"
+             follows="left|top"
+             layout="topleft"
+             left_pad="0"
+             name="G:"
+             height="10"
+             width="50">
+                G:
+            </text>
+            <text
+             type="string"
+             text_color="White"
+             length="1"
+             follows="left|top"
+             left_pad="0"
+             layout="topleft"
+             name="E:"
+             height="10"
+             width="50">
+                E:
+            </text>
+            <text
+             type="string"
+             text_color="EmphasisColor"
+             length="1"
+             follows="left|top"
+             layout="topleft"
+             left_pad="0"
+             name="N:"
+             height="10"
+             width="50">
+                N:
+            </text>
+            <text
+             type="string"
+             text_color="White"
+             length="1"
+             follows="left|top"
+             layout="topleft"
+             left_pad="0"
+             name="F:"
+             height="10"
+             width="50">
+                F:
+            </text>
+		</panel>
+    <panel
+		 height="25"
+		 layout="bottomright"
+		 name="button_panel"
+		 left="5"
+		 bottom="5"
+		 width="313">
+        <button
+		     follows="bottom|left"
+		     height="23"
+		     label="Open"
+		     layout="topleft"
+		     left="5"
+		     name="open_btn"
+		     top="0"
+		     width="73" />
+	    <button
+		     follows="bottom|left"
+		     height="23"
+		     label="Pay"
+		     layout="topleft"
+		     left_pad="5"
+		     name="pay_btn"
+		     top="0"
+		     width="73" />
+	    <button
+		     follows="bottom|left"
+		     height="23"
+		     label="Buy"
+		     layout="topleft"
+		     left_pad="5"
+		     name="buy_btn"
+		     top="0"
+		     width="73" />
+        <button
+		     follows="bottom|left"
+		     height="23"
+		     label="Details"
+		     layout="topleft"
+		     left_pad="5"
+		     name="details_btn"
+		     top="0"
+		     width="74" />
 
-  </panel>
+	</panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 18d1854f67b699a15a068a8b78ddb50a7bb91de5..4383b985921b516372d9c7c13cb287ad09d8d12f 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3330,7 +3330,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="LocationCtrlAdultIconTooltip">Adult Region</string>
   <string name="LocationCtrlModerateIconTooltip">Moderate Region</string>
   <string name="LocationCtrlGeneralIconTooltip">General Region</string>
-  <string name="LocationCtrlSeeAVsTooltip">Avatars visible and chat allowed outside of this parcel</string>
+  <string name="LocationCtrlSeeAVsTooltip">Avatars inside this parcel cannot be seen or heard by avatars outside this parcel</string>
   <string name="LocationCtrlPathfindingDirtyTooltip">Objects that move may not behave correctly in this region until the region is rebaked.</string>
   <string name="LocationCtrlPathfindingDisabledTooltip">Dynamic pathfinding is not enabled on this region.</string>
   <!-- Strings used by the (currently Linux) auto-updater app -->
diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml
index 3f173240066fae841e1c8cd7359d076f4926e1b0..7e17ed68647bb8374873e8adbe251226c09c6785 100644
--- a/indra/newview/skins/default/xui/zh/strings.xml
+++ b/indra/newview/skins/default/xui/zh/strings.xml
@@ -1982,7 +1982,7 @@ http://secondlife.com/viewer-access-faq
 		新腳本
 	</string>
 	<string name="BusyModeResponseDefault">
-		你傳訊過去的居民目前處於忙碌狀態,這意味著他要求不被打擾。  你的訊息仍將留存並顯示於對���的 IM 面板上供稍後查閱。
+		你傳訊過去的居民目前處於忙碌狀態,這意味著他要求不被打擾。  你的訊息仍將留存並顯示於對方的 IM 面板上供稍後查閱。
 	</string>
 	<string name="MuteByName">
 		(按名稱)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index ea75d4f4f6c808c3d996502a065a5ee3f73b2684..e7108141ee84fca85c4d6aad80ff770a1906536f 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -968,7 +968,6 @@ def construct(self):
         if self.prefix(src="", dst="bin"):
             self.path("secondlife-bin","do-not-directly-run-secondlife-bin")
             self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin")
-            self.path("../linux_updater/linux-updater", "linux-updater.bin")
             self.path2basename("../llplugin/slplugin", "SLPlugin")
             self.path2basename("../viewer_components/updater/scripts/linux", "update_install")
             self.end_prefix("bin")
@@ -1017,9 +1016,7 @@ def package_finish(self):
             else:
                 installer_name += '_' + self.channel_oneword().upper()
 
-        if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
-            print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
-            self.run_command("find %(d)r/bin %(d)r/lib -type f \\! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
+        self.strip_binaries()
 
         # Fix access permissions
         self.run_command("""
@@ -1054,6 +1051,11 @@ def package_finish(self):
                 'dst': self.get_dst_prefix(),
                 'inst': self.build_path_of(installer_name)})
 
+    def strip_binaries(self):
+        if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
+            print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
+            self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
+
 class Linux_i686Manifest(LinuxManifest):
     def construct(self):
         super(Linux_i686Manifest, self).construct()
@@ -1139,9 +1141,7 @@ def construct(self):
                     self.path("libvivoxplatform.so")
                     self.end_prefix("lib")
 
-            if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
-                    print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
-                    self.run_command("find %(d)r/bin %(d)r/lib -type f \\! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
+            self.strip_binaries()
 
 
 class Linux_x86_64Manifest(LinuxManifest):
diff --git a/indra/viewer_components/updater/scripts/linux/update_install b/indra/viewer_components/updater/scripts/linux/update_install
index e0505a9f72feb5df297347b65be55fb37fc02e76..a9df9042fda2a029d55cbef46f707926b06cafc9 100644
--- a/indra/viewer_components/updater/scripts/linux/update_install
+++ b/indra/viewer_components/updater/scripts/linux/update_install
@@ -1,10 +1,217 @@
 #! /bin/bash
-INSTALL_DIR=$(cd "$(dirname "$0")/.." ; pwd)
-export LD_LIBRARY_PATH="$INSTALL_DIR/lib"
-bin/linux-updater.bin --file "$1" --dest "$INSTALL_DIR" --name "Second Life Viewer" --stringsdir "$INSTALL_DIR/skins/default/xui/en" --stringsfile "strings.xml"
 
-if [ $? -ne 0 ]
-   then echo $3 >> "$2"
+# @file   update_install
+# @author Nat Goodspeed
+# @date   2013-01-09
+# @brief  Update the containing Second Life application bundle to the version in
+#         the specified tarball.
+# 
+#         This bash implementation is derived from the previous linux-updater.bin
+#         application.
+# 
+# $LicenseInfo:firstyear=2013&license=viewerlgpl$
+# Copyright (c) 2013, Linden Research, Inc.
+# $/LicenseInfo$
+
+# ****************************************************************************
+#   script parameters
+# ****************************************************************************
+tarball="$1"                        # the file to install
+markerfile="$2"                     # create this file on failure
+mandatory="$3"                      # what to write to markerfile on failure
+
+# ****************************************************************************
+#   helper functions
+# ****************************************************************************
+# empty array
+cleanups=()
+
+# add a cleanup action to execute on exit
+function cleanup {
+    # wacky bash syntax for appending to array
+    cleanups[${#cleanups[*]}]="$*"
+}
+
+# called implicitly on exit
+function onexit {
+    for action in "${cleanups[@]}"
+    do # don't quote, support actions consisting of multiple words
+       $action
+    done
+}
+trap 'onexit' EXIT
+
+# write to log file
+function log {
+    # our log file will be open as stderr -- but until we set up that
+    # redirection, logging to stderr is better than nothing
+    echo "$*" 1>&2
+}
+
+# We display status by leaving one background xmessage process running. This
+# is the pid of that process.
+statuspid=""
+
+function clear_message {
+    [ -n "$statuspid" ] && kill $statuspid
+    statuspid=""
+}
+
+# make sure we remove any message box we might have put up
+cleanup clear_message
+
+# can we use zenity, or must we fall back to xmessage?
+zenpath="$(which zenity)"
+if [ -n "$zenpath" ]
+then # zenity on PATH and is executable
+     # display a message box and continue
+     function status {
+         # clear any previous message
+         clear_message
+         # put up a new zenity box and capture its pid
+         "$zenpath" --info --title "Second Life Viewer Updater" \
+                    --width=320 --height=120 --text="$*" &
+         statuspid=$!
+     }
+
+     # display an error box and wait for user
+     function errorbox {
+         "$zenpath" --error --title "Second Life Viewer Updater" \
+                    --width=320 --height=120 --text="$*"
+     }
+
+else # no zenity, use xmessage instead
+     # display a message box and continue
+     function status {
+         # clear any previous message
+         clear_message
+         # put up a new xmessage and capture its pid
+         xmessage -buttons OK:2 -center "$*" &
+         statuspid=$!
+     }
+
+     # display an error box and wait for user
+     function errorbox {
+         xmessage -buttons OK:2 -center "$*"
+     }
+fi
+
+# display an error box and terminate
+function fail {
+    # Log the message
+    log "$@"
+    # tell subsequent viewer things went south
+    echo "$mandatory" > "$markerfile"
+    # add boilerplate
+    errorbox "An error occurred while updating Second Life:
+$*
+Please download the latest viewer from www.secondlife.com."
+    exit 1
+}
+
+# Find a graphical sudo program and define mysudo function. On error, $? is
+# nonzero; output is in $err instead of being written to stdout/stderr.
+gksudo="$(which gksudo)"
+kdesu="$(which kdesu)"
+if [ -n "$gksudo" ]
+then function mysudo {
+         # gksudo allows you to specify description
+         err="$("$gksudo" --description "Second Life Viewer Updater" "$@" 2>&1)"
+     }
+elif [ -n "$kdesu" ]
+then function mysudo {
+         err="$("$kdesu" "$@" 2>&1)"
+     }
+else # couldn't find either one, just try it anyway
+     function mysudo {
+         err="$("$@" 2>&1)"
+     }
 fi
 
-rm -f "$1"
+# Move directories, using mysudo if we think it necessary. On error, $? is
+# nonzero; output is in $err instead of being written to stdout/stderr.
+function sudo_mv {
+    # If we have write permission to both parent directories, shouldn't need
+    # sudo.
+    if [ -w "$(dirname "$1")" -a -w "$(dirname "$2")" ]
+    then err="$(mv "$@" 2>&1)"
+    else # use available sudo program; mysudo sets $? and $err
+         mysudo mv "$@"
+    fi
+}
+
+# ****************************************************************************
+#   main script logic
+# ****************************************************************************
+mydir="$(dirname "$0")"
+# We happen to know that the viewer specifies a marker-file pathname within
+# the logs directory.
+logsdir="$(dirname "$markerfile")"
+logname="$logsdir/updater.log"
+
+# move aside old updater.log; we're about to create a new one
+[ -f "$logname" ] && mv "$logname" "$logname.old"
+
+# Set up redirections for this script such that stderr is logged. (But first
+# move the previous stderr to file descriptor 3.)
+exec 3>&2- 2> "$logname"
+
+# Rather than setting up a special pipeline to timestamp every line of stderr,
+# produce header lines into log file indicating timestamp and the arguments
+# with which we were invoked.
+date 1>&2
+log "$0 $*"
+
+# Log every command we execute, along with any stderr it might produce
+set -x
+
+status 'Installing Second Life...'
+
+# Creating tempdir under /tmp means it's possible that tempdir is on a
+# different filesystem than INSTALL_DIR. One is tempted to create tempdir on a
+# path derived from `dirname INSTALL_DIR` -- but it seems modern 'mv' can
+# handle moving across filesystems??
+tempdir="$(mktemp -d)"
+tempinstall="$tempdir/install"
+# capture the actual error message, if any
+err="$(mkdir -p "$tempinstall" 2>&1)" || fail "$err"
+cleanup rm -rf "$tempdir"
+
+# If we already knew the name of the tarball's top-level directory, we could
+# just move that when all was said and done. Since we don't, untarring to the
+# 'install' subdir with --strip 1 effectively renames that top-level
+# directory.
+# untar failures tend to be voluminous -- don't even try to capture, just log
+tar --strip 1 -xjf "$tarball" -C "$tempinstall" || fail "Untar command failed"
+
+INSTALL_DIR="$(cd "$mydir/.." ; pwd)"
+
+# Considering we're launched from a subdirectory of INSTALL_DIR, would be
+# surprising if it did NOT already exist...
+if [ -e "$INSTALL_DIR" ]
+then backup="$INSTALL_DIR.backup"
+     backupn=1
+     while [ -e "$backup" ]
+     do backup="$INSTALL_DIR.backup.$backupn"
+        ((backupn += 1))
+     done
+     # on error, fail with actual error message from sudo_mv: permissions,
+     # cross-filesystem mv, ...?
+     sudo_mv "$INSTALL_DIR" "$backup" || fail "$err"
+fi
+# We unpacked the tarball into tempinstall. Move that.
+if ! sudo_mv "$tempinstall" "$INSTALL_DIR"
+then # If we failed to move the temp install to INSTALL_DIR, try to restore
+     # INSTALL_DIR from backup. Save $err because next sudo_mv will trash it!
+     realerr="$err"
+     sudo_mv "$backup" "$INSTALL_DIR"
+     fail "$realerr"
+fi
+
+# Removing the tarball here, rather than with a 'cleanup' action, means we
+# only remove it if we succeeded.
+rm -f "$tarball"
+
+# Launch the updated viewer. Restore original stderr from file descriptor 3,
+# though -- otherwise updater.log gets cluttered with the viewer log!
+"$INSTALL_DIR/secondlife" 2>&3- &