--///////////////////////// Constructors
--//////////////////////////////////////


function module.new(channelName)
	local obj = setmetatable({}, methods)

	local BaseFrame, NameTag, NameTagNonSelect, NameTagSelect, NewMessageIcon, UnselectedFrame, SelectedFrame = CreateGuiObjects()
	obj.GuiObject = BaseFrame
	obj.NameTag = NameTag
	obj.NameTagNonSelect = NameTagNonSelect
	obj.NameTagSelect = NameTagSelect
	obj.NewMessageIcon = NewMessageIcon
	obj.UnselectedFrame = UnselectedFrame
	obj.SelectedFrame = SelectedFrame

	obj.BlueBarLeft = SelectedFrame.BlueBarLeft
	obj.BlueBarRight = SelectedFrame.BlueBarRight
	obj.BackgroundImage = SelectedFrame.BackgroundImage
	obj.WhiteTextNewMessageNotification = obj.NewMessageIcon.TextLabel

	obj.ChannelName = channelName
	obj.UnreadMessageCount = 0
	obj.Active = false

	obj.GuiObject.Name = "Frame_" .. obj.ChannelName

	if (string.len(channelName) > ChatSettings.MaxChannelNameLength) then
		channelName = string.sub(channelName, 1, ChatSettings.MaxChannelNameLength - 3) .. "..."
	end

	--obj.NameTag.Text = channelName

	obj.NameTag.Text = ""
	obj.NameTagNonSelect.Text = channelName
	obj.NameTagSelect.Text = channelName

	obj.AnimParams = {}

	obj:InitializeAnimParams()
	obj:AnimGuiObjects()
	obj:SetActive(false)

	return obj
end

return module
