@@ -50,11 +50,24 @@ UnitPopupButtons["ROUND_ROBIN"] = { text
 UnitPopupButtons["MASTER_LOOTER"] = { text = LOOT_MASTER_LOOTER, dist = 0 };
 UnitPopupButtons["GROUP_LOOT"] = { text = LOOT_GROUP_LOOT, dist = 0 };
 UnitPopupButtons["NEED_BEFORE_GREED"] = { text = LOOT_NEED_BEFORE_GREED, dist = 0 };
+UnitPopupButtons["PERSONAL_LOOT"] = { text = LOOT_PERSONAL_LOOT, dist = 0 };
 UnitPopupButtons["RESET_INSTANCES"] = { text = RESET_INSTANCES, dist = 0 };
 UnitPopupButtons["RESET_CHALLENGE_MODE"] = { text = RESET_CHALLENGE_MODE, dist = 0 };
 UnitPopupButtons["CONVERT_TO_RAID"] = { text = CONVERT_TO_RAID, dist = 0 };
 UnitPopupButtons["CONVERT_TO_PARTY"] = { text = CONVERT_TO_PARTY, dist = 0 };
 
+UnitPopupButtons["SUBSECTION_SEPARATOR"] = { dist = 0, isTitle = true, isUninteractable = true, iconOnly = true, icon = "Interface\\Common\\UI-TooltipDivider-Transparent", tCoordLeft = 0, tCoordRight = 1, tCoordTop = 0, tCoordBottom = 1, tSizeX = 0, tFitDropDownSizeX = true, tSizeY = 8, };
+
+local function makeUnitPopupSubsectionTitle(titleText)
+	return { text = titleText, dist = 0, isTitle = true, isUninteractable = true, isSubsectionTitle = true, };
+end
+
+UnitPopupButtons["LOOT_SUBSECTION_TITLE"] = makeUnitPopupSubsectionTitle(UNIT_FRAME_DROPDOWN_SUBSECTION_TITLE_LOOT);
+UnitPopupButtons["INSTANCE_SUBSECTION_TITLE"] = makeUnitPopupSubsectionTitle(UNIT_FRAME_DROPDOWN_SUBSECTION_TITLE_INSTANCE)
+UnitPopupButtons["OTHER_SUBSECTION_TITLE"] = makeUnitPopupSubsectionTitle(UNIT_FRAME_DROPDOWN_SUBSECTION_TITLE_OTHER);
+UnitPopupButtons["INTERACT_SUBSECTION_TITLE"] = makeUnitPopupSubsectionTitle(UNIT_FRAME_DROPDOWN_SUBSECTION_TITLE_INTERACT);
+UnitPopupButtons["LEGACY_RAID_SUBSECTION_TITLE"] = makeUnitPopupSubsectionTitle(UNIT_FRAME_DROPDOWN_SUBSECTION_TITLE_LEGACY_RAID);
+
 UnitPopupButtons["REPORT_PLAYER"] = { text = REPORT_PLAYER_FOR, dist = 0, nested = 1 };
 UnitPopupButtons["REPORT_SPAM"]	= { text = REPORT_SPAMMING, dist = 0 };
 UnitPopupButtons["REPORT_BAD_LANGUAGE"] = { text = REPORT_BAD_LANGUAGE, dist = 0};
@@ -65,16 +78,17 @@ UnitPopupButtons["REPORT_PET"] = { text
 
 
 UnitPopupButtons["DUNGEON_DIFFICULTY"] = { text = DUNGEON_DIFFICULTY, dist = 0,  nested = 1, defaultDifficultyID = 1 };
-UnitPopupButtons["DUNGEON_DIFFICULTY1"] = { text = DUNGEON_DIFFICULTY1, dist = 0, checkable = 1, difficultyID = 1 };
-UnitPopupButtons["DUNGEON_DIFFICULTY2"] = { text = DUNGEON_DIFFICULTY2, dist = 0, checkable = 1, difficultyID = 2 };
-UnitPopupButtons["DUNGEON_DIFFICULTY3"] = { text = CHALLENGE_MODE, dist = 0, checkable = 1, difficultyID = 8 };
-
-UnitPopupButtons["RAID_DIFFICULTY"] = { text = RAID_DIFFICULTY, dist = 0,  nested = 1, defaultDifficultyID = 3 };
-UnitPopupButtons["RAID_DIFFICULTY1"] = { text = RAID_DIFFICULTY1, dist = 0, checkable = 1, difficultyID = 3 };
-UnitPopupButtons["RAID_DIFFICULTY2"] = { text = RAID_DIFFICULTY2, dist = 0, checkable = 1, difficultyID = 4 };
-UnitPopupButtons["RAID_DIFFICULTY3"] = { text = RAID_DIFFICULTY3, dist = 0, checkable = 1, difficultyID = 5 };
-UnitPopupButtons["RAID_DIFFICULTY4"] = { text = RAID_DIFFICULTY4, dist = 0, checkable = 1, difficultyID = 6 };
+UnitPopupButtons["DUNGEON_DIFFICULTY1"] = { text = PLAYER_DIFFICULTY1, dist = 0, checkable = 1, difficultyID = 1 };
+UnitPopupButtons["DUNGEON_DIFFICULTY2"] = { text = PLAYER_DIFFICULTY2, dist = 0, checkable = 1, difficultyID = 2 };
+UnitPopupButtons["DUNGEON_DIFFICULTY3"] = { text = PLAYER_DIFFICULTY5, dist = 0, checkable = 1, difficultyID = 8 };
+
+UnitPopupButtons["RAID_DIFFICULTY"] = { text = RAID_DIFFICULTY, dist = 0,  nested = 1, defaultDifficultyID = 14 };
+UnitPopupButtons["RAID_DIFFICULTY1"] = { text = PLAYER_DIFFICULTY1, dist = 0, checkable = 1, difficultyID = 14 };
+UnitPopupButtons["RAID_DIFFICULTY2"] = { text = PLAYER_DIFFICULTY2, dist = 0, checkable = 1, difficultyID = 15 };
+UnitPopupButtons["RAID_DIFFICULTY3"] = { text = PLAYER_DIFFICULTY6, dist = 0, checkable = 1, difficultyID = 16 };
 
+UnitPopupButtons["LEGACY_RAID_DIFFICULTY1"] = { text = RAID_DIFFICULTY1, dist = 0, checkable = 1, difficultyID = 3 };
+UnitPopupButtons["LEGACY_RAID_DIFFICULTY2"] = { text = RAID_DIFFICULTY2, dist = 0, checkable = 1, difficultyID = 4 };
 
 UnitPopupButtons["PVP_FLAG"] = { text = PVP_FLAG, dist = 0, nested = 1};
 UnitPopupButtons["PVP_ENABLE"] = { text = ENABLE, dist = 0, checkable = 1, checkable = 1 };
@@ -181,42 +195,45 @@ UnitPopupButtons["BATTLEGROUND_UNSILENCE
 UnitPopupButtons["CHAT_KICK"] = { text = CHAT_KICK, dist = 0 };
 UnitPopupButtons["CHAT_BAN"] = { text = CHAT_BAN, dist = 0 };
 
+-- Garrison
+UnitPopupButtons["GARRISON_VISIT"] = { text = GARRISON_VISIT_LEADER, dist = 0 };
+
 -- First level menus
 UnitPopupMenus = { };
-UnitPopupMenus["SELF"] = { "SET_FOCUS", "PVP_FLAG", "LOOT_METHOD", "LOOT_THRESHOLD", "OPT_OUT_LOOT_TITLE", "LOOT_PROMOTE", "SELECT_LOOT_SPECIALIZATION", "CONVERT_TO_RAID", "CONVERT_TO_PARTY", "DUNGEON_DIFFICULTY", "RAID_DIFFICULTY", "RESET_INSTANCES", "RESET_CHALLENGE_MODE", "RAID_TARGET_ICON", "SELECT_ROLE", "INSTANCE_LEAVE", "LEAVE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL"};
-UnitPopupMenus["PET"] = { "SET_FOCUS", "PET_PAPERDOLL", "PET_RENAME", "PET_DISMISS", "PET_ABANDON", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
-UnitPopupMenus["OTHERPET"] = { "SET_FOCUS", "RAID_TARGET_ICON", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME",  "REPORT_PET", "CANCEL" };
-UnitPopupMenus["BATTLEPET"] = { "SET_FOCUS", "RAID_TARGET_ICON", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME",  "PET_SHOW_IN_JOURNAL", "CANCEL" };
-UnitPopupMenus["OTHERBATTLEPET"] = { "SET_FOCUS", "RAID_TARGET_ICON", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME",  "PET_SHOW_IN_JOURNAL", "REPORT_BATTLE_PET", "CANCEL" };
-UnitPopupMenus["PARTY"] = { "ADD_FRIEND", "ADD_FRIEND_MENU", "SET_FOCUS", "MUTE", "UNMUTE", "PARTY_SILENCE", "PARTY_UNSILENCE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "WHISPER", "PROMOTE", "PROMOTE_GUIDE", "LOOT_PROMOTE", "VOTE_TO_KICK", "UNINVITE", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "RAID_TARGET_ICON", "SELECT_ROLE", "PVP_REPORT_AFK", "RAF_SUMMON", "RAF_GRANT_LEVEL", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_PLAYER", "CANCEL" };
-UnitPopupMenus["PLAYER"] = { "ADD_FRIEND", "ADD_FRIEND_MENU", "SET_FOCUS", "WHISPER", "INSPECT", "INVITE", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "RAID_TARGET_ICON", "RAF_SUMMON", "RAF_GRANT_LEVEL", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_PLAYER", "CANCEL" };
-UnitPopupMenus["RAID_PLAYER"] = { "ADD_FRIEND", "ADD_FRIEND_MENU", "SET_FOCUS", "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "WHISPER", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "RAID_TARGET_ICON", "SELECT_ROLE", "RAID_LEADER", "RAID_PROMOTE", "RAID_DEMOTE", "LOOT_PROMOTE", "VOTE_TO_KICK", "RAID_REMOVE", "PVP_REPORT_AFK", "RAF_SUMMON", "RAF_GRANT_LEVEL", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_PLAYER", "CANCEL" };
-UnitPopupMenus["RAID"] = { "SET_FOCUS", "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "RAID_LEADER", "RAID_PROMOTE", "RAID_MAINTANK", "RAID_MAINASSIST", "LOOT_PROMOTE", "RAID_DEMOTE", "VOTE_TO_KICK", "RAID_REMOVE", "PVP_REPORT_AFK", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_PLAYER", "CANCEL" };
-UnitPopupMenus["FRIEND"] = { "WHISPER", "POP_OUT_CHAT", "INVITE", "TARGET", "SET_NOTE", "IGNORE", "REPORT_PLAYER", "PVP_REPORT_AFK", "REMOVE_FRIEND", "CANCEL" };
-UnitPopupMenus["FRIEND_OFFLINE"] = { "SET_NOTE", "IGNORE", "REMOVE_FRIEND", "CANCEL" };
-UnitPopupMenus["BN_FRIEND"] = { "WHISPER", "POP_OUT_CHAT", "CREATE_CONVERSATION_WITH", "BN_INVITE", "BN_TARGET", "BN_SET_NOTE", "BN_VIEW_FRIENDS", "BLOCK_COMMUNICATION", "BN_REPORT", "BN_REMOVE_FRIEND", "CANCEL" };
-UnitPopupMenus["BN_FRIEND_OFFLINE"] = { "BN_SET_NOTE", "BN_VIEW_FRIENDS", "BN_REPORT", "BN_REMOVE_FRIEND", "CANCEL" };
-UnitPopupMenus["GUILD"] = { "GUILD_BATTLETAG_FRIEND", "WHISPER", "INVITE", "TARGET", "IGNORE", "GUILD_PROMOTE", "GUILD_LEAVE", "CANCEL" };
-UnitPopupMenus["GUILD_OFFLINE"] = { "GUILD_BATTLETAG_FRIEND", "IGNORE", "GUILD_PROMOTE", "GUILD_LEAVE", "CANCEL" };
-UnitPopupMenus["RAID_TARGET_ICON"] = { "RAID_TARGET_1", "RAID_TARGET_2", "RAID_TARGET_3", "RAID_TARGET_4", "RAID_TARGET_5", "RAID_TARGET_6", "RAID_TARGET_7", "RAID_TARGET_8", "RAID_TARGET_NONE" };
+UnitPopupMenus["SELF"] = { "RAID_TARGET_ICON", "SET_FOCUS", "PVP_FLAG", "LOOT_SUBSECTION_TITLE", "LOOT_METHOD", "LOOT_THRESHOLD", "OPT_OUT_LOOT_TITLE", "LOOT_PROMOTE", "SELECT_LOOT_SPECIALIZATION", "INSTANCE_SUBSECTION_TITLE", "CONVERT_TO_RAID", "CONVERT_TO_PARTY", "DUNGEON_DIFFICULTY", "RAID_DIFFICULTY", "RESET_INSTANCES", "RESET_CHALLENGE_MODE", "GARRISON_VISIT", "OTHER_SUBSECTION_TITLE", "SELECT_ROLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "INSTANCE_LEAVE", "LEAVE", "CANCEL" };
+UnitPopupMenus["PET"] = { "RAID_TARGET_ICON", "SET_FOCUS", "PET_PAPERDOLL", "INTERACT_SUBSECTION_TITLE", "PET_RENAME", "PET_DISMISS", "PET_ABANDON", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
+UnitPopupMenus["OTHERPET"] = { "RAID_TARGET_ICON", "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME",  "REPORT_PET", "CANCEL" };
+UnitPopupMenus["BATTLEPET"] = { "PET_SHOW_IN_JOURNAL", "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
+UnitPopupMenus["OTHERBATTLEPET"] = { "PET_SHOW_IN_JOURNAL", "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_BATTLE_PET", "CANCEL" };
+UnitPopupMenus["PARTY"] = { "RAID_TARGET_ICON", "SET_FOCUS", "ADD_FRIEND", "ADD_FRIEND_MENU", "INTERACT_SUBSECTION_TITLE", "RAF_SUMMON", "RAF_GRANT_LEVEL", "PROMOTE", "PROMOTE_GUIDE", "LOOT_PROMOTE", "WHISPER", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "OTHER_SUBSECTION_TITLE", "SELECT_ROLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "MUTE", "UNMUTE", "PARTY_SILENCE", "PARTY_UNSILENCE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "REPORT_PLAYER", "PVP_REPORT_AFK", "VOTE_TO_KICK", "UNINVITE", "CANCEL" };
+UnitPopupMenus["PLAYER"] = { "RAID_TARGET_ICON", "SET_FOCUS", "ADD_FRIEND", "ADD_FRIEND_MENU", "INTERACT_SUBSECTION_TITLE", "RAF_SUMMON", "RAF_GRANT_LEVEL", "INVITE", "WHISPER", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "REPORT_PLAYER", "CANCEL" };	
+UnitPopupMenus["RAID_PLAYER"] = { "RAID_TARGET_ICON", "SET_FOCUS", "ADD_FRIEND", "ADD_FRIEND_MENU", "INTERACT_SUBSECTION_TITLE", "RAF_SUMMON", "RAF_GRANT_LEVEL", "RAID_LEADER", "RAID_PROMOTE", "RAID_DEMOTE", "LOOT_PROMOTE", "WHISPER", "INSPECT", "ACHIEVEMENTS", "TRADE", "FOLLOW", "DUEL", "PET_BATTLE_PVP_DUEL", "OTHER_SUBSECTION_TITLE", "SELECT_ROLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "REPORT_PLAYER", "PVP_REPORT_AFK", "VOTE_TO_KICK", "RAID_REMOVE", "CANCEL" };
+UnitPopupMenus["RAID"] = { "SET_FOCUS", "INTERACT_SUBSECTION_TITLE", "RAID_LEADER",  "RAID_PROMOTE", "RAID_DEMOTE", "RAID_MAINTANK", "RAID_MAINASSIST", "LOOT_PROMOTE", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "MUTE", "UNMUTE", "RAID_SILENCE", "RAID_UNSILENCE", "BATTLEGROUND_SILENCE", "BATTLEGROUND_UNSILENCE", "REPORT_PLAYER", "PVP_REPORT_AFK", "VOTE_TO_KICK", "RAID_REMOVE", "CANCEL" };
+UnitPopupMenus["FRIEND"] = { "POP_OUT_CHAT", "TARGET", "SET_NOTE", "INTERACT_SUBSECTION_TITLE", "INVITE", "WHISPER", "OTHER_SUBSECTION_TITLE", "IGNORE", "REMOVE_FRIEND", "REPORT_PLAYER", "PVP_REPORT_AFK", "CANCEL" };
+UnitPopupMenus["FRIEND_OFFLINE"] = { "SET_NOTE", "OTHER_SUBSECTION_TITLE", "IGNORE", "REMOVE_FRIEND", "CANCEL" };
+UnitPopupMenus["BN_FRIEND"] = { "POP_OUT_CHAT", "BN_TARGET", "BN_SET_NOTE", "BN_VIEW_FRIENDS", "INTERACT_SUBSECTION_TITLE", "BN_INVITE", "WHISPER", "CREATE_CONVERSATION_WITH", "OTHER_SUBSECTION_TITLE", "BLOCK_COMMUNICATION", "BN_REMOVE_FRIEND", "BN_REPORT", "CANCEL" };
+UnitPopupMenus["BN_FRIEND_OFFLINE"] = { "BN_SET_NOTE", "BN_VIEW_FRIENDS", "OTHER_SUBSECTION_TITLE", "BN_REMOVE_FRIEND", "BN_REPORT", "CANCEL" };
+UnitPopupMenus["GUILD"] = { "TARGET", "GUILD_BATTLETAG_FRIEND", "INTERACT_SUBSECTION_TITLE", "INVITE", "WHISPER", "GUILD_PROMOTE", "OTHER_SUBSECTION_TITLE", "IGNORE", "GUILD_LEAVE", "CANCEL" };
+UnitPopupMenus["GUILD_OFFLINE"] = { "GUILD_BATTLETAG_FRIEND", "INTERACT_SUBSECTION_TITLE", "GUILD_PROMOTE", "OTHER_SUBSECTION_TITLE", "IGNORE", "GUILD_LEAVE", "CANCEL" };
+UnitPopupMenus["RAID_TARGET_ICON"] = { "RAID_TARGET_8", "RAID_TARGET_7", "RAID_TARGET_6", "RAID_TARGET_5", "RAID_TARGET_4", "RAID_TARGET_3", "RAID_TARGET_2", "RAID_TARGET_1", "RAID_TARGET_NONE" };
 UnitPopupMenus["SELECT_ROLE"] = { "SET_ROLE_TANK", "SET_ROLE_HEALER", "SET_ROLE_DAMAGER", "SET_ROLE_NONE" };
-UnitPopupMenus["CHAT_ROSTER"] = { "WHISPER", "TARGET", "MUTE", "UNMUTE", "CHAT_SILENCE", "CHAT_UNSILENCE", "CHAT_PROMOTE", "CHAT_DEMOTE", "CHAT_OWNER", "CANCEL"  };
-UnitPopupMenus["VEHICLE"] = { "SET_FOCUS", "RAID_TARGET_ICON", "VEHICLE_LEAVE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
-UnitPopupMenus["TARGET"] = { "ADD_FRIEND", "ADD_FRIEND_MENU", "SET_FOCUS", "RAID_TARGET_ICON", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
-UnitPopupMenus["ARENAENEMY"] = { "SET_FOCUS", "CANCEL" };
-UnitPopupMenus["FOCUS"] = { "CLEAR_FOCUS", "LARGE_FOCUS", "MOVE_FOCUS_FRAME", "RAID_TARGET_ICON", "CANCEL" };
-UnitPopupMenus["BOSS"] = { "SET_FOCUS", "RAID_TARGET_ICON", "CANCEL" };
+UnitPopupMenus["CHAT_ROSTER"] = { "TARGET", "INTERACT_SUBSECTION_TITLE", "WHISPER", "CHAT_OWNER", "CHAT_PROMOTE", "OTHER_SUBSECTION_TITLE", "MUTE", "UNMUTE", "CHAT_SILENCE", "CHAT_UNSILENCE", "CHAT_DEMOTE", "CANCEL"  };
+UnitPopupMenus["VEHICLE"] = { "RAID_TARGET_ICON", "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "VEHICLE_LEAVE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
+UnitPopupMenus["TARGET"] = { "RAID_TARGET_ICON", "SET_FOCUS", "ADD_FRIEND", "ADD_FRIEND_MENU", "OTHER_SUBSECTION_TITLE", "MOVE_PLAYER_FRAME", "MOVE_TARGET_FRAME", "CANCEL" };
+UnitPopupMenus["ARENAENEMY"] = { "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "CANCEL" };
+UnitPopupMenus["FOCUS"] = { "RAID_TARGET_ICON", "CLEAR_FOCUS", "OTHER_SUBSECTION_TITLE", "LARGE_FOCUS", "MOVE_FOCUS_FRAME", "CANCEL" };
+UnitPopupMenus["BOSS"] = { "RAID_TARGET_ICON", "SET_FOCUS", "OTHER_SUBSECTION_TITLE", "CANCEL" };
 
 -- Second level menus
 UnitPopupMenus["ADD_FRIEND_MENU"] = { "BATTLETAG_FRIEND", "CHARACTER_FRIEND" };
 UnitPopupMenus["PVP_FLAG"] = { "PVP_ENABLE", "PVP_DISABLE"};
-UnitPopupMenus["LOOT_METHOD"] = { "FREE_FOR_ALL", "ROUND_ROBIN", "MASTER_LOOTER", "GROUP_LOOT", "NEED_BEFORE_GREED", "CANCEL" };
+UnitPopupMenus["LOOT_METHOD"] = { "FREE_FOR_ALL", "ROUND_ROBIN", "MASTER_LOOTER", "GROUP_LOOT", "NEED_BEFORE_GREED", "PERSONAL_LOOT", "CANCEL" };
 UnitPopupMenus["LOOT_THRESHOLD"] = { "ITEM_QUALITY2_DESC", "ITEM_QUALITY3_DESC", "ITEM_QUALITY4_DESC", "CANCEL" };
 UnitPopupMenus["SELECT_LOOT_SPECIALIZATION"] = { "LOOT_SPECIALIZATION_DEFAULT","LOOT_SPECIALIZATION_SPEC1", "LOOT_SPECIALIZATION_SPEC2", "LOOT_SPECIALIZATION_SPEC3", "LOOT_SPECIALIZATION_SPEC4"};
 UnitPopupMenus["OPT_OUT_LOOT_TITLE"] = { "OPT_OUT_LOOT_ENABLE", "OPT_OUT_LOOT_DISABLE"};
 UnitPopupMenus["REPORT_PLAYER"] = { "REPORT_SPAM", "REPORT_BAD_LANGUAGE", "REPORT_BAD_NAME", "REPORT_CHEATING" };
 UnitPopupMenus["DUNGEON_DIFFICULTY"] = { "DUNGEON_DIFFICULTY1", "DUNGEON_DIFFICULTY2", "DUNGEON_DIFFICULTY3" };
-UnitPopupMenus["RAID_DIFFICULTY"] = { "RAID_DIFFICULTY1", "RAID_DIFFICULTY2", "RAID_DIFFICULTY3", "RAID_DIFFICULTY4" };
+UnitPopupMenus["RAID_DIFFICULTY"] = { "RAID_DIFFICULTY1", "RAID_DIFFICULTY2", "RAID_DIFFICULTY3", "LEGACY_RAID_SUBSECTION_TITLE", "LEGACY_RAID_DIFFICULTY1", "LEGACY_RAID_DIFFICULTY2" };
 UnitPopupMenus["BN_REPORT"] = { "BN_REPORT_SPAM", "BN_REPORT_ABUSE", "BN_REPORT_NAME" };
 UnitPopupMenus["MOVE_PLAYER_FRAME"] = { "UNLOCK_PLAYER_FRAME", "LOCK_PLAYER_FRAME", "RESET_PLAYER_FRAME_POSITION", "PLAYER_FRAME_SHOW_CASTBARS" };
 UnitPopupMenus["MOVE_TARGET_FRAME"] = { "UNLOCK_TARGET_FRAME", "LOCK_TARGET_FRAME", "RESET_TARGET_FRAME_POSITION" , "TARGET_FRAME_BUFFS_ON_TOP"};
@@ -233,7 +250,7 @@ UnitLootMethod["roundrobin"] = { text =
 UnitLootMethod["master"] = { text = LOOT_MASTER_LOOTER, tooltipText = NEWBIE_TOOLTIP_UNIT_MASTER_LOOTER };
 UnitLootMethod["group"] = { text = LOOT_GROUP_LOOT, tooltipText = NEWBIE_TOOLTIP_UNIT_GROUP_LOOT };
 UnitLootMethod["needbeforegreed"] = { text = LOOT_NEED_BEFORE_GREED, tooltipText = NEWBIE_TOOLTIP_UNIT_NEED_BEFORE_GREED };
-
+UnitLootMethod["personalloot"] = { text = LOOT_PERSONAL_LOOT, tooltipText = NEWBIE_TOOLTIP_UNIT_PERSONAL };
 
 UnitPopupFrames = {
 	"PlayerFrameDropDown",
@@ -286,8 +303,25 @@ function UnitPopup_ShowMenu (dropdownMen
 	UnitPopupButtons["LOOT_METHOD"].tooltipText = UnitLootMethod[GetLootMethod()].tooltipText;
 	dropdownMenu.selectedLootThreshold = _G["ITEM_QUALITY"..GetLootThreshold().."_DESC"];
 	UnitPopupButtons["LOOT_THRESHOLD"].text = dropdownMenu.selectedLootThreshold;
+	
+	UnitPopupButtons["GARRISON_VISIT"].text = (C_Garrison.IsUsingPartyGarrison() and GARRISON_RETURN) or GARRISON_VISIT_LEADER;
 	-- This allows player to view loot settings if he's not the leader
-	if ( IsInGroup() and UnitIsGroupLeader("player") and not HasLFGRestrictions() ) then
+	local inParty = 0;
+	if ( IsInGroup() ) then
+		inParty = 1;
+	end
+
+	local inPublicParty = 0;
+	if ( IsInGroup(LE_PARTY_CATEGORY_INSTANCE) ) then
+		inPublicParty = 1;
+	end
+
+	local isLeader = 0;
+	if ( UnitIsGroupLeader("player") ) then
+		isLeader = 1;
+	end
+		
+	if ( inParty == 1 and isLeader == 1 and not HasLFGRestrictions() ) then
 		-- If this is true then player is the party leader
 		UnitPopupButtons["LOOT_METHOD"].nested = 1;
 		UnitPopupButtons["LOOT_THRESHOLD"].nested = 1;
@@ -305,11 +339,17 @@ function UnitPopup_ShowMenu (dropdownMen
 	local toggleDifficultyID;
 	local _, instanceType, instanceDifficultyID, _, _, _, isDynamicInstance = GetInstanceInfo();
 	if ( isDynamicInstance and CanChangePlayerDifficulty() ) then
-		_, _, _, _, toggleDifficultyID = GetDifficultyInfo(instanceDifficultyID);
+		_, _, _, _, _, _, toggleDifficultyID = GetDifficultyInfo(instanceDifficultyID);
 	end	
-	if ( instanceType == "none" ) then
+
+	local inInstance, instanceType = IsInInstance();
+	if ( not inInstance ) then
 		UnitPopupButtons["DUNGEON_DIFFICULTY"].nested = 1;
-		UnitPopupButtons["RAID_DIFFICULTY"].nested = 1;		
+		if( inPublicParty == 1 ) then
+			UnitPopupButtons["RAID_DIFFICULTY"].nested = nil;
+		else
+			UnitPopupButtons["RAID_DIFFICULTY"].nested = 1;	
+		end
 	else
 		UnitPopupButtons["DUNGEON_DIFFICULTY"].nested = nil;
 		if ( toggleDifficultyID ) then
@@ -322,8 +362,9 @@ function UnitPopup_ShowMenu (dropdownMen
 	-- setup default Loot Specialization
 	local specPopupButton = UnitPopupButtons["LOOT_SPECIALIZATION_DEFAULT"];
 	local specIndex = GetSpecialization();
+	local sex = UnitSex("player");
 	if ( specIndex) then
-		local specID, specName = GetSpecializationInfo(specIndex);
+		local specID, specName = GetSpecializationInfo(specIndex, nil, nil, nil, sex);
 		if ( specName ) then
 			specPopupButton.text = format(LOOT_SPECIALIZATION_DEFAULT, specName);
 		end
@@ -332,7 +373,7 @@ function UnitPopup_ShowMenu (dropdownMen
 	for index = 1, 4 do
 		specPopupButton = UnitPopupButtons["LOOT_SPECIALIZATION_SPEC"..index];
 		if ( specPopupButton ) then
-			local id, name = GetSpecializationInfo(index);
+			local id, name = GetSpecializationInfo(index, nil, nil, nil, sex);
 			if ( id ) then
 				specPopupButton.specializationID = id;
 				specPopupButton.text = name;
@@ -362,6 +403,9 @@ function UnitPopup_ShowMenu (dropdownMen
 		-- Set which menu is being opened
 		OPEN_DROPDOWNMENUS[UIDROPDOWNMENU_MENU_LEVEL] = {which = dropdownMenu.which, unit = dropdownMenu.unit};
 		info = UIDropDownMenu_CreateInfo();
+		local subsectionTitleValue = nil;
+		local subsectionTitleIndex = nil;
+		local previousWasSubsectionTitle = false;
 		for index, value in ipairs(UnitPopupMenus[UIDROPDOWNMENU_MENU_VALUE]) do
 			if( UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] == 1 ) then
 				info.text = UnitPopupButtons[value].text;
@@ -386,8 +430,15 @@ function UnitPopup_ShowMenu (dropdownMen
 				elseif ( info.text == dropdownMenu.selectedLootThreshold ) then
 					info.checked = 1;
 				elseif ( strsub(value, 1, 12) == "RAID_TARGET_" ) then
-					local raidTargetIndex = GetRaidTargetIndex(unit);
-					if ( raidTargetIndex == index ) then
+					local buttonRaidTargetIndex = strsub(value, 13);
+					if ( buttonRaidTargetIndex == "NONE" ) then
+						buttonRaidTargetIndex = 0;
+					else
+						buttonRaidTargetIndex = tonumber(buttonRaidTargetIndex);
+					end
+					
+					local activeRaidTargetIndex = GetRaidTargetIndex(unit);
+					if ( activeRaidTargetIndex == buttonRaidTargetIndex ) then
 						info.checked = 1;
 					end
 				elseif ( strsub(value, 1, 18) == "DUNGEON_DIFFICULTY" and (strlen(value) > 18)) then
@@ -395,21 +446,20 @@ function UnitPopup_ShowMenu (dropdownMen
 					if ( dungeonDifficultyID == UnitPopupButtons[value].difficultyID ) then
 						info.checked = 1;
 					end
-					local inParty = 0;
-					if ( IsInGroup() ) then
-						inParty = 1;
-					end
-					local isLeader = 0;
-					if ( UnitIsGroupLeader("player") ) then
-						isLeader = 1;
-					end
-					local inInstance, instanceType = IsInInstance();
 					if ( ( inParty == 1 and isLeader == 0 ) or inInstance ) then
 						info.disabled = 1;	
 					end
-				elseif ( strsub(value, 1, 15) == "RAID_DIFFICULTY" and (strlen(value) > 15)) then
+				elseif (strsub(value, 1, 15) == "RAID_DIFFICULTY" and (strlen(value) > 15) ) then
 					if ( isDynamicInstance ) then
-						if ( instanceDifficultyID == UnitPopupButtons[value].difficultyID ) then
+						-- Yay, legacy hacks!
+						if ( IsLegacyDifficulty(instanceDifficultyID) ) then
+							-- 3 and 4 are normal, 5 and 6 are heroic
+							if ((instanceDifficultyID == DIFFICULTY_RAID10_NORMAL or instanceDifficultyID == DIFFICULTY_RAID25_NORMAL) and UnitPopupButtons[value].difficultyID == DIFFICULTY_PRIMARYRAID_NORMAL) then
+								info.checked = 1;
+							elseif ((instanceDifficultyID == DIFFICULTY_RAID10_HEROIC or instanceDifficultyID == DIFFICULTY_RAID25_HEROIC) and UnitPopupButtons[value].difficultyID == DIFFICULTY_PRIMARYRAID_HEROIC) then
+								info.checked = 1;
+							end
+						elseif ( instanceDifficultyID == UnitPopupButtons[value].difficultyID ) then
 							info.checked = 1;
 						end
 					else
@@ -418,19 +468,28 @@ function UnitPopup_ShowMenu (dropdownMen
 							info.checked = 1;
 						end
 					end
-					local inParty = 0;
-					if ( IsInGroup() ) then
-						inParty = 1;
-					end
-					local isLeader = 0;
-					if ( UnitIsGroupLeader("player") ) then
-						isLeader = 1;
+				
+					if ( ( inParty == 1 and isLeader == 0 ) or inPublicParty == 1 or inInstance ) then
+						info.disabled = 1;
 					end
-					local inInstance, instanceType = IsInInstance();
-					if ( ( inParty == 1 and isLeader == 0 ) or inInstance ) then
+					if ( toggleDifficultyID and CheckToggleDifficulty(toggleDifficultyID, UnitPopupButtons[value].difficultyID) == 1 ) then
+						info.disabled = nil;
+					end
+				elseif (strsub(value, 1, 22) == "LEGACY_RAID_DIFFICULTY" and (strlen(value) > 15) ) then
+					if ( isDynamicInstance ) then
+						if ( NormalizeLegacyDifficultyID(instanceDifficultyID) == UnitPopupButtons[value].difficultyID ) then
+							info.checked = 1;
+						end
+					else
+						local raidDifficultyID = GetLegacyRaidDifficultyID();
+						if ( NormalizeLegacyDifficultyID(raidDifficultyID) == UnitPopupButtons[value].difficultyID ) then
+							info.checked = 1;
+						end
+					end
+					if ( ( inParty == 1 and isLeader == 0 ) or inPublicParty == 1 or inInstance or GetRaidDifficultyID() == DIFFICULTY_PRIMARYRAID_MYTHIC ) then
 						info.disabled = 1;
 					end
-					if ( toggleDifficultyID and toggleDifficultyID == UnitPopupButtons[value].difficultyID ) then
+					if ( toggleDifficultyID and not GetRaidDifficultyID() == DIFFICULTY_PRIMARYRAID_MYTHIC and CheckToggleDifficulty(toggleDifficultyID, UnitPopupButtons[value].difficultyID) == 1 ) then
 						info.disabled = nil;
 					end
 				elseif ( value == "PVP_ENABLE" ) then
@@ -486,7 +545,29 @@ function UnitPopup_ShowMenu (dropdownMen
 				-- Setup newbie tooltips
 				info.tooltipTitle = UnitPopupButtons[value].text;
 				info.tooltipText = _G["NEWBIE_TOOLTIP_UNIT_"..value];
-				UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
+				
+				local cntButton = UnitPopupButtons[value];
+						
+				if ( previousWasSubsectionTitle ) then 
+					if ( not cntButton.isSubsectionTitle ) then
+						UnitPopup_AddDropDownButton(info, UnitPopupButtons["SUBSECTION_SEPARATOR"], "SUBSECTION_SEPARATOR", UIDROPDOWNMENU_MENU_LEVEL);
+						UnitPopup_AddDropDownButton(info, UnitPopupButtons[subsectionTitleValue], subsectionTitleValue, UIDROPDOWNMENU_MENU_LEVEL);
+					else
+						UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][subsectionTitleIndex] = 0;
+					end
+					subsectionTitleIndex = nil;
+					subsectionTitleValue = nil;
+				end
+				
+				previousWasSubsectionTitle = false;
+				
+				if ( cntButton.isSubsectionTitle ) then
+					subsectionTitleValue = value;
+					subsectionTitleIndex = index;
+					previousWasSubsectionTitle = true;
+				else
+					UnitPopup_AddDropDownButton(info, cntButton, value, UIDROPDOWNMENU_MENU_LEVEL);
+				end
 			end
 		end
 		return;			
@@ -510,73 +591,125 @@ function UnitPopup_ShowMenu (dropdownMen
 	-- Show the buttons which are used by this menu
 	local tooltipText;
 	info = UIDropDownMenu_CreateInfo();
+	local subsectionTitleValue = nil;
+	local subsectionTitleIndex = nil;
+	local previousWasSubsectionTitle = false;
 	for index, value in ipairs(UnitPopupMenus[which]) do
 		if( UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] == 1 ) then
-			info.text = UnitPopupButtons[value].text;
-			info.value = value;
-			info.owner = which;
-			info.func = UnitPopup_OnClick;
-			if ( not UnitPopupButtons[value].checkable ) then
-				info.notCheckable = 1;
-			else
-				info.notCheckable = nil;
-			end
-			-- Text color
-			if ( value == "LOOT_THRESHOLD" ) then
-				-- Set the text color
-				info.colorCode = ITEM_QUALITY_COLORS[GetLootThreshold()].hex;
-			else
-				color = UnitPopupButtons[value].color;
-				if ( color ) then
-					info.colorCode = string.format("|cFF%02x%02x%02x",  color.r*255,  color.g*255,  color.b*255);
+			local cntButton = UnitPopupButtons[value];
+			
+			if ( previousWasSubsectionTitle ) then 
+				if ( not cntButton.isSubsectionTitle ) then
+					UnitPopup_AddDropDownButton(info, UnitPopupButtons["SUBSECTION_SEPARATOR"], "SUBSECTION_SEPARATOR");
+					UnitPopup_AddDropDownButton(info, UnitPopupButtons[subsectionTitleValue], subsectionTitleValue);
 				else
-					info.colorCode = nil;
-				end
-			end
-
-			-- Icons
-			info.icon = UnitPopupButtons[value].icon;
-			info.tCoordLeft = UnitPopupButtons[value].tCoordLeft;
-			info.tCoordRight = UnitPopupButtons[value].tCoordRight;
-			info.tCoordTop = UnitPopupButtons[value].tCoordTop;
-			info.tCoordBottom = UnitPopupButtons[value].tCoordBottom;
-			-- Checked conditions
-			info.checked = nil;
-			if ( strsub(value, 1, 12) == "RAID_TARGET_"and value ~= "RAID_TARGET_ICON" ) then
-				local raidTargetIndex = GetRaidTargetIndex("target");
-				if ( raidTargetIndex == index ) then
-					info.checked = 1;
-				end
-			elseif ( value == "LARGE_FOCUS" ) then
-				if (GetCVarBool("fullSizeFocusFrame")) then
-					info.checked = 1;
+					UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][subsectionTitleIndex] = 0;
 				end
+				subsectionTitleIndex = nil;
+				subsectionTitleValue = nil;
 			end
 			
-			if ( UnitPopupButtons[value].nested ) then
-				info.hasArrow = 1;
-			else
-				info.hasArrow = nil;
-			end
-			if ( UnitPopupButtons[value].isNotRadio ) then
-				info.isNotRadio = 1
-			else
-				info.isNotRadio = nil;
-			end
+			previousWasSubsectionTitle = false;
 			
-			-- Setup newbie tooltips
-			info.tooltipTitle = UnitPopupButtons[value].text;
-			tooltipText = _G["NEWBIE_TOOLTIP_UNIT_"..value];
-			if ( not tooltipText ) then
-				tooltipText = UnitPopupButtons[value].tooltipText;
+			if ( cntButton.isSubsectionTitle ) then
+				subsectionTitleValue = value;
+				subsectionTitleIndex = index;
+				previousWasSubsectionTitle = true;
+			else
+				UnitPopup_AddDropDownButton(info, cntButton, value);
 			end
-			info.tooltipText = tooltipText;
-			UIDropDownMenu_AddButton(info);
 		end
 	end
 	PlaySound("igMainMenuOpen");
 end
 
+function UnitPopup_AddDropDownButton (info, cntButton, buttonIndex, level)
+	if (not level) then
+		level = 1;
+	end
+
+	info.text = cntButton.text;
+	info.value = buttonIndex;
+	info.owner = nil;
+	info.func = UnitPopup_OnClick;
+	if ( not cntButton.checkable ) then
+		info.notCheckable = 1;
+	else
+		info.notCheckable = nil;
+	end
+	-- Text color
+	if ( buttonIndex == "LOOT_THRESHOLD" ) then
+		-- Set the text color
+		info.colorCode = ITEM_QUALITY_COLORS[GetLootThreshold()].hex;
+	else
+		local color = cntButton.color;
+		if ( color ) then
+			info.colorCode = string.format("|cFF%02x%02x%02x",  color.r*255,  color.g*255,  color.b*255);
+		else
+			info.colorCode = nil;
+		end
+	end
+		-- Icons
+	if ( cntButton.iconOnly ) then
+		info.iconOnly = 1;
+		info.icon = cntButton.icon;
+		info.iconInfo = { tCoordLeft = cntButton.tCoordLeft, 
+							tCoordRight = cntButton.tCoordRight,
+							tCoordTop = cntButton.tCoordTop,
+							tCoordBottom = cntButton.tCoordBottom,
+							tSizeX = cntButton.tSizeX,
+							tSizeY = cntButton.tSizeY,
+							tFitDropDownSizeX = cntButton.tFitDropDownSizeX };
+	else
+		info.iconOnly = nil;
+		info.icon = cntButton.icon;
+		info.tCoordLeft = cntButton.tCoordLeft;
+		info.tCoordRight = cntButton.tCoordRight;
+		info.tCoordTop = cntButton.tCoordTop;
+		info.tCoordBottom = cntButton.tCoordBottom;
+		info.iconInfo = nil;
+	end
+	
+	-- Checked conditions
+	if (level == 1) then
+		info.checked = nil;
+	end
+	if ( buttonIndex == "LARGE_FOCUS" ) then
+		if ( GetCVarBool("fullSizeFocusFrame") ) then
+			info.checked = 1;
+		end
+	end
+	
+	if ( cntButton.nested ) then
+		info.hasArrow = 1;
+	else
+		info.hasArrow = nil;
+	end
+	if ( cntButton.isNotRadio ) then
+		info.isNotRadio = 1
+	else
+		info.isNotRadio = nil;
+	end
+	if ( cntButton.isTitle ) then
+		info.isTitle = 1;
+	else
+		if (level == 1) then
+			info.disabled = nil;
+		end
+		info.isTitle = nil;
+	end
+	
+	-- Setup newbie tooltips
+	info.tooltipTitle = cntButton.text;
+	local tooltipText = _G["NEWBIE_TOOLTIP_UNIT_"..buttonIndex];
+	if ( not tooltipText ) then
+		tooltipText = cntButton.tooltipText;
+	end
+	info.tooltipText = tooltipText;
+	
+	UIDropDownMenu_AddButton(info, level);	
+end
+
 function UnitPopup_HideButtons ()
 	local dropdownMenu = UIDROPDOWNMENU_INIT_MENU;
 	local inInstance, instanceType = IsInInstance();
@@ -659,9 +792,13 @@ function UnitPopup_HideButtons ()
 				end
 			end
 		elseif ( value == "BN_INVITE" ) then
-			local presenceID, presenceName, battleTag, isBattleTagPresence, toonName = BNGetFriendInfoByID(dropdownMenu.presenceID);
-			if ( CanCooperateWithToon(dropdownMenu.presenceID) and (UnitInParty(toonName) or UnitInRaid(toonName)) ) then
+			if ( not dropdownMenu.presenceID or not BNFeaturesEnabledAndConnected() ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
+			else
+				local presenceID, presenceName, battleTag, isBattleTagPresence, toonName = BNGetFriendInfoByID(dropdownMenu.presenceID);
+				if ( CanCooperateWithToon(dropdownMenu.presenceID) and (UnitInParty(toonName) or UnitInRaid(toonName)) ) then
+					UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
+				end
 			end
 		elseif ( value == "FOLLOW" ) then
 			if ( canCoop == 0 ) then
@@ -815,6 +952,10 @@ function UnitPopup_HideButtons ()
 			if ( (inParty == 0) or ((isLeader == 0) and (GetLootMethod() ~= "needbeforegreed")) ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
 			end
+		elseif ( value == "PERSONAL_LOOT" ) then
+			if ( (inParty == 0) or ((isLeader == 0) and (GetLootMethod() ~= "personalloot")) ) then
+				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
+			end
 		elseif ( value == "LOOT_THRESHOLD" ) then
 			if ( inParty == 0 or HasLFGRestrictions() ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
@@ -917,7 +1058,7 @@ function UnitPopup_HideButtons ()
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
 			end
 		elseif ( value == "RAID_DIFFICULTY" ) then
-			if ( UnitLevel("player") < 65 and GetRaidDifficultyID() == UnitPopupButtons[value].defaultDifficultyID ) then
+			if ( UnitLevel("player") < MAX_PLAYER_LEVEL_TABLE[EXPANSION_LEVEL_WRATH_OF_THE_LICH_KING] and GetRaidDifficultyID() == UnitPopupButtons[value].defaultDifficultyID ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
 			end
 		elseif ( value == "MUTE" ) then
@@ -1134,7 +1275,7 @@ function UnitPopup_HideButtons ()
 			if ( not IsVoiceChatEnabled() or not dropdownMenu.name or dropdownMenu.name == UNKNOWNOBJECT or not GetVoiceStatus(dropdownMenu.name) ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;			
 			else
-				if (  inBattleground == 0 ) then
+				if ( inBattleground == 0 ) then
 					if ( ( inParty == 1 and isAssistant == 1 and inRaid == 1 ) ) then
 						if ( not UnitIsSilenced(dropdownMenu.name, "raid") ) then
 							UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
@@ -1195,6 +1336,10 @@ function UnitPopup_HideButtons ()
 			if ( C_Scenario.IsInScenario() or not ( IsInGroup() and not HasLFGRestrictions() and (isLeader ~= 0 or isAssistant ~= 0 or UnitIsUnit(dropdownMenu.unit, "player")) ) ) then
 				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
 			end
+		elseif ( value == "GARRISON_VISIT" ) then
+			if ( not C_Garrison.IsVisitGarrisonAvailable() ) then
+				UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = 0;
+			end
 		end
 	end
 end
@@ -1219,6 +1364,11 @@ function UnitPopup_OnUpdate (elapsed)
 	if ( IsInGroup() ) then
 		inParty = 1;
 	end
+	
+	local inPublicParty = 0;
+	if ( IsInGroup(LE_PARTY_CATEGORY_INSTANCE) ) then
+		inPublicParty = 1;
+	end
 
 	local isLeader = 0;
 	if ( UnitIsGroupLeader("player") ) then
@@ -1233,7 +1383,7 @@ function UnitPopup_OnUpdate (elapsed)
 	local toggleDifficultyID;
 	local _, instanceType, instanceDifficultyID, _, _, _, isDynamicInstance = GetInstanceInfo();
 	if ( isDynamicInstance and CanChangePlayerDifficulty() ) then
-		_, _, _, _, toggleDifficultyID = GetDifficultyInfo(instanceDifficultyID);
+		_, _, _, _, _, _, toggleDifficultyID = GetDifficultyInfo(instanceDifficultyID);
 	end
 	
 	-- Loop through all menus and enable/disable their buttons appropriately
@@ -1246,10 +1396,10 @@ function UnitPopup_OnUpdate (elapsed)
 				if ( UnitPopupShown[level][index] == 1 ) then
 					count = count + 1;
 					local enable = 1;
-					if ( UnitPopupButtons[value].dist > 0 ) then
-						if ( not CheckInteractDistance(dropdownFrame.unit, UnitPopupButtons[value].dist) ) then
-							enable = 0;
-						end
+					local notClickable = 0;
+					if ( UnitPopupButtons[value].isUninteractable or 
+						(UnitPopupButtons[value].dist > 0 and not CheckInteractDistance(dropdownFrame.unit, UnitPopupButtons[value].dist)) ) then
+						enable = 0;
 					end
 
 					if ( value == "TRADE" ) then
@@ -1346,14 +1496,31 @@ function UnitPopup_OnUpdate (elapsed)
 						if ( ( inParty == 1 and isLeader == 0 ) or inInstance or HasLFGRestrictions() ) then
 							enable = 0;	
 						end
-					elseif ( value == "RAID_DIFFICULTY" and inInstance and not toggleDifficultyID ) then
-						enable = 0;
+					elseif ( value == "RAID_DIFFICULTY" ) then
+						if( inInstance and not toggleDifficultyID ) then
+							enable = 0;
+						elseif( inParty == 1 and isLeader == 0 or inPublicParty == 1 ) then
+							enable = 0;
+						end
 					elseif ( ( strsub(value, 1, 15) == "RAID_DIFFICULTY" ) and ( strlen(value) > 15 ) ) then
-						if ( ( inParty == 1 and isLeader == 0 ) or inInstance ) then
+						if ( ( inParty == 1 and isLeader == 0 ) or inPublicParty == 1 or inInstance ) then
 							enable = 0;	
 						end
-						if ( toggleDifficultyID and toggleDifficultyID == UnitPopupButtons[value].difficultyID ) then
-							enable = 1;
+						if (toggleDifficultyID) then
+							enable = CheckToggleDifficulty(toggleDifficultyID, UnitPopupButtons[value].difficultyID);
+						end
+						if (UnitPopupButtons[value].difficultyID == DIFFICULTY_PRIMARYRAID_MYTHIC and UnitLevel("player") < MAX_PLAYER_LEVEL_TABLE[EXPANSION_LEVEL_MISTS_OF_PANDARIA]) then
+							enable = 0;
+						end
+					elseif ( ( strsub(value, 1, 22) == "LEGACY_RAID_DIFFICULTY" ) and ( strlen(value) > 22 ) ) then
+						if ( ( inParty == 1 and isLeader == 0 ) or inPublicParty == 1 or inInstance or GetRaidDifficultyID() == DIFFICULTY_PRIMARYRAID_MYTHIC ) then
+							enable = 0;	
+						end
+						if (toggleDifficultyID) then
+							if (IsLegacyDifficulty(toggleDifficultyID)) then
+								notClickable = CheckToggleDifficulty(toggleDifficultyID, UnitPopupButtons[value].difficultyID);
+							end
+							enable = 0;
 						end
 					elseif ( value == "CONVERT_TO_PARTY" ) then
 						if ( GetNumGroupMembers() > MEMBERS_PER_RAID_GROUP ) then
@@ -1406,15 +1573,26 @@ function UnitPopup_OnUpdate (elapsed)
 						end
 					end
 
-					if ( level > 1 ) then
-						tempCount = count;
+					local diff = (level > 1) and 0 or 1;
+
+					if ( UnitPopupButtons[value].isSubsectionTitle ) then
+						--If the button is a title then it has a separator above it that is not in UnitPopupButtons.
+						--So 1 extra is added to each count because UnitPopupButtons does not count the separators and
+						--the DropDown does.
+						tempCount = count + diff;
+						count = count + 1;
 					else
-						tempCount = count + 1;
+						tempCount = count + diff;
 					end
 
 					if ( enable == 1 ) then
 						UIDropDownMenu_EnableButton(level, tempCount);
 					else
+						if (notClickable == 1) then
+							UIDropDownMenu_SetButtonNotClickable(level, tempCount);
+						else
+							UIDropDownMenu_SetButtonClickable(level, tempCount);
+						end
 						UIDropDownMenu_DisableButton(level, tempCount);
 					end
 				end
@@ -1464,7 +1642,7 @@ function UnitPopup_OnClick (self)
 	elseif ( button == "ACHIEVEMENTS" ) then
 		InspectAchievements(unit);
 	elseif ( button == "TARGET" ) then
-		TargetUnit(fullname, 1);
+		TargetUnit(fullname, true);
 	elseif ( button == "IGNORE" ) then
 		AddOrDelIgnore(fullname);
 	elseif ( button == "REPORT_SPAM" ) then
@@ -1478,7 +1656,7 @@ function UnitPopup_OnClick (self)
 			dialog.data = dropdownFrame.unit or tonumber(dropdownFrame.lineID);
 		end
 	elseif ( button == "REPORT_BAD_NAME" ) then
-		if ( GMQuickTicketSystemEnabled() and not GMQuickTicketSystemThrottled() ) then
+		if ( GMEuropaComplaintsEnabled() and not GMQuickTicketSystemThrottled() ) then
 			HelpFrame_ShowReportPlayerNameDialog(dropdownFrame.unit or tonumber(dropdownFrame.lineID));
 		else
 			UIErrorsFrame:AddMessage(ERR_REPORT_SUBMISSION_FAILED , 1.0, 0.1, 0.1, 1.0);
@@ -1496,7 +1674,7 @@ function UnitPopup_OnClick (self)
 		C_PetBattles.SetPendingReportTargetFromUnit(unit);
 		StaticPopup_Show("CONFIRM_REPORT_BATTLEPET_NAME", fullname);
 	elseif ( button == "REPORT_CHEATING" ) then
-		if ( GMQuickTicketSystemEnabled() and not GMQuickTicketSystemThrottled() ) then
+		if ( GMEuropaComplaintsEnabled() and not GMQuickTicketSystemThrottled() ) then
 			HelpFrame_ShowReportCheatingDialog(dropdownFrame.unit or tonumber(dropdownFrame.lineID));
 		else
 			UIErrorsFrame:AddMessage(ERR_REPORT_SUBMISSION_FAILED , 1.0, 0.1, 0.1, 1.0);
@@ -1510,9 +1688,9 @@ function UnitPopup_OnClick (self)
 	elseif ( button == "POP_OUT_CHAT" ) then
 		FCF_OpenTemporaryWindow(dropdownFrame.chatType, dropdownFrame.chatTarget, dropdownFrame.chatFrame, true);
 	elseif ( button == "DUEL" ) then
-		StartDuel(unit, 1);
+		StartDuel(unit, true);
 	elseif ( button == "PET_BATTLE_PVP_DUEL" ) then
-		C_PetBattles.StartPVPDuel(unit, 1);
+		C_PetBattles.StartPVPDuel(unit, true);
 	elseif ( button == "INVITE" ) then
 		InviteToGroup(fullname);
 	elseif ( button == "UNINVITE" or button == "VOTE_TO_KICK" ) then
@@ -1603,6 +1781,10 @@ function UnitPopup_OnClick (self)
 		SetLootMethod("needbeforegreed");
 		UIDropDownMenu_SetButtonText(self:GetParent().parentLevel, self:GetParent().parentID, UnitPopupButtons[button].text);
 		UIDropDownMenu_Refresh(dropdownFrame, nil, 1);
+	elseif ( button == "PERSONAL_LOOT" ) then
+		SetLootMethod("personalloot");
+		UIDropDownMenu_SetButtonText(self:GetParent().parentLevel, self:GetParent().parentID, UnitPopupButtons[button].text);
+		UIDropDownMenu_Refresh(dropdownFrame, nil, 1);
 	elseif ( button == "OPT_OUT_LOOT_ENABLE" ) then
 		SetOptOutOfLoot(1);
 		CloseDropDownMenus()
@@ -1614,9 +1796,12 @@ function UnitPopup_OnClick (self)
 	elseif ( strsub(button, 1, 18) == "DUNGEON_DIFFICULTY" and (strlen(button) > 18) ) then
 		local dungeonDifficultyID = UnitPopupButtons[button].difficultyID;
 		SetDungeonDifficultyID(dungeonDifficultyID);
-	elseif ( strsub(button, 1, 15) == "RAID_DIFFICULTY" and (strlen(button) > 15) ) then
+	elseif ( strsub(button, 1, 15) == "RAID_DIFFICULTY" and (strlen(button) > 15)) then
 		local raidDifficultyID = UnitPopupButtons[button].difficultyID;
-		SetRaidDifficultyID(raidDifficultyID);
+		SetRaidDifficulties(true, raidDifficultyID);
+	elseif ( strsub(button, 1, 22) == "LEGACY_RAID_DIFFICULTY" and (strlen(button) > 22)) then
+		local raidDifficultyID = UnitPopupButtons[button].difficultyID;
+		SetRaidDifficulties(false, raidDifficultyID);
 	elseif ( button == "LOOT_PROMOTE" ) then
 		SetLootMethod("master", fullname, 1);
 	elseif ( button == "PVP_ENABLE" ) then
@@ -1632,7 +1817,7 @@ function UnitPopup_OnClick (self)
 	elseif ( button == "RESET_CHALLENGE_MODE" ) then
 		StaticPopup_Show("CONFIRM_RESET_CHALLENGE_MODE");
 	elseif ( button == "FOLLOW" ) then
-		FollowUnit(fullname, 1);
+		FollowUnit(fullname, true);
 	elseif ( button == "MUTE" ) then
 		AddMute(fullname);
 	elseif ( button == "UNMUTE" ) then
@@ -1748,6 +1933,91 @@ function UnitPopup_OnClick (self)
 			BNCheckBattleTagInviteToGuildMember(fullname);
 		end
 		CloseDropDownMenus();
+	elseif ( button == "GARRISON_VISIT" ) then
+		C_Garrison.SetUsingPartyGarrison( not C_Garrison.IsUsingPartyGarrison());
 	end
 	PlaySound("UChatScrollButton");
 end
+
+RAID_DIFFICULTY_MAP = {
+	[DIFFICULTY_PRIMARYRAID_NORMAL] = { [10] = DIFFICULTY_RAID10_NORMAL, [25] = DIFFICULTY_RAID25_NORMAL }, -- Normal -> 10-man normal, 25-man normal
+	[DIFFICULTY_PRIMARYRAID_HEROIC] = { [10] = DIFFICULTY_RAID10_HEROIC, [25] = DIFFICULTY_RAID25_HEROIC }, -- Heroic -> 10-man heroic, 25-man heroic
+};
+
+RAID_DIFFICULTY_SIZES = {
+	[DIFFICULTY_RAID10_NORMAL] = 10,
+	[DIFFICULTY_RAID25_NORMAL] = 25,
+	[DIFFICULTY_RAID10_HEROIC] = 10,
+	[DIFFICULTY_RAID25_HEROIC] = 25,
+}
+
+RAID_TOGGLE_MAP = {
+	[DIFFICULTY_PRIMARYRAID_NORMAL] = { DIFFICULTY_RAID10_NORMAL, DIFFICULTY_RAID25_NORMAL },
+	[DIFFICULTY_PRIMARYRAID_HEROIC] = { DIFFICULTY_RAID10_HEROIC, DIFFICULTY_RAID25_HEROIC },
+	[DIFFICULTY_PRIMARYRAID_MYTHIC] = {},
+}
+
+function NormalizeLegacyDifficultyID(difficultyID)
+	if (not IsLegacyDifficulty(difficultyID)) then
+		return difficultyID;
+	end
+
+	-- Normal difficulties are 3 and 4 for 10-player and 25-player, heroic are 5 and 6 respectively.  To "normalize"
+	-- it, we want to always use 3 and 4 (the normal versions), so we subtract 2 to go from heroic to normal.
+	if (difficultyID > 4) then
+		difficultyID = difficultyID - 2;
+	end
+	return difficultyID;
+end
+
+function SetRaidDifficulties(primaryRaid, difficultyID)
+	local otherDifficulty = 0;
+	if (primaryRaid) then
+		local toggleDifficultyID, force;
+		local _, instanceType, instanceDifficultyID, _, _, _, isDynamicInstance = GetInstanceInfo();
+		if ( isDynamicInstance and CanChangePlayerDifficulty() ) then
+			_, _, _, _, _, _, toggleDifficultyID = GetDifficultyInfo(instanceDifficultyID);
+		end
+		if (UnitLevel("player") >= MAX_PLAYER_LEVEL_TABLE[EXPANSION_LEVEL_MISTS_OF_PANDARIA]) then			
+			if (toggleDifficultyID ~= nil and IsLegacyDifficulty(toggleDifficultyID)) then
+				force = true;
+			end
+			SetRaidDifficultyID(difficultyID, force);
+		end
+		if (difficultyID == DIFFICULTY_PRIMARYRAID_MYTHIC) then
+			return;
+		end
+		force = nil;
+		if (toggleDifficultyID ~= nil and not IsLegacyDifficulty(toggleDifficultyID)) then
+			force = true;
+		end
+		otherDifficulty = GetLegacyRaidDifficultyID();
+		local size = RAID_DIFFICULTY_SIZES[otherDifficulty];
+		local newDifficulty = RAID_DIFFICULTY_MAP[difficultyID][size];
+		SetLegacyRaidDifficultyID(newDifficulty, force);
+	else
+		local otherDifficulty = GetRaidDifficultyID();
+		local size = RAID_DIFFICULTY_SIZES[difficultyID];
+		local newDifficulty = RAID_DIFFICULTY_MAP[otherDifficulty][size];
+		SetLegacyRaidDifficultyID(newDifficulty);
+	end
+end
+
+function CheckToggleDifficulty(toggleDifficultyID, difficultyID)
+	local enable;
+	if (IsLegacyDifficulty(toggleDifficultyID)) then
+		if (not IsLegacyDifficulty(difficultyID)) then
+			enable = tContains(RAID_TOGGLE_MAP[difficultyID], toggleDifficultyID);
+		else
+			enable = NormalizeLegacyDifficultyID(difficultyID) == NormalizeLegacyDifficultyID(toggleDifficultyID);
+		end
+	else
+		if (IsLegacyDifficulty(difficultyID)) then
+			enable = 0;
+		else
+			enable = toggleDifficultyID == difficultyID;
+		end
+	end
+
+	return enable and 1 or 0;
+end
\ No newline at end of file