function AtlasLootPvPButton_OnClick(setid)
    for i = 1, 30, 1 do
        getglobal("AtlasLootMenuItem_"..i):Hide();
    end
    getglobal("AtlasLootItemsFrame_NEXT"):Hide();
    getglobal("AtlasLootItemsFrame_PREV"):Hide();
    if AtlasLootBGItems[setid]~=nil then
        if(setid=="AVFriendly") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ALTERAC..": "..ATLASLOOT_FRIENDLY, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="AVHonored";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
        elseif(setid=="AVHonored") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ALTERAC..": "..ATLASLOOT_HONORED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="AVRevered";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="AVFriendly";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="AVRevered") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ALTERAC..": "..ATLASLOOT_REVERED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="AVExalted";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="AVHonored";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="AVExalted") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ALTERAC..": "..ATLASLOOT_EXALTED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_PREV").lootpage="AVRevered";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="ABFriendly") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ARATHI..": "..ATLASLOOT_FRIENDLY, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="ABHonored";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
        elseif(setid=="ABHonored") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ARATHI..": "..ATLASLOOT_HONORED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="ABRevered";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="ABFriendly";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="ABRevered") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ARATHI..": "..ATLASLOOT_REVERED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="ABExalted";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="ABHonored";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="ABExalted") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_ARATHI..": "..ATLASLOOT_EXALTED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_PREV").lootpage="ABRevered";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="WSGFriendly") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_WARSONG..": "..ATLASLOOT_FRIENDLY, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="WSGHonored";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
        elseif(setid=="WSGHonored") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_WARSONG..": "..ATLASLOOT_HONORED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="WSGRevered";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="WSGFriendly";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="WSGRevered") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_WARSONG..": "..ATLASLOOT_REVERED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_NEXT").lootpage="WSGExalted";
            getglobal("AtlasLootItemsFrame_NEXT"):Show();
            getglobal("AtlasLootItemsFrame_PREV").lootpage="WSGHonored";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        elseif(setid=="WSGExalted") then
            AtlasLoot_ShowItemsFrame(setid, AtlasLootBGItems, ATLASLOOT_FACTION_WARSONG..": "..ATLASLOOT_EXALTED, AtlasLoot_AnchorFrame);
            getglobal("AtlasLootItemsFrame_PREV").lootpage="WSGRevered";
            getglobal("AtlasLootItemsFrame_PREV"):Show();
        end
    else
        AtlasLoot_ShowBossLoot(setid, this.text, AtlasLoot_AnchorFrame);
    end
end

function AtlasLootPvPMenu()
    for i = 1, 30, 1 do
        getglobal("AtlasLootItem_"..i):Hide();
    end
    for i = 1, 30, 1 do
        getglobal("AtlasLootMenuItem_"..i):Hide();
    end
    getglobal("AtlasLootItemsFrame_BACK"):Hide();
    getglobal("AtlasLootItemsFrame_NEXT"):Hide();
    getglobal("AtlasLootItemsFrame_PREV"):Hide();
    --Alterac Valley
    AtlasLootMenuItem_1_Name:SetText(ATLASLOOT_FACTION_ALTERAC);
    AtlasLootMenuItem_1_Extra:SetText("");
    AtlasLootMenuItem_1_Icon:SetTexture("Interface\\Icons\\INV_Jewelry_Necklace_21");
    AtlasLootMenuItem_1.type="PvP";
    AtlasLootMenuItem_1.lootpage="AVFriendly";
    AtlasLootMenuItem_1.text=ATLASLOOT_FACTION_ALTERAC;
    AtlasLootMenuItem_1:Show();
    --Arathi Basin
    AtlasLootMenuItem_2_Name:SetText(ATLASLOOT_FACTION_ARATHI);
    AtlasLootMenuItem_2_Extra:SetText("");
    AtlasLootMenuItem_2_Icon:SetTexture("Interface\\Icons\\INV_Jewelry_Amulet_07");
    AtlasLootMenuItem_2.type="PvP";
    AtlasLootMenuItem_2.lootpage="ABFriendly";
    AtlasLootMenuItem_2.text=ATLASLOOT_FACTION_ARATHI;
    AtlasLootMenuItem_2:Show();
    --Hellfire Alliance
    AtlasLootMenuItem_4_Name:SetText(ATLASLOOT_ZONE_HELLFIRE);
    AtlasLootMenuItem_4_Extra:SetText("|cffFF8400"..ATLASLOOT_ZONE_HELLFIRE_W_PVP_AL);
    AtlasLootMenuItem_4_Icon:SetTexture("Interface\\Icons\\INV_Misc_Token_HonorHold");
    AtlasLootMenuItem_4.type="PvP";
    AtlasLootMenuItem_4.lootpage="HellAlliance";
    AtlasLootMenuItem_4.text=ATLASLOOT_ZONE_HELLFIRE_W_PVP_AL;
    AtlasLootMenuItem_4:Show();
    --Zangarmarsh
    AtlasLootMenuItem_5_Name:SetText(ATLASLOOT_ZONE_ZANGAR);
    AtlasLootMenuItem_5_Extra:SetText("|cffFF8400"..ATLASLOOT_ZONE_ZANGAR_W_PVP);
    AtlasLootMenuItem_5_Icon:SetTexture("Interface\\Icons\\Spell_Nature_ElementalPrecision_1");
    AtlasLootMenuItem_5.type="PvP";
    AtlasLootMenuItem_5.lootpage="Zangarmarsh";
    AtlasLootMenuItem_5.text=ATLASLOOT_ZONE_ZANGAR_W_PVP;
    AtlasLootMenuItem_5:Show();
    --Nagrand
    AtlasLootMenuItem_6_Name:SetText(ATLASLOOT_ZONE_NAGRAND);
    AtlasLootMenuItem_6_Extra:SetText("|cffFF8400"..ATLASLOOT_ZONE_NAGRAND_W_PVP);
    AtlasLootMenuItem_6_Icon:SetTexture("Interface\\Icons\\INV_Misc_Rune_09");
    AtlasLootMenuItem_6.type="PvP";
    AtlasLootMenuItem_6.lootpage="Nagrand";
    AtlasLootMenuItem_6.text=ATLASLOOT_ZONE_NAGRAND_W_PVP;
    AtlasLootMenuItem_6:Show();
    --Arena PvP
    AtlasLootMenuItem_8_Name:SetText(ATLASLOOT_ARENA_SETS);
    AtlasLootMenuItem_8_Extra:SetText("");
    AtlasLootMenuItem_8_Icon:SetTexture("Interface\\Icons\\INV_Mace_36");
    AtlasLootMenuItem_8.type="Sets";
    AtlasLootMenuItem_8.lootpage="ARENASET";
    AtlasLootMenuItem_8:Show();
    --PvP
    AtlasLootMenuItem_9_Name:SetText(ATLASLOOT_PVP_SETS);
    AtlasLootMenuItem_9_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_60);
    AtlasLootMenuItem_9_Icon:SetTexture("Interface\\Icons\\INV_Axe_02");
    AtlasLootMenuItem_9.type="Sets";
    AtlasLootMenuItem_9.lootpage="PVPSET";
    AtlasLootMenuItem_9:Show();
    --PvP lvl 70
    AtlasLootMenuItem_10_Name:SetText(ATLASLOOT_PVP_SETS);
    AtlasLootMenuItem_10_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_70);
    AtlasLootMenuItem_10_Icon:SetTexture("Interface\\Icons\\INV_Axe_02");
    AtlasLootMenuItem_10.type="Sets";
    AtlasLootMenuItem_10.lootpage="PVP70SET";
    AtlasLootMenuItem_10:Show();
    --PvP Accessories
    AtlasLootMenuItem_11_Name:SetText(ATLASLOOT_PVP_ACCESSORIES);
    AtlasLootMenuItem_11_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_70);
    AtlasLootMenuItem_11_Icon:SetTexture("Interface\\Icons\\INV_Jewelry_Talisman_09");
    AtlasLootMenuItem_11.type="Sets";
    AtlasLootMenuItem_11.lootpage="PvP70Accessories";
    AtlasLootMenuItem_11:Show();
    --Warsong Gulch
    AtlasLootMenuItem_16_Name:SetText(ATLASLOOT_FACTION_WARSONG);
    AtlasLootMenuItem_16_Extra:SetText("");
    AtlasLootMenuItem_16_Icon:SetTexture("Interface\\Icons\\INV_Misc_Rune_07");
    AtlasLootMenuItem_16.type="PvP";
    AtlasLootMenuItem_16.lootpage="WSGFriendly";
    AtlasLootMenuItem_16.text=ATLASLOOT_FACTION_WARSONG;
    AtlasLootMenuItem_16:Show();
    --Hellfire Horde
    AtlasLootMenuItem_19_Name:SetText(ATLASLOOT_ZONE_HELLFIRE);
    AtlasLootMenuItem_19_Extra:SetText("|cffFF8400"..ATLASLOOT_ZONE_HELLFIRE_W_PVP_HO);
    AtlasLootMenuItem_19_Icon:SetTexture("Interface\\Icons\\INV_Misc_Token_Thrallmar");
    AtlasLootMenuItem_19.type="PvP";
    AtlasLootMenuItem_19.lootpage="HellHorde";
    AtlasLootMenuItem_19.text=ATLASLOOT_ZONE_HELLFIRE_W_PVP_HO;
    AtlasLootMenuItem_19:Show();
    --Terokkar Forest
    AtlasLootMenuItem_20_Name:SetText(ATLASLOOT_ZONE_TEROKKAR);
    AtlasLootMenuItem_20_Extra:SetText("|cffFF8400"..ATLASLOOT_ZONE_TEROKKAR_W_PVP);
    AtlasLootMenuItem_20_Icon:SetTexture("Interface\\Icons\\INV_Jewelry_FrostwolfTrinket_04");
    AtlasLootMenuItem_20.type="PvP";
    AtlasLootMenuItem_20.lootpage="Terokkar";
    AtlasLootMenuItem_20.text=ATLASLOOT_ZONE_TEROKKAR_W_PVP;
    AtlasLootMenuItem_20:Show();
    --Arena Weapons
    AtlasLootMenuItem_23_Name:SetText(ATLASLOOT_ARENA_WEAPONS);
    AtlasLootMenuItem_23_Extra:SetText("");
    AtlasLootMenuItem_23_Icon:SetTexture("Interface\\Icons\\INV_Weapon_Crossbow_10");
    AtlasLootMenuItem_23.type="Sets";
    AtlasLootMenuItem_23.lootpage="ArenaWeapons";
    AtlasLootMenuItem_23:Show();
    --Weapons
    AtlasLootMenuItem_24_Name:SetText(ATLASLOOT_PVP_WEAPONS);
    AtlasLootMenuItem_24_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_60);
    AtlasLootMenuItem_24_Icon:SetTexture("Interface\\Icons\\INV_Weapon_Bow_08");
    AtlasLootMenuItem_24.type="Sets";
    AtlasLootMenuItem_24.lootpage="PVPWeapons1";
    AtlasLootMenuItem_24:Show();
    --Weapons level 70
    AtlasLootMenuItem_25_Name:SetText(ATLASLOOT_PVP_WEAPONS);
    AtlasLootMenuItem_25_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_70);
    AtlasLootMenuItem_25_Icon:SetTexture("Interface\\Icons\\INV_Weapon_Bow_08");
    AtlasLootMenuItem_25.type="Sets";
    AtlasLootMenuItem_25.lootpage="PVP70Weapons1";
    AtlasLootMenuItem_25:Show();
    --PvP Non-set Epics
    AtlasLootMenuItem_26_Name:SetText(ATLASLOOT_PVP_NONSET);
    AtlasLootMenuItem_26_Extra:SetText("|cffFF8400"..ATLASLOOT_LEVEL_70);
    AtlasLootMenuItem_26_Icon:SetTexture("Interface\\Icons\\INV_Boots_05");
    AtlasLootMenuItem_26.type="Sets";
    AtlasLootMenuItem_26.lootpage="PvP70NonSet1";
    AtlasLootMenuItem_26:Show();
    for i = 1, 30, 1 do
        getglobal("AtlasLootMenuItem_"..i.."_Extra"):Show();
    end
    AtlasLoot_BossName:SetText("|cffFFFFFF"..ATLASLOOT_PANEL_BUTTON_PVP);
    AtlasLoot_SetItemInfoFrame(AtlasLoot_AnchorFrame);
end
