local _G = getfenv(0)

function Skinner:GroupCalendar()

-->>-- Group Calendar Frame
	GroupCalendarFrame:SetWidth(GroupCalendarFrame:GetWidth() * FxMult + 40)
	GroupCalendarFrame:SetHeight(GroupCalendarFrame:GetHeight() * FyMult + 40)
	self:moveObject(GroupCalendarCloseButton, "-", 4, "+", 8)
	self:keepRegions(GroupCalendarCalendarFrame, {1,2,3,4,5,6,7,8})
	self:keepRegions(GroupCalendarAboutFrame, {2,3,4,5,6,7,8,9,10})
	self:keepRegions(GroupCalendarSideListScrollbarTrench, {})
	self:keepRegions(GroupCalendarSideListScrollFrame, {})
	self:skinScrollBar(GroupCalendarSideListScrollFrame)
	self:moveObject(GroupCalendarSidePanelCloseButton, "-", 4, "-", 4)
	self:keepRegions(GroupCalendarSidePanel, {5})
	self:moveObject(GroupCalendarSidePanel, "-", 8, nil, nil)
	self:applySkin(GroupCalendarSidePanel, nil)
	GroupCalendarExcludeGroup:SetHeight(GroupCalendarExcludeGroup:GetHeight() + 5)
	self:keepRegions(CalendarExcludedPlayersListScrollFrame, {})
	self:skinScrollBar(CalendarExcludedPlayersListScrollFrame)
	self:keepRegions(GroupCalendarSetupFrame, {1})
	self:skinEditBox(GroupCalendarChannelName, {9})
	self:skinEditBox(GroupCalendarChannelPassword, {9})
	self:skinEditBox(CalendarTrustedPlayerName, {9})
	self:keepRegions(CalendarConfigModeMenuConfigMode, {4,5}) -- N.B. regions 4 & 5 are text
	self:keepRegions(GroupCalendarTrustMinRank, {4,5}) -- N.B. regions 4 & 5 are text
	self:keepRegions(GroupCalendarFrame, {6})
	self:applySkin(GroupCalendarFrame, nil)

	self:keepRegions(GroupCalendarFrameTab1, {7,8})
	self:keepRegions(GroupCalendarFrameTab2, {7,8})
	self:keepRegions(GroupCalendarFrameTab3, {7,8})
	self:moveObject(GroupCalendarFrameTab1, nil, nil, "-", 21)
	self:moveObject(GroupCalendarFrameTab2, "+", 10, nil, nil)
	self:moveObject(GroupCalendarFrameTab3, "+", 10, nil, nil)
	if self.db.profile.TexturedTab then self:applySkin(GroupCalendarFrameTab1, nil, 0)
	else self:applySkin(GroupCalendarFrameTab1) end
	if self.db.profile.TexturedTab then self:applySkin(GroupCalendarFrameTab2, nil, 0)
	else self:applySkin(GroupCalendarFrameTab2) end
	if self.db.profile.TexturedTab then self:applySkin(GroupCalendarFrameTab3, nil, 0)
	else self:applySkin(GroupCalendarFrameTab3) end
	self:setActiveTab(GroupCalendarFrameTab1)
	self:setInactiveTab(GroupCalendarFrameTab2)
	self:setInactiveTab(GroupCalendarFrameTab3)
	
	self:SecureHook("GroupCalendar_ShowPanel", function(tabNo)
		self:setInactiveTab(GroupCalendarFrameTab1)
		self:setInactiveTab(GroupCalendarFrameTab2)
		self:setInactiveTab(GroupCalendarFrameTab3)
		self:setActiveTab(_G["GroupCalendarFrameTab"..tabNo])
		end)
	

-->>-- Calendar Editor Frame
	self:moveObject(CalendarEditorCloseButton, "-", 4, "-", 4)
	self:keepRegions(CalendarEditorScrollFrame, {})
	self:skinScrollBar(CalendarEditorScrollFrame)
	self:keepRegions(CalendarEditorScrollbarTrench, {})
	self:keepRegions(CalendarEditorFrame, {5,6})
	self:moveObject(CalendarEditorFrame, "-", 8, nil, nil)
	self:applySkin(CalendarEditorFrame, nil)

-->>-- Calendar Event Editor Frame
	self:SecureHook("CalendarEventEditor_OnShow", function()
		HideUIPanel(CalendarEditorFrame)
		end)
	self:SecureHook("CalendarEventEditor_OnHide", function()
		GroupCalendar_SelectDate(gCalendarActualDate)
		end)
	
	self:moveObject(CalendarEventEditorCloseButton, "-", 4, "-", 4)
	CalendarEventEditorEventBackground:Hide()
	self:keepRegions(CalendarEventEditorDurationDuration, {4,5})
	self:keepRegions(CalendarEventEditorDuration, {1})
	self:keepRegions(CalendarEventEditorTimeAMPM, {4,5})
	self:keepRegions(CalendarEventEditorTimeMinute, {4,5})
	self:keepRegions(CalendarEventEditorTimeHour, {4,5})
	self:keepRegions(CalendarEventEditorTime, {1,2})
	self:keepRegions(CalendarEventEditorEventFrame, {2})
	self:keepRegions(CalendarEventTypeEventType, {4,5})
	self:keepRegions(CalendarEventType, {1})
	self:skinEditBox(CalendarEventTitle, {9})
	self:skinEditBox(CalendarEventMinLevel, {9})
	self:skinEditBox(CalendarEventMaxLevel, {9})
	CalendarEventDescriptionFrame:SetWidth(CalendarEventDescriptionFrame:GetWidth() + 10)
	CalendarEventDescriptionFrame:SetHeight(CalendarEventDescriptionFrame:GetHeight() + 10)
	self:moveObject(self:getRegion(CalendarEventDescriptionScrollFrame, 1), "-", 10, "+", 3)
	self:moveObject(CalendarEventDescription, "-", 5, nil, nil)
	self:keepRegions(CalendarEventDescriptionFrame, {})
	self:applySkin(CalendarEventDescriptionFrame)
	self:keepRegions(CalendarEventDescriptionScrollFrame, {1})
	self:moveObject(CalendarEventDescriptionScrollFrame, "+", 8, "-", 7)
	self:skinScrollBar(CalendarEventDescriptionScrollFrame)
	self:keepRegions(CalendarEventEditorFrame, {5})
	self:moveObject(CalendarEventEditorFrame, "-", 8, nil, nil)
	self:applySkin(CalendarEventEditorFrame)
	-- Tabs
	self:keepRegions(CalendarEventEditorFrameTab1, {7,8})
	self:keepRegions(CalendarEventEditorFrameTab2, {7,8})
	self:moveObject(CalendarEventEditorFrameTab1, nil, nil, "+", 5)
	self:moveObject(CalendarEventEditorFrameTab2, "-", 10, nil, nil)
	if self.db.profile.TexturedTab then self:applySkin(CalendarEventEditorFrameTab1, nil, 0)
	else self:applySkin(CalendarEventEditorFrameTab1) end
	if self.db.profile.TexturedTab then self:applySkin(CalendarEventEditorFrameTab2, nil, 0)
	else self:applySkin(CalendarEventEditorFrameTab2) end
	self:setActiveTab(CalendarEventEditorFrameTab1)
	self:setInactiveTab(CalendarEventEditorFrameTab2)
	
	self:SecureHook("CalendarEventEditor_ShowPanel", function(tabNo)
		self:setInactiveTab(CalendarEventEditorFrameTab1)
		self:setInactiveTab(CalendarEventEditorFrameTab2)
		self:setActiveTab(_G["CalendarEventEditorFrameTab"..tabNo])
		end)

-->>-- Calendar Event Editor Attendance Frame
	self:keepRegions(CalendarEventEditorAttendanceExpandAll, {7,8})
	self:keepRegions(CalendarEventEditorAttendanceGroupTab, {7,8})
	self:keepRegions(CalendarEventEditorAttendanceScrollFrame, {})
	self:skinScrollBar(CalendarEventEditorAttendanceScrollFrame)
	self:keepRegions(CalendarEventEditorAttendanceScrollbarTrench, {})
	self:keepRegions(CalendarEventEditorAttendanceGroupView, {2,3})
	self:keepRegions(CalendarEventEditorAttendanceMainViewTotals, {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
	self:keepRegions(CalendarEventEditorAttendanceMainViewAutoConfirmMenu, {4})
	self:keepRegions(CalendarEventEditorAttendanceMainViewAutoConfirm, {})
	self:keepRegions(CalendarEventEditorAttendanceMainView, {})
	self:keepRegions(CalendarEventEditorAttendanceViewMenu, {4})
	self:keepRegions(CalendarEventEditorAttendance, {1})
	self:keepRegions(CalendarEventEditorAttendanceFrame, {})

-->>-- Add Player Frame
	self:keepRegions(CalendarAddPlayerFrameWhisper, {1,2})
	self:keepRegions(CalendarAddPlayerFrameGuildRankMenu, {4,5})
	self:keepRegions(CalendarAddPlayerFrameGuildRank, {1})
	self:keepRegions(CalendarAddPlayerFrameClassMenu, {4,5})
	self:keepRegions(CalendarAddPlayerFrameClass, {1})
	self:keepRegions(CalendarAddPlayerFrameRaceMenu, {4,5})
	self:keepRegions(CalendarAddPlayerFrameRace, {1})
	self:keepRegions(CalendarAddPlayerFrameStatusMenu, {4,5})
	self:skinEditBox(CalendarAddPlayerFrameName, {9})
	self:skinEditBox(CalendarAddPlayerFrameLevel, {9})
	self:skinEditBox(CalendarAddPlayerFrameComment, {9})
	self:skinEditBox(CalendarAddPlayerFrameWhisperReply, {9})
	self:keepRegions(CalendarAddPlayerFrame, {11})
	self:applySkin(CalendarAddPlayerFrame, true)

-->>-- Calendar Class Limits Frame
	self:skinEditBox(CalendarClassLimitsFrameDruidMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameDruidMax, {9})
	self:skinEditBox(CalendarClassLimitsFramePriestMin, {9})
	self:skinEditBox(CalendarClassLimitsFramePriestMax, {9})
	self:skinEditBox(CalendarClassLimitsFramePaladinMin, {9})
	self:skinEditBox(CalendarClassLimitsFramePaladinMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameHunterMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameHunterMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameRogueMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameRogueMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameShamanMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameShamanMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameMageMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameMageMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameWarlockMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameWarlockMax, {9})
	self:skinEditBox(CalendarClassLimitsFrameWarriorMin, {9})
	self:skinEditBox(CalendarClassLimitsFrameWarriorMax, {9})
	self:keepRegions(CalendarClassLimitsFrameMaxPartySize, {4,5})
	CalendarClassLimitsFrameFrameHeader:Hide()
	self:applySkin(CalendarClassLimitsFrame)
	
-->>-- Calendar Event Viewer Frame
	self:moveObject(EventViewerCloseButton, "-", 4, "-", 4)
	CalendarEventViewerParchment:SetAlpha(0)
	self:keepRegions(CalendarEventViewerCharacterMenu, {4,5})
	self:keepRegions(CalendarEventViewerCharacter, {1})
	self:keepRegions(CalendarEventViewerDescription, {1})
	self:keepRegions(CalendarEventViewerEventFrame, {2,3,4,5,6})
	self:keepRegions(CalendarEventViewerAttendanceGroupView, {2,3})
	self:keepRegions(CalendarEventViewerAttendanceGroupTab, {7,8})
	self:keepRegions(CalendarEventViewerAttendanceViewMenu, {4})
	self:keepRegions(CalendarEventViewerAttendanceScrollFrame, {})
	self:skinScrollBar(CalendarEventViewerAttendanceScrollFrame)
	self:keepRegions(CalendarEventViewerAttendanceMainViewAutoConfirmMenu, {4})
	self:keepRegions(CalendarEventViewerAttendanceMainViewAutoConfirm, {})
	self:keepRegions(CalendarEventViewerAttendanceMainViewTotals, {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
	self:keepRegions(CalendarEventViewerAttendanceMainView, {})
	self:keepRegions(CalendarEventViewerAttendanceScrollbarTrench, {})
	self:keepRegions(CalendarEventViewerAttendance, {1})
	self:keepRegions(CalendarEventViewerAttendanceFrame, {})
	self:skinEditBox(CalendarEventViewerComment, {9})
	self:keepRegions(CalendarEventViewerFrame, {5})
	self:moveObject(CalendarEventViewerFrame, "-", 8, nil, nil)
	self:applySkin(CalendarEventViewerFrame, nil)
	-- Tabs
	self:keepRegions(CalendarEventViewerFrameTab1, {7,8})
	self:keepRegions(CalendarEventViewerFrameTab2, {7,8})
	self:moveObject(CalendarEventViewerFrameTab1, nil, nil, "+", 5)
	self:moveObject(CalendarEventViewerFrameTab2, "-", 10, nil, nil)
	if self.db.profile.TexturedTab then self:applySkin(CalendarEventViewerFrameTab1, nil, 0)
	else self:applySkin(CalendarEventViewerFrameTab1) end
	if self.db.profile.TexturedTab then self:applySkin(CalendarEventViewerFrameTab2, nil, 0)
	else self:applySkin(CalendarEventViewerFrameTab2) end
	self:setActiveTab(CalendarEventViewerFrameTab1)
	self:setInactiveTab(CalendarEventViewerFrameTab2)
	
	self:SecureHook("CalendarEventViewer_ShowPanel", function(tabNo)
		self:setInactiveTab(CalendarEventViewerFrameTab1)
		self:setInactiveTab(CalendarEventViewerFrameTab2)
		self:setActiveTab(_G["CalendarEventViewerFrameTab"..tabNo])
		end)

-->>-- Calendar Event Viewer Attendance Frame
	self:keepRegions(CalendarEventViewerAttendanceExpandAll, {7,8})
	self:keepRegions(CalendarEventViewerAttendanceGroupTab, {7,8})
	self:keepRegions(CalendarEventViewerAttendanceScrollFrame, {})
	self:skinScrollBar(CalendarEventViewerAttendanceScrollFrame)
	self:keepRegions(CalendarEventViewerAttendanceScrollbarTrench, {})
	self:keepRegions(CalendarEventViewerAttendanceGroupView, {2,3})
	self:keepRegions(CalendarEventViewerAttendanceMainViewTotals, {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
	self:keepRegions(CalendarEventViewerAttendanceMainViewAutoConfirmMenu, {4})
	self:keepRegions(CalendarEventViewerAttendanceMainViewAutoConfirm, {})
	self:keepRegions(CalendarEventViewerAttendanceMainView, {})
	self:keepRegions(CalendarEventViewerAttendanceViewMenu, {4})
	self:keepRegions(CalendarEventViewerAttendance, {1})
	self:keepRegions(CalendarEventViewerAttendanceFrame, {})

end
