local ndt, npt, ndt2, npt2
--ndt = new dungeon tab
--npt = new pvp tab

local function ndt_OnClick(self)
	if not PVEFrame:IsVisible() then
		PVEFrame_ToggleFrame()
		if PVPFrame:IsVisible() then
			TogglePVPFrame()
		end
	end
end

local function npt_OnClick(self)
	if not PVPFrame:IsVisible() then
		TogglePVPFrame()
		if PVEFrame:IsVisible() then
			PVEFrame_ToggleFrame()
		end
	end
end

do
	ndt = CreateFrame("CheckButton", nil, PVEFrame, "SpellBookSkillLineTabTemplate")
		ndt:Show()
		ndt:SetPoint("TOPLEFT", PVEFrame, "TOPRIGHT", 0, -35)
		ndt:SetFrameStrata("LOW")
		ndt.tooltip = DUNGEONS_BUTTON
		--ndt:SetNormalTexture("Interface\\LFGFRAME\\UI-LFG-PORTRAIT")
		--ndt:SetNormalTexture("Interface\\LFGFRAME\\BattlenetWorking0")
		--ndt:SetNormalTexture("Interface\\ICONS\\Achievement_GuildPerk_EverybodysFriend")
		ndt:SetNormalTexture("Interface\\ICONS\\Achievement_Dungeon_Outland_Dungeon_Hero")

	npt = CreateFrame("CheckButton", nil, ndt, "SpellBookSkillLineTabTemplate")
		npt:Show()
		npt:SetPoint("TOPLEFT", ndt, "BOTTOMLEFT", 0, -15)
		npt:SetFrameStrata("LOW")
		npt.tooltip = PVP
		npt:SetNormalTexture("Interface\\PVPFrame\\RandomPVPIcon")
	
	ndt:SetScript("OnClick", ndt_OnClick)
	npt:SetScript("OnClick", npt_OnClick)
	ndt:SetScript("OnShow", function()
			ndt:SetChecked(true)
			npt:SetChecked(false)
		end)
	
	ndt2 = CreateFrame("CheckButton", nil, PVPFrame, "SpellBookSkillLineTabTemplate")
		ndt2:Show()
		ndt2:SetPoint("TOPLEFT", PVPFrame, "TOPRIGHT", 0, -35)
		ndt2:SetFrameStrata("LOW")
		ndt2.tooltip = DUNGEONS_BUTTON
		--ndt2:SetNormalTexture("Interface\\LFGFRAME\\UI-LFG-PORTRAIT")
		--ndt2:SetNormalTexture("Interface\\LFGFRAME\\BattlenetWorking0")
		--ndt2:SetNormalTexture("Interface\\ICONS\\Achievement_GuildPerk_EverybodysFriend")
		ndt2:SetNormalTexture("Interface\\ICONS\\Achievement_Dungeon_Outland_Dungeon_Hero")

	npt2 = CreateFrame("CheckButton", nil, ndt2, "SpellBookSkillLineTabTemplate")
		npt2:Show()
		npt2:SetPoint("TOPLEFT", ndt2, "BOTTOMLEFT", 0, -15)
		npt2:SetFrameStrata("LOW")
		npt2.tooltip = PVP
		npt2:SetNormalTexture("Interface\\PVPFrame\\RandomPVPIcon")
	
	ndt2:SetScript("OnClick", ndt_OnClick)
	npt2:SetScript("OnClick", npt_OnClick)
	ndt2:SetScript("OnShow", function()
			ndt2:SetChecked(false)
			npt2:SetChecked(true)
		end)
end
