local _G = getfenv(0)

function Skinner:BlizzardFrames()
--	self:Debug("BlizzardFrames")

	-- only need to do this once
	if self.initialized.BlizzardFrames then return end
	self.initialized.BlizzardFrames = true
    
-->>-- Character Frames
	self:CharacterFrames()
	self:PetStableFrame()
	self:SpellBookFrame()
	self:DressUpFrame()
	self:FriendsFrame()
	self:TradeFrame()
--	self:QuestLog() -- checked with EQL3 below
	self:reSizeQW()
                       
-->>-- UI Frames
	self:Tooltips()
	self:MirrorTimers()
	self:QuestTimers()
	self:CastingBar()
	self:StaticPopups()
	self:ChatTabs()
	self:ChatFrames()
	self:ChatEditBox()
	self:LootFrame()
	self:GroupLoot()
	self:ContainerFrames()
	self:StackSplit()
	self:ItemText()
	self:ColorPicker()
	self:WorldMap()
	self:HelpFrame()
	self:KnowledgeBase()
	self:BattleScore()
	self:ScriptErrors()
	self:Tutorial()
	self:DropDowns()
	self:MenuFrames()
	self:makeModelFramesRotatable()
	self:BankFrame()
	self:MailFrame()
	self:MainMenuBar()
	self:CoinPickup()
	self:LFGFrame()

-->>-- NPC Frames	
	self:MerchantFrames()
	self:GossipFrame()
	self:TaxiFrame()
	self:QuestFrame()
	self:Battlefields()
	self:ArenaFrame()
	self:ArenaRegistrar()
	self:GuildRegistrar()
	self:Petition()
	self:Tabard()

	self:ViewPort()
	self:TopFrame()
	self:MiddleFrames()
	self:BottomFrame()
    
end

function Skinner:AddonFrames()
--	self:Debug("AddonFrames")
	
	-- only need to do this once
	if self.initialized.AddonFrames then return end
	self.initialized.AddonFrames = true

	-- used for Addons that aren't LoadOnDemand
	if self:checkAddOn("BugSack") then self:BugSack() end
	if self:checkAddOn("OneBag") then self:OneBag() end
	if self:checkAddOn("GMail") then self:GMail() end
	if self:checkAddOn("CT_MailMod") then self:CT_MailMod() end
	if self:checkAddOn("EnhancedStackSplit") then self:EnhancedStackSplit() end
	if self:checkAddOn("CT_RaidAssist") then self:CT_RaidAssist() end
    if self:checkAddOn("SuperInspect_UI") then self:SuperInspect_UI() end
	if self:checkAddOn("MCP") then self:MCP() end
	if self:checkAddOn("MyBags") then self:MyBags() end
	if self:checkAddOn("AxuItemMenus") then self:AxuItemMenus() end
	if self:checkAddOn("EnhancedTradeSkills") then self:EnhancedTradeSkills() self:EnhancedTradeCrafts() end
	if self:checkAddOn("AutoProfit") then self:AutoProfit() end
	if self:checkAddOn("FuBar_GarbageFu") then self:FuBar_GarbageFu() end
	if self:checkAddOn("FuBar_DurabilityFu") then self:FuBar_DurabilityFu() end
	if self:checkAddOn("MetaMap") then self:MetaMap() end
	if self:checkAddOn("LootLink") then self:LootLink() end
	if self:checkAddOn("Possessions") then self:Possessions() end
	if self:checkAddOn("ReagentHeaven") then self:ReagentHeaven() end
	if self:checkAddOn("LinkHeaven") then self:LinkHeaven() end
	if self:checkAddOn("EQL3") then self:EQL3() elseif self.db.profile.QuestLog.skin then self:QuestLog() end
	if self:checkAddOn("BattleChat") then self:BattleChat() end
	if self:checkAddOn("KombatStats") then self:KombatStats()	end
	if self:checkAddOn("FruityLoots") then self:FruityLoots() end
	if self:checkAddOn("ItemSync") then self:ItemSync() end
	if self:checkAddOn("oCD") then self:oCD() end
	if self:checkAddOn("GotWood") then self:GotWood() end
	if self:checkAddOn("aftt_extreme") then self:aftt_extreme() end
	if self:checkAddOn("EasyUnlock") then self:EasyUnlock() end
    if self:checkAddOn("SuperMacro") then self:SuperMacro() end
    if self:checkAddOn("MailTo") then self:MailTo() end
    if self:checkAddOn("HoloFriends") then self:HoloFriends() end
    if self:checkAddOn("PVPCooldown") then self:PVPCooldown() end
    if self:checkAddOn("PVPCooldownReborn") then self:PVPCooldown() end
    if self:checkAddOn("BuyPoisons") then self:BuyPoisons() end		
    if self:checkAddOn("IgorsMassAuction") then self:IgorsMassAuction() self:AuctionFrame() end
	if self:checkAddOn("myBindings") then self:myBindings() end
	if self:checkAddOn("GCInfo") then self:GCInfo() end
	if self:checkAddOn("Outfitter") then self:Outfitter() end
	if self:checkAddOn("UberQuest") then self:UberQuest() end
	if self:checkAddOn("CharactersViewer") then self:CharactersViewer() end
	if self:checkAddOn("AdvancedTradeSkillWindow") then self:AdvancedTradeSkillWindow() end
	if self:checkAddOn("EavesDrop") then self:EavesDrop() end
	if self:checkAddOn("Clique") then self:Clique() end
	if self:checkAddOn("DepositBox") then self:DepositBox() end
	if self:checkAddOn("AuctionFilterPlus") then self:AuctionFilterPlus() end
	if self:checkAddOn("MonkeyQuest") then self:MonkeyQuest()	end
	if self:checkAddOn("MonkeyQuestLog") then self:MonkeyQuestLog()	end
	if self:checkAddOn("Cartographer") then self:Cartographer()	end
	if self:checkAddOn("MobileFrames") then self:MobileFrames() end
	if self:checkAddOn("ArgentDawnGrinder") then self:ArgentDawnGrinder() end
	if self:checkAddOn("Atlas") then self:Atlas() end
	if self:checkAddOn("AtlasLoot") then self:AtlasLoot() end
	if self:checkAddOn("AutoDecline") then self:AutoDecline() end
	if self:checkAddOn("SW_Stats") then self:SW_Stats() end
	if self:checkAddOn("StanceSets") then self:StanceSets() end
	if self:checkAddOn("Badapples") then self:Badapples() end
	if self:checkAddOn("FramesResized") then self:FramesResized() end
	if self:checkAddOn("FactionGrinder") then self:FactionGrinder() end
	if self:checkAddOn("Bagnon") then self:Bagnon() end
	if self:checkAddOn("Bagnon_Forever") then self:Bagnon_Forever() end
	if self:checkAddOn("vBagnon") then self:vBagnon() end
	if self:checkAddOn("EngBags") then self:EngBags() end
	if self:checkAddOn("Hadar_FocusFrame") then self:Hadar_FocusFrame() end
	if self:checkAddOn("Converse") then self:Converse() end
	if self:checkAddOn("ArkInventory") then self:ArkInventory() end
	if self:checkAddOn("GFW_FeedOMatic") then self:GFW_FeedOMatic() end
	if self:checkAddOn("Chatr") then self:Chatr() end
	if self:checkAddOn("DamageMeters") then self:DamageMeters() end
	if self:checkAddOn("RABuffs") then self:RABuffs() end
	if self:checkAddOn("EquipCompare") then self:EquipCompare() end
	if self:checkAddOn("Links") then self:Links() end
	if self:checkAddOn("Talented") then self:Talented() end
	if self:checkAddOn("Toons") then self:Toons() end
	if self:checkAddOn("Prat") then self:Prat() end
	if self:checkAddOn("WIM") then self:WIM() end
	if self:checkAddOn("BuffQ") then self:BuffQ() end
	if self:checkAddOn("XRS") then self:XRS() end
	if self:checkAddOn("TipBuddy") then self:TipBuddy() end
	if self:checkAddOn("VanasKoS") then self:VanasKoS() end
	if self:checkAddOn("ACP") then self:ACP() end
	if self:checkAddOn("Junk") then self:Junk() end
	if self:checkAddOn("Epeen") then self:Epeen() end
	if self:checkAddOn("AtlasQuest") then self:AtlasQuest() end
	if self:checkAddOn("RecipeBook") then self:RecipeBook() end
	if self:checkAddOn("Recap") then self:Recap() end
	if self:checkAddOn("tekKompare") then self:tekKompare() end
	if self:checkAddOn("GroupCalendar") then self:GroupCalendar() end
	if self:checkAddOn("CT_RaidTracker") then self:CT_RaidTracker() end
	if self:checkAddOn("MultiTips") then self:MultiTips() end
	if self:checkAddOn("sienasGemViewer") then self:sienasGemViewer() end
	if self:checkAddOn("Bonuses") then self:Bonuses() end
	if self:checkAddOn("Postal") then self:Postal() end
	if self:checkAddOn("KingOfTheJungle") then self:KingOfTheJungle() end
	if self:checkAddOn("SimpleMouseoverTarget") then self:SimpleMouseoverTarget() end
	if self:checkAddOn("Notebook") then self:Notebook() end
	if self:checkAddOn("LootScroll") then self:LootScroll() end
	if self:checkAddOn("Moleskine") then self:Moleskine() end
	if self:checkAddOn("TitanExitGame") then self:TitanExitGame() end
	
	
	-- Perl Classic
	if self:checkAddOn("Perl_Player") then self:Perl_Player() end
	if self:checkAddOn("Perl_Target") then self:Perl_Target() end
	if self:checkAddOn("Perl_Focus") then self:Perl_Focus() end
	if self:checkAddOn("Perl_Target_Target") then self:Perl_Target_Target() end
	if self:checkAddOn("Perl_Party") then self:Perl_Party() end
	if self:checkAddOn("Perl_Party_Target") then self:Perl_Party_Target() end
	if self:checkAddOn("Perl_Player_Pet") then self:Perl_Player_Pet() end
	if self:checkAddOn("Perl_Party_Pet") then self:Perl_Party_Pet() end
	if self:checkAddOn("Perl_CombatDisplay") then self:Perl_CombatDisplay() end
	-- XPerl
	if self:checkAddOn("XPerl_Player") then self:XPerl_Player() end
	if self:checkAddOn("XPerl_Target") then self:XPerl_Target() end
	if self:checkAddOn("XPerl_TargetTarget") then self:XPerl_TargetTarget() end
	if self:checkAddOn("XPerl_Party") then self:XPerl_Party() end
	if self:checkAddOn("XPerl_PlayerPet") then self:XPerl_PlayerPet() end
	if self:checkAddOn("XPerl_PartyPet") then self:XPerl_PartyPet() end
	if self:checkAddOn("XPerl_RaidHelper") then self:XPerl_RaidHelper() end
	if self:checkAddOn("XPerl_RaidMonitor") then self:XPerl_RaidMonitor() end
	if self:checkAddOn("XPerl_RaidAdmin") then self:XPerl_RaidAdmin() end
	if self:checkAddOn("XPerl_RaidPets") then self:XPerl_RaidPets() end
	-- DBM
	if self:checkAddOn("DBM_RaidTools") then self:DBM_RaidTools() end
	

	-- handle Addons with odd names here
    if IsAddOnLoaded("!ImprovedErrorFrame") and type(self["ImprovedErrorFrame"]) == "function" then self:ImprovedErrorFrame() end
	if IsAddOnLoaded("Auto-Bag") and type(self["AutoBag"]) == "function" then self:AutoBag() end

	-- this addon accesses the Blizzard_InspectUI 
	if IsAddOnLoaded("Voyeur") then self:InspectFrame() end

	-- skin TabletLib frames
	if AceLibrary:HasInstance("Tablet-2.0") and self.Tablet then self:Tablet() end
	-- skin DewdropLib frames
	if AceLibrary:HasInstance("Dewdrop-2.0") and self.Dewdrop then self:Dewdrop() end
	
end

function Skinner:LoDFrames(arg1)
--	self:Debug("LoDFrames: [%s]", arg1)
	
	if arg1 == prev_arg1 then return end
	prev_arg1 = arg1
	
	-- used for LoadOnDemand Addons
	if arg1 == "Blizzard_RaidUI" then self:RaidUI() end
	if arg1 == "Blizzard_MacroUI" then self:MacroFrame() end
	if arg1 == "Blizzard_BindingUI" then self:KeyBindingFrame() end
	if arg1 == "Blizzard_InspectUI" then self:InspectFrame() end
	if arg1 == "Blizzard_TrainerUI" then self:ClassTrainer() end
	if arg1 == "Blizzard_TradeSkillUI" then self:TradeSkill() end
	if arg1 == "Blizzard_CraftUI" then self:CraftFrame() end
	if arg1 == "Blizzard_TalentUI" then self:TalentFrame() end
	if arg1 == "Blizzard_GMSurveyUI" then self:GMSurveyUI() end
	if arg1 == "Blizzard_ItemSocketingUI" then self:ItemSocketingUI() end
	
	-- ignore the addon if required to by the user
	if not self:checkAddOn(arg1, true) then return end
	
	if arg1 == "OneBank" then self:OneBank() end
 	if arg1 == "Bagnon" then self:Bagnon(true) end
	if arg1 == "Banknon" then self:Banknon() end
	if arg1 == "Bagnon_Options" then self:Bagnon_Options() end
	if arg1 == "SuperInspect_UI" then self:SuperInspect_UI() end
	if arg1 == "GFW_AutoCraft" then self:GFW_AutoCraft() end
	if arg1 == "SpecialTalentUI" then self:SpecialTalentUI() end
	if arg1 == "FilterTradeSkill" then self:FilterTradeSkill() end
	if arg1 == "cgCrafty" then self:cgCrafty() end
	if arg1 == "EnhTooltip" then self:EnhTooltip() end
	if arg1 == "FramesResized_TalentUI" then self:FramesResized_TalentUI() end
	if arg1 == "Perl_Config_Options" then self:Perl_Config_Options() end
	if arg1 == "XPerl_Options" then self:XPerl_Options() end
	if arg1 == "DBM_GUI" then self:DBM_GUI() end
	if arg1 == "WIM_Options" then self:WIM_Options() end
	if arg1 == "CharacterInfo" then self:CharacterInfo() end
	
end

function Skinner:ADDON_LOADED(arg1)
--	self:Debug("ADDON_LOADED: [%s]", arg1)
 
	self:ScheduleEvent(self.LoDFrames, self.db.profile.Delay.LoDs, self, arg1)
  
end

function Skinner:AUCTION_HOUSE_SHOW()
--	self:Debug("AUCTION_HOUSE_SHOW")
	
	if self.initialized.AuctionFrame then return end
 	
	self:AuctionFrame()
	-- trigger these when AH loads otherwise errors occur
	if self:checkAddOn("Auctioneer") then self:Auctioneer() end
	if self:checkAddOn("BtmScan") then self:BtmScan() end
	if self:checkAddOn("BeanCounter") then self:BeanCounter() end
	if self:checkAddOn("Fence") then self:Fence() end
	
end

function Skinner:ViewPort()
	if not self.db.profile.ViewPort.shown or self.initialized.ViewPort then return end
	self.initialized.ViewPort = true

	WorldFrame:SetPoint("TOPLEFT", 0, -(self.db.profile.ViewPort.top * self.db.profile.ViewPort.scaling))
	WorldFrame:SetPoint("BOTTOMRIGHT", -0, (self.db.profile.ViewPort.bottom * self.db.profile.ViewPort.scaling))
	
	if self.db.profile.ViewPort.overlay then
		ViewportOverlay = WorldFrame:CreateTexture(nil, "BACKGROUND")
		ViewportOverlay:SetTexture(self.db.profile.ViewPort.r or 0, self.db.profile.ViewPort.g or 0, self.db.profile.ViewPort.b or 0, ba or self.db.profile.ViewPort.a or 1)
		ViewportOverlay:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -1, 1)
		ViewportOverlay:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 1, -1)
	end

end

function Skinner:ViewPort_top()
	if not self.db.profile.ViewPort.shown then return end

	WorldFrame:SetPoint("TOPLEFT", 0, -(self.db.profile.ViewPort.top * self.db.profile.ViewPort.scaling))
	
end

function Skinner:ViewPort_bottom()
	if not self.db.profile.ViewPort.shown then return end

	WorldFrame:SetPoint("BOTTOMRIGHT", -0, (self.db.profile.ViewPort.bottom * self.db.profile.ViewPort.scaling))
	
end

function Skinner:ViewPort_reset()

	self.initialized.ViewPort = nil
    WorldFrame:SetPoint("TOPLEFT", 0, -0)
	WorldFrame:SetPoint("BOTTOMRIGHT", -0, 0)
	
end

function Skinner:TopFrame()
	if not self.db.profile.TopFrame.shown or self.initialized.TopFrame then return end
	self.initialized.TopFrame = true

	local frame = CreateFrame("Frame", "SkinnerTF", UIParent)
	frame:SetFrameStrata("BACKGROUND")
	frame:SetFrameLevel(0)
	frame:EnableMouse(false)
	frame:SetMovable(false)
	frame:SetWidth(self.db.profile.TopFrame.width or 1920)
	frame:SetHeight(self.db.profile.TopFrame.height or 100)
	frame:ClearAllPoints()
	if self.db.profile.TopFrame.xyOff or self.db.profile.TopFrame.borderOff then 
		frame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -6, 6)
	else
		frame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -3, 3)
	end
	local fb = self.db.profile.TopFrame.borderOff and 0 or 1
	-- set the fade height
	if self.db.profile.FadeHeight.enable and self.db.profile.FadeHeight.force then
	-- set the Fade Height to the global value if 'forced'
	-- making sure that it isn't greater than the frame height
		fh = self.db.profile.FadeHeight.value <= math.ceil(frame:GetHeight()) and self.db.profile.FadeHeight.value or math.ceil(frame:GetHeight())
	elseif self.db.profile.TopFrame.fheight then
		fh = self.db.profile.TopFrame.fheight <= math.ceil(frame:GetHeight()) and self.db.profile.TopFrame.fheight or math.ceil(frame:GetHeight())
	end
	self:applySkin(frame, nil, fb, self.db.profile.TopFrame.alpha, fh)

	-- TopFrame Gradient settings
	orientation = self.db.profile.TopFrame.rotate and "HORIZONTAL" or "VERTICAL" 
	gradientOnTF = self.db.profile.TopFrame.invert and {orientation, MaxR, MaxG, MaxB, MaxA, MinR, MinG, MinB, MinA} or {orientation, MinR, MinG, MinB, MinA, MaxR, MaxG, MaxB, MaxA}  
	gradientOffTF = {orientation, 0, 0, 0, 1, 0, 0, 0, 1}

	if self.db.profile.TopFrame.invert then
		frame.tfade:ClearAllPoints()
		frame.tfade:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", -4, 4)
		frame.tfade:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", 4, (fh - 4))
	end
--	apply the Gradient
	frame.tfade:SetGradientAlpha(unpack(self.db.profile.Gradient.enable and gradientOnTF or gradientOffTF))
	-- keep a reference to the frame
	self.topframe = frame
	
end

function Skinner:MiddleFrames()

    for i = 1, 9 do
		if self.db.profile["MiddleFrame"..i].shown then self:createMiddleFrame(i) end
	end
	   
end

function Skinner:BottomFrame()
	if not self.db.profile.BottomFrame.shown or self.initialized.BottomFrame then return end
	self.initialized.BottomFrame = true

	local frame = CreateFrame("Frame", "SkinnerBF", UIParent)
	frame:SetFrameStrata("BACKGROUND")
	frame:SetFrameLevel(0)
	frame:EnableMouse(false)
	frame:SetMovable(false)
	frame:SetWidth(self.db.profile.BottomFrame.width or 1920)
	frame:SetHeight(self.db.profile.BottomFrame.height or 200)
	frame:ClearAllPoints()
	if self.db.profile.BottomFrame.xyOff  or self.db.profile.BottomFrame.borderOff then 
		frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", -6, -6)
	else
		frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", -3, -3)
	end
	local fb = self.db.profile.BottomFrame.borderOff and 0 or 1
	-- set the fade height
	if self.db.profile.FadeHeight.enable and self.db.profile.FadeHeight.force then
	-- set the Fade Height to the global value if 'forced'
	-- making sure that it isn't greater than the frame height
		fh = self.db.profile.FadeHeight.value <= math.ceil(frame:GetHeight()) and self.db.profile.FadeHeight.value or math.ceil(frame:GetHeight())
	elseif self.db.profile.BottomFrame.fheight then
		fh = self.db.profile.BottomFrame.fheight <= math.ceil(frame:GetHeight()) and self.db.profile.BottomFrame.fheight or math.ceil(frame:GetHeight())
	end
	self:applySkin(frame, nil, fb, self.db.profile.BottomFrame.alpha, fh)

	-- BottomFrame Gradient settings
	orientation = self.db.profile.BottomFrame.rotate and "HORIZONTAL" or "VERTICAL" 
	gradientOnBF = self.db.profile.BottomFrame.invert and {orientation, MaxR, MaxG, MaxB, MaxA, MinR, MinG, MinB, MinA} or {orientation, MinR, MinG, MinB, MinA, MaxR, MaxG, MaxB, MaxA}  
	gradientOffBF = {orientation, 0, 0, 0, 1, 0, 0, 0, 1}

	if self.db.profile.BottomFrame.invert then
		frame.tfade:ClearAllPoints()
		frame.tfade:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", -4, 4)
		frame.tfade:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", 4, (fh - 4))
	end
	--	apply the Gradient
	frame.tfade:SetGradientAlpha(unpack(self.db.profile.Gradient.enable and gradientOnBF or gradientOffBF))
	-- keep a reference to the frame
	self.bottomframe = frame

end
                 
function Skinner:createMiddleFrame(frameId)

	local dbkey = "MiddleFrame"..frameId
	local mfkey = self.db.profile[dbkey]
                
	self.initialized[dbkey] = true
	
	local frame = CreateFrame("Frame", "SkinnerMF"..frameId, UIParent)
	frame:SetID(frameId)
	frame:SetFrameStrata("BACKGROUND")
	frame:SetFrameLevel(0)
	frame:EnableMouse(true)
	frame:SetMovable(true)
	frame:SetResizable(true)
	frame:SetWidth(mfkey.width)
	frame:SetHeight(mfkey.height)
	frame:SetPoint("CENTER", UIParent, "CENTER", mfkey.xOfs, mfkey.yOfs)
	frame:RegisterForDrag("LeftButtonUp")
	if not OnMouseDown then
		OnMouseDown = function()
			if arg1 == "LeftButton" and IsAltKeyDown() then
				this.isMoving = true
				this:StartMoving()
				this:Raise()
			end
			if arg1 == "LeftButton" and IsControlKeyDown() then
				this.isMoving = true
				this:StartSizing("BOTTOMRIGHT")
				this:Raise()
			end
		end
	end
	frame:SetScript("OnMouseDown", OnMouseDown)

	if not OnMouseUp then
		OnMouseUp = function()
			local this = this
			if arg1 == "LeftButton" then
				if this.isMoving then
					this:StopMovingOrSizing()
					this.isMoving = nil
 					this:SetFrameStrata("BACKGROUND")
					this:SetFrameLevel(0)       
					local x, y = this:GetCenter()
					local px, py = this:GetParent():GetCenter()
					local dbkey = "MiddleFrame"..this:GetID()
 					self.db.profile[dbkey].xOfs = x - px
					self.db.profile[dbkey].yOfs = y - py
    				self.db.profile[dbkey].width = math.floor(this:GetWidth())
					self.db.profile[dbkey].height = math.floor(this:GetHeight())  														   						  
				end
			end
		end
	end
	frame:SetScript("OnMouseUp", OnMouseUp)
	if not OnHide then
		OnHide = function()
	 		if this.isMoving then
	  			this:StopMovingOrSizing()
	  			this.isMoving = nil
	 		end
		end
	end
	frame:SetScript("OnHide", OnHide)

	local fb = self.db.profile.MiddleFrame.borderOff and 0 or 1
	self:applySkin(frame, nil, fb, nil, self.db.profile.MiddleFrame.fheight)
	frame:SetBackdropColor(self.db.profile.MiddleFrame.r, self.db.profile.MiddleFrame.g, self.db.profile.MiddleFrame.b, self.db.profile.MiddleFrame.a)
	
	self["middleframe"..frameId] = frame
	
	frame:Show()
	
end
