Index: FriendsFrame.lua
===================================================================
--- FriendsFrame.lua	(revision 431)
+++ FriendsFrame.lua	(working copy)
@@ -49,10 +49,10 @@
 end
 
 function FriendsFrame_OnShow()
+	FriendsFrame.showFriendsList = 1;
 	FriendsFrame_Update();
 	UpdateMicroButtons();
 	PlaySound("igMainMenuOpen");
-	FriendsFrame.showFriendsList = 1;
 	GuildFrame.selectedGuildMember = 0;
 	SetGuildRosterSelection(0);
 	InGuildCheck();
@@ -1090,4 +1090,4 @@
 			end
 		end
 	end
-end
+end
\ No newline at end of file
Index: FrameXML.toc
===================================================================
--- FrameXML.toc	(revision 431)
+++ FrameXML.toc	(working copy)
@@ -1,5 +1,5 @@
 # Do not delete the following line!
-## Interface: 4150
+## Interface: 4196
 Fonts.xml
 Localization.xml
 BasicControls.xml
Index: ChatFrame.lua
===================================================================
--- ChatFrame.lua	(revision 431)
+++ ChatFrame.lua	(working copy)
@@ -395,6 +395,7 @@
 OtherMenuChatTypeGroups[2] = "SKILL";
 OtherMenuChatTypeGroups[3] = "LOOT";
 
+-- list of text emotes that we want to show on the Emote submenu (these have anims)
 EmoteList = {
 	"WAVE",
 	"BOW",
@@ -419,29 +420,27 @@
 	"KNEEL",
 };
 
--- NEVER rely on the ordering of these entries to match anything because the entries in
--- VoiceMacroList get sorted according to the client's locale. There's a lookup in
--- SoundInterfaceVocal.cpp (s_voiceMacroLabels) that does the lookup.
+-- list of text emotes that we want to show on the Speech submenu (these have sounds)
 VoiceMacroList = {
-	"HELP",
+	"HELPME",
 	"INCOMING",
 	"CHARGE",
 	"FLEE",
-	"AID",
-	"OUTOFMANA",
+	"ATTACKMYTARGET",
+	"OOM",
 	"FOLLOW",
-	"WAITHERE",
+	"WAIT",
 	"HEALME",
 	"CHEER",
 	"OPENFIRE",
-	"RASPBERRY",
+	"RASP",
 	"HELLO",
-	"GOODBYE",
-	"YES",
+	"GOOD",
+	"NOD",
 	"NO",
-	"THANKYOU",
-	"YOUREWELCOME",
-	"CONGRATULATIONS",
+	"THANK",
+	"WELCOME",
+	"CONGRATULATE",
 	"FLIRT",
 	"JOKE",
 	"TRAIN",
@@ -603,27 +602,37 @@
 EMOTE153_TOKEN = "MOO";
 EMOTE154_TOKEN = "COMMEND";
 EMOTE155_TOKEN = "TRAIN";
+EMOTE156_TOKEN = "HELPME";
+EMOTE157_TOKEN = "INCOMING";
+EMOTE158_TOKEN = "OPENFIRE";
+EMOTE159_TOKEN = "CHARGE";
+EMOTE160_TOKEN = "FLEE";
+EMOTE161_TOKEN = "ATTACKMYTARGET";
+EMOTE162_TOKEN = "OOM";
+EMOTE163_TOKEN = "FOLLOW";
+EMOTE164_TOKEN = "WAIT";
+EMOTE165_TOKEN = "FLIRT";
+EMOTE166_TOKEN = "HEALME";
+EMOTE167_TOKEN = "JOKE";
 
-function GetSlashCmdTarget(msg, nonPlayers)
+function GetSlashCmdTarget(msg)
 	local target = gsub(msg, "(%s*)([^%s]+)(.*)", "%2", 1);
 	if ( target == "" ) then
-		target = "target";
+		if ( UnitIsPlayer("target") ) then
+			target = "target";
+		else
+			target = nil;
+		end
 	end
 	if ( target == "player" or
-	     target == "pet" or
 		 target == "party1" or
 		 target == "party2" or
 		 target == "party3" or
 		 target == "party4" or
 		 target == "party5" or
 		 target == "target" ) then
-		if ( nonPlayers or UnitIsPlayer(target) ) then
-			target = UnitName(target);
-		end
+		target = UnitName(target);
 	end
-	if ( target and target == "" ) then
-		target = nil;
-	end
 	return target;
 end
 
@@ -1035,7 +1044,9 @@
 end
 
 SlashCmdList["DUEL"] = function(msg)
-	StartDuel(GetSlashCmdTarget(msg))
+	if ( GetSlashCmdTarget(msg) ) then
+		StartDuel(GetSlashCmdTarget(msg))
+	end
 end
 
 SlashCmdList["DUEL_CANCEL"] = function(msg)
@@ -1070,7 +1081,9 @@
 end
 
 SlashCmdList["LOOT_MASTER"] = function(msg)
-	SetLootMethod("master", GetSlashCmdTarget(msg));
+	if ( GetSlashCmdTarget(msg) ) then
+		SetLootMethod("master", GetSlashCmdTarget(msg));
+	end
 end
 
 SlashCmdList["RANDOM"] = function(msg)
@@ -1582,12 +1595,18 @@
 end
 
 function ChatFrame_OnMouseWheel(value)
-	if ( Cosmos_UseMouseWheelToScrollChat ) then
+	if ( Cosmos_UseMouseWheelToScrollChat ) and ( not IsShiftKeyDown() ) then
 		if ( value > 0 ) then
 			SELECTED_DOCK_FRAME:ScrollUp();
 		elseif ( value < 0 ) then
 			SELECTED_DOCK_FRAME:ScrollDown();
 		end
+	else
+		if ( value > 0 ) then
+			ActionBar_PageUp();
+		elseif ( value < 0 ) then
+			ActionBar_PageDown();
+		end
 	end
 end
 
@@ -2353,20 +2372,6 @@
 
 	local i = 1;
 	local j = 1;
-	for index, value in VoiceMacroList do
-		j = 1;
-		local token = getglobal("VOICEMACRO_LABEL_"..value..j);
-		while ( token ) do
-			if ( "/"..strupper(token) == strupper(command) ) then
-				editBox:AddHistoryLine(text);
-				PlayVocalCategory(VoiceMacroList[index]);
-				ChatEdit_OnEscapePressed(editBox);
-				return;
-			end
-			j = j + 1;
-			token = getglobal("VOICEMACRO_LABEL_"..value..j);
-		end
-	end
 	
 	j = 1;
 	local cmdString = TEXT(getglobal("EMOTE"..i.."_CMD"..j));
@@ -2531,11 +2536,11 @@
 	return string1 < string2;
 end
 
-function EmoteMenu_OnLoad()
-	sort(EmoteList, EmoteSort);
+function OnMenuLoad(list,func)
+	sort(list, TextEmoteSort);
 	UIMenu_Initialize();
 	this.parentMenu = "ChatMenu";
-	for index, value in EmoteList do
+	for index, value in list do
 		local i = 1;
 		local token = getglobal("EMOTE"..i.."_TOKEN");
 		while ( token ) do
@@ -2549,10 +2554,14 @@
 		if ( not label ) then
 			label = value;
 		end
-		UIMenu_AddButton(label, nil, EmoteMenu_Click);
+		UIMenu_AddButton(label, nil, func);
 	end
 end
 
+function EmoteMenu_OnLoad()
+	OnMenuLoad(EmoteList,EmoteMenu_Click);
+end
+
 function LanguageMenu_OnLoad()
 	UIMenu_Initialize();
 	this.parentMenu = "ChatMenu";
@@ -2561,24 +2570,12 @@
 end
 
 function VoiceMacroMenu_Click()
-	PlayVocalCategory(VoiceMacroList[this:GetID()]);
+	DoEmote(TextEmoteSpeechList[this:GetID()]);
 	ChatMenu:Hide();
 end
 
-function VoiceSort(token1, token2)
-	return getglobal("VOICEMACRO_LABEL_"..token1.."1") < getglobal("VOICEMACRO_LABEL_"..token2.."1");
-end
-
 function VoiceMacroMenu_OnLoad()
-	sort(VoiceMacroList, VoiceSort);
-	UIMenu_Initialize();
-	this.parentMenu = "ChatMenu";
-	for index, value in VoiceMacroList do
-		local token = "/"..TEXT(getglobal("VOICEMACRO_LABEL_"..value.."1"));
-		if ( token ) then
-			UIMenu_AddButton(token, nil, VoiceMacroMenu_Click);
-		end
-	end
+	OnMenuLoad(TextEmoteSpeechList,VoiceMacroMenu_Click);
 end
 
 function LanguageMenu_OnEvent(event)
