local _G = getfenv(0)
         
function Skinner:WIM()
                              
-->>-- History Frame
	if not WIM_HistoryFrame.skinned then 
		self:keepRegions(WIM_HistoryExportFormatMenu, {4,5}) -- N.B. regions 4 & 5 are text
		self:removeRegions(WIM_HistoryFrameNameListScrollBar)
		self:skinScrollBar(WIM_HistoryFrameNameListScrollBar)
		self:removeRegions(WIM_HistoryFrameFilterListScrollBar)
		self:skinScrollBar(WIM_HistoryFrameFilterListScrollBar)
		self:removeRegions(WIM_HistoryViewerExportFormat)
		self:skinScrollBar(WIM_HistoryViewerExportFormat)
		self:applySkin(WIM_HistoryFrame)
		WIM_HistoryFrame.skinned = true
	end
	                     
-->>-- Help Frame	
	WIM_HelpTitleBorder:Hide()
	self:moveObject(WIM_HelpExitButton, "+", 10, "+", 10)
	self:removeRegions(WIM_HelpScrollFrame)
	self:skinScrollBar(WIM_HelpScrollFrame)
	self:applySkin(WIM_Help)

-->>-- Tooltip	
	if self.db.profile.Tooltips.style == 3 then WIM_Icon_ToolTip:SetBackdrop(backdrop) end
	self:skinTooltip(WIM_Icon_ToolTip)

-->>-- Conversation Menu 
	self:applySkin(WIM_ConversationMenu)
	
-->>-- Toggle Window
	self:applySkin(WIM_ToggleWindow)

-->>--  Message Frame(s)
	self:SecureHook("WIM_PostMessage", function(user, msg, ttype, from, raw_msg)
		if (WIM_Windows[user] and not WIM_Windows[user].skinned) then
			local frame = _G["WIM_msgFrame"..user]
			self:moveObject(_G[frame:GetName().."ExitButton"], "-", 2, nil, nil)
			self:skinEditBox(_G[frame:GetName().."MsgBox"], {})
			self:keepRegions(frame, {11,12})
			self:applySkin(_G[frame:GetName().."IgnoreConfirm"])
			self:applySkin(frame, nil)
			WIM_Windows[user].skinned = true
		end
		end)

end

function Skinner:WIM_Options()

-->>-- Options Frame
	WIM_OptionsTitleBorder:Hide()
	self:moveObject(WIM_OptionsExitButton, "+", 10, "+", 10)
	self:keepRegions(WIM_OptionsDropDownFrame, {4,5}) 
	self:removeRegions(WIM_Options_GeneralScroll)
	self:skinScrollBar(WIM_Options_GeneralScroll)
	self:keepRegions(WIM_OptionsTabbedFrameWindowWindowMode, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameWindowCascadeDirection, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameWindowTimeOutFriendMenu, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameWindowTimeOutNonFriendMenu, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameHistoryMessageCount, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameHistoryMaxCount, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameHistoryAutoDeleteTime, {4,5})
	self:keepRegions(WIM_OptionsTabbedFrameFilterAliasPanelScrollBar, {})
	self:skinScrollBar(WIM_OptionsTabbedFrameFilterAliasPanelScrollBar)
	self:keepRegions(WIM_OptionsTabbedFrameFilterFilteringPanelScrollBar, {})
	self:skinScrollBar(WIM_OptionsTabbedFrameFilterFilteringPanelScrollBar)
	self:keepRegions(WIM_OptionsTabbedFrameHistoryPanelScrollBar, {})
	self:skinScrollBar(WIM_OptionsTabbedFrameHistoryPanelScrollBar)
	self:applySkin(WIM_Options)	
	
-->>-- Alias Frame
	WIM_Options_AliasWindowTitleBorder:Hide()
	WIM_Options_AliasWindowPanel1:SetBackdrop(nil)
	WIM_Options_AliasWindowPanel2:SetBackdrop(nil)
	self:moveObject(WIM_Options_AliasWindow_Name, "-", 5, "-", 5)
	self:skinEditBox(WIM_Options_AliasWindow_Name)
	self:moveObject(WIM_Options_AliasWindow_Alias, "-", 5, "-", 5)
	self:skinEditBox(WIM_Options_AliasWindow_Alias)
	self:applySkin(WIM_Options_AliasWindow)
-->>-- Filter Frame
	WIM_Options_FilterWindowTitleBorder:Hide()
	WIM_Options_FilterWindowPanel1:SetBackdrop(nil)
	self:moveObject(WIM_Options_FilterWindow_Name, "-", 5, "-", 5)
	self:skinEditBox(WIM_Options_FilterWindow_Name)
	self:applySkin(WIM_Options_FilterWindow)
-->>-- History Frame
	if not WIM_HistoryFrame.skinned then 
		self:keepRegions(WIM_HistoryExportFormatMenu, {4,5}) -- N.B. regions 4 & 5 are text
		self:removeRegions(WIM_HistoryFrameNameListScrollBar)
		self:skinScrollBar(WIM_HistoryFrameNameListScrollBar)
		self:removeRegions(WIM_HistoryFrameFilterListScrollBar)
		self:skinScrollBar(WIM_HistoryFrameFilterListScrollBar)
		self:removeRegions(WIM_HistoryViewerExportFormat)
		self:skinScrollBar(WIM_HistoryViewerExportFormat)
		self:applySkin(WIM_HistoryFrame)
		WIM_HistoryFrame.skinned = true
	end
	
end
