<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Script file="FloatingChatFrame.lua"/>
	<!-- DockRegion Template -->
	<Frame name="DockRegionTemplate" virtual="true" parent="UIParent" hidden="true">
		<Size>
			<AbsDimension x="0" y="65"/>
		</Size>
		<Anchors>
			<Anchor point="LEFT" relativePoint="CENTER">
				<Offset>
					<AbsDimension x="0" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentHighlight" file="Interface\ChatFrame\UI-ChatFrame-DockHighlight" alphaMode="ADD">
					<Size>
						<AbsDimension x="32" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Color r="1.0" g="0" b="0"/>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

	<!-- Tab Template-->
	<Button name="ChatTabTemplate" hidden="true" frameStrata="LOW" parent="UIParent" virtual="true">
		<Size>
			<AbsDimension x="64" y="32"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOMLEFT">
				<Offset>
					<AbsDimension x="0" y="2"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentLeft" file="Interface\ChatFrame\ChatFrameTab">
					<Size>
						<AbsDimension x="16" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
					<TexCoords left="0.0" right="0.25" top="0.0" bottom="1.0"/>
				</Texture>
				<Texture name="$parentMiddle" file="Interface\ChatFrame\ChatFrameTab">
					<Size>
						<AbsDimension x="44" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
					</Anchors>
					<TexCoords left="0.25" right="0.75" top="0.0" bottom="1.0"/>
				</Texture>
				<Texture name="$parentRight" file="Interface\ChatFrame\ChatFrameTab">
					<Size>
						<AbsDimension x="16" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
					</Anchors>
					<TexCoords left="0.75" right="1.0" top="0.0" bottom="1.0"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="$parentFlash" hidden="true">
				<Size>
					<AbsDimension x="5" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLeft">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
					<Anchor point="RIGHT" relativeTo="$parentRight">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD" setAllPoints="true"/>
					</Layer>
				</Layers>
			</Frame>
			<Frame name="$parentDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true">
				<Anchors>
					<Anchor point="TOP">
						<Offset>
							<AbsDimension x="-80" y="-35"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						FCFOptionsDropDown_OnLoad(self);
					</OnLoad>
					<OnShow>
						FCFOptionsDropDown_OnLoad(self);
					</OnShow>
				</Scripts>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad>
				self:RegisterForClicks("LeftButtonDown", "LeftButtonUp", "RightButtonUp");
				self:RegisterForDrag("LeftButton");
				getglobal(self:GetName().."DockRegionHighlight"):SetPoint("LEFT", self:GetName().."Right", "RIGHT", -16 , -3);
			</OnLoad>
			<OnClick>
				FCF_Tab_OnClick(self, button);
				PlaySound("UChatScrollButton");
			</OnClick>
			<OnEnter>
				GameTooltip_AddNewbieTip(self, CHAT_OPTIONS_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_CHATOPTIONS, 1);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
			<OnDragStart>
				-- mschweitzer NOTE: part of a fix for bug 93334. if a tab is fading out, its frame shouldn't be draggable
				-- because we can potentially get into a state where the tab disappears while we drag
				if UIFrameIsFading(self) then
					return;
				end

				local chatFrame = getglobal("ChatFrame"..self:GetID());
				if chatFrame == DEFAULT_CHAT_FRAME then
					if chatFrame.isLocked then
						return;
					end
					chatFrame:StartMoving();
					MOVING_CHATFRAME = chatFrame;
					return;
				elseif chatFrame.isDocked then
					FCF_UnDockFrame(chatFrame);
					FCF_SetLocked(chatFrame, nil);
					local chatTab = getglobal(chatFrame:GetName().."Tab");
					local x,y = chatTab:GetCenter();
					x = x - (chatTab:GetWidth()/2);
					y = y - (chatTab:GetHeight()/2);
					chatTab:ClearAllPoints();
					chatFrame:ClearAllPoints();
					chatFrame:SetPoint("TOPLEFT", "UIParent", "BOTTOMLEFT", x, y);
					FCF_SetTabPosition(chatFrame, 0);
					chatFrame:StartMoving();
					MOVING_CHATFRAME = chatFrame;
					Blizzard_CombatLog_Update_QuickButtons();
				end
				SELECTED_CHAT_FRAME = chatFrame;
			</OnDragStart>
			<OnDragStop>
				local chatFrame = getglobal("ChatFrame"..self:GetID());
				FCF_StopDragging(chatFrame);
			</OnDragStop>
		</Scripts>
		<ButtonText name="$parentText">
			<Size>
				<AbsDimension x="50" y="8"/>
			</Size>
			<Anchors>
				<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
					<Offset>
						<AbsDimension x="0" y="-5"/>
					</Offset>
				</Anchor>
			</Anchors>
		</ButtonText>
		<NormalFont style="GameFontNormalSmall"/>
		<HighlightTexture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD">
			<Anchors>
				<Anchor point="LEFT" relativeTo="$parentLeft">
					<Offset>
						<AbsDimension x="0" y="-7"/>
					</Offset>
				</Anchor>
				<Anchor point="RIGHT" relativeTo="$parentRight">
					<Offset>
						<AbsDimension x="0" y="-7"/>
					</Offset>
				</Anchor>
			</Anchors>
		</HighlightTexture>
	</Button>

	<!-- ===============================================================================-->
	<!-- Floating frame template-->
	<ScrollingMessageFrame name="FloatingChatFrameTemplate" movable="true" enableMouse="false" resizable="true" inherits="ChatFrameTemplate" parent="UIParent" hidden="true" virtual="true">
		<Size>
			<AbsDimension x="430" y="128"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOMLEFT">
				<Offset>
					<AbsDimension x="100" y="100"/>
				</Offset>
			</Anchor>
		</Anchors>
		<TitleRegion setAllPoints="true"/>
		<ResizeBounds>
			<minResize>
				<AbsDimension x="296" y="75"/>
			</minResize>
			<maxResize>
				<AbsDimension x="608" y="400"/>
			</maxResize>
		</ResizeBounds>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentBackground" file="Interface\ChatFrame\ChatFrameBackground">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-2" y="3"/>
							</Offset>
						</Anchor>
						<Anchor point="TOPRIGHT">
							<Offset>
								<AbsDimension x="2" y="3"/>
							</Offset>
						</Anchor>
						<Anchor point="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="-2" y="-6"/>
							</Offset>
						</Anchor>
						<Anchor point="BOTTOMRIGHT">
							<Offset>
								<AbsDimension x="3" y="-6"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button name="$parentResizeTopLeft">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentBackground">
						<Offset>
							<AbsDimension x="-2" y="2"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
							<TexCoords left="0" right="0.25" top="0" bottom="0.125"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "TOPLEFT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeTopRight">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="TOPRIGHT" relativeTo="$parentBackground">
						<Offset>
							<AbsDimension x="2" y="2"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
							<TexCoords left="0.75" right="1.0" top="0" bottom="0.125"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "TOPRIGHT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeBottomLeft">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeTo="$parentBackground">
						<Offset>
							<AbsDimension x="-2" y="-3"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
							<TexCoords left="0" right="0.25" top="0.7265625" bottom="0.8515625"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "BOTTOMLEFT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeBottomRight">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentBackground">
						<Offset>
							<AbsDimension x="2" y="-3"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
							<TexCoords left="0.75" right="1.0" top="0.7265625" bottom="0.8515625"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "BOTTOMRIGHT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeTop">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentResizeTopLeft" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
					<Anchor point="RIGHT" relativeTo="$parentResizeTopRight" relativePoint="LEFT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="LEFT"/>
								<Anchor point="RIGHT"/>
							</Anchors>
							<TexCoords left="0.25" right="0.75" top="0" bottom="0.125"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "TOP");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeBottom">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentResizeBottomLeft" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
					<Anchor point="RIGHT" relativeTo="$parentResizeBottomRight" relativePoint="LEFT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="LEFT"/>
								<Anchor point="RIGHT"/>
							</Anchors>
							<TexCoords left="0.25" right="0.75" top="0.7265625" bottom="0.8515625"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "BOTTOM");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeLeft">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentResizeTopLeft" relativePoint="BOTTOM">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
					<Anchor point="BOTTOM" relativeTo="$parentResizeBottomLeft" relativePoint="TOP">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOP"/>
								<Anchor point="BOTTOM"/>
							</Anchors>
							<TexCoords left="0" right="0.25" top="0.125" bottom="0.7265625"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "LEFT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentResizeRight">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentResizeTopRight" relativePoint="BOTTOM">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
					<Anchor point="BOTTOM" relativeTo="$parentResizeBottomRight" relativePoint="TOP">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentTexture" file="Interface\ChatFrame\ChatFrameBorder">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOP"/>
								<Anchor point="BOTTOM"/>
							</Anchors>
							<TexCoords left="0.75" right="1.0" top="0.125" bottom="0.7265625"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel()-1);
					</OnLoad>
					<OnMouseDown>
						FCF_Resize(self, "RIGHT");
					</OnMouseDown>
					<OnMouseUp>
						FCF_StopResize(self);
					</OnMouseUp>
				</Scripts>
			</Button>
			<Button name="$parentBottomButton">
				<Size>
					<AbsDimension x="32" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="-32" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="OVERLAY">
						<Texture name="$parentFlash" file="Interface\ChatFrame\UI-ChatIcon-BlinkHilight" hidden="true"/>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						PlaySound("igChatBottom");
						self:GetParent():ScrollToBottom();
					</OnClick>
				</Scripts>
				<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollEnd-Up"/>
				<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollEnd-Down"/>
				<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollEnd-Disabled"/>
				<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
			</Button>
			<Button name="$parentDownButton">
				<Size>
					<AbsDimension x="32" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOM" relativeTo="$parentBottomButton" relativePoint="TOP">
						<Offset>
							<AbsDimension x="0" y="-2"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						MessageFrameScrollButton_OnLoad(self);
					</OnLoad>
					<OnUpdate>
						MessageFrameScrollButton_OnUpdate(self, elapsed);
					</OnUpdate>
					<OnClick>
						if self:GetButtonState() == "PUSHED" then
							self.clickDelay = MESSAGE_SCROLLBUTTON_INITIAL_DELAY;
						else
							self:GetParent():ScrollDown();
						end
						PlaySound("igChatScrollDown");
					</OnClick>
				</Scripts>
				<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/>
				<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down"/>
				<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled"/>
				<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
			</Button>
			<Button name="$parentUpButton">
				<Size>
					<AbsDimension x="32" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOM" relativeTo="$parentDownButton" relativePoint="TOP"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						MessageFrameScrollButton_OnLoad(self);
					</OnLoad>
					<OnUpdate>
						MessageFrameScrollButton_OnUpdate(self, elapsed);
					</OnUpdate>
					<OnClick>
						if self:GetButtonState() == "PUSHED" then
							self.clickDelay = MESSAGE_SCROLLBUTTON_INITIAL_DELAY;
						else
							self:GetParent():ScrollUp();
						end
						PlaySound("igChatScrollUp");
					</OnClick>
				</Scripts>
				<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up"/>
				<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Down"/>
				<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Disabled"/>
				<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				ChatFrame_OnLoad(self);
				FloatingChatFrame_OnLoad(self);
			</OnLoad>
			<OnUpdate>
				-- mschweitzer NOTE: per bug 93334, if the tab is not visible then the chat frame should not be allowed to drag
				if self == MOVING_CHATFRAME then
					local chatTab = getglobal("ChatFrame"..self:GetID().."Tab");
					if not chatTab:IsShown() then
						FCF_StopDragging(self);
					end
				end
				ChatFrame_OnUpdate(self, elapsed);
			</OnUpdate>
			<OnShow>
				getglobal(self:GetName().."BottomButton"):Show();
				getglobal(self:GetName().."DownButton"):Show();
				getglobal(self:GetName().."UpButton"):Show();
				SetChatWindowShown(self:GetID(), 1);
			</OnShow>
			<OnHide>
				if not self:IsShown() then
					getglobal(self:GetName().."BottomButton"):Hide();
					getglobal(self:GetName().."DownButton"):Hide();
					getglobal(self:GetName().."UpButton"):Hide();
					SetChatWindowShown(self:GetID(), nil);
				end
			</OnHide>
			<OnEvent>
				ChatFrame_OnEvent(self, event, ...);
				FloatingChatFrame_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
	</ScrollingMessageFrame>

	<!-- Main chat window -->
	<ScrollingMessageFrame name="ChatFrame1" hidden="false" inherits="FloatingChatFrameTemplate" id="1">
		<Size>
			<AbsDimension x="430" y="120"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOMLEFT">
				<Offset>
					<AbsDimension x="32" y="95"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				ChatFrame_OnLoad(self);
				SELECTED_DOCK_FRAME = ChatFrame1;
				self:RegisterEvent("UPDATE_CHAT_WINDOWS");
				self:RegisterEvent("UPDATE_FLOATING_CHAT_WINDOWS");
			</OnLoad>
			<OnEvent>
				ChatFrame_OnEvent(self, event, ...);
				FloatingChatFrame_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
	</ScrollingMessageFrame>
	<Frame name="ChatFrame1TabDockRegion" inherits="DockRegionTemplate"/>
	<Button name="ChatFrame1Tab" inherits="ChatTabTemplate" id="1">
		<Anchors>
			<Anchor point="BOTTOMLEFT" relativeTo="ChatFrame1Background" relativePoint="TOPLEFT">
				<Offset>
					<AbsDimension x="2" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>
	<EditBox name="ChatFrameEditBox" inherits="ChatFrameEditBoxTemplate" parent="UIParent">
		<Size>
			<AbsDimension x="5" y="32"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="ChatFrame1" relativePoint="BOTTOMLEFT">
				<Offset>
					<AbsDimension x="-5" y="-2"/>
				</Offset>
			</Anchor>
			<Anchor point="TOPRIGHT" relativeTo="ChatFrame1" relativePoint="BOTTOMRIGHT">
				<Offset>
					<AbsDimension x="5" y="-2"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				DEFAULT_CHAT_FRAME = ChatFrame1;
				SELECTED_CHAT_FRAME = ChatFrame1;
				self.chatFrame = DEFAULT_CHAT_FRAME;
				DEFAULT_CHAT_FRAME.editBox = self;
				ChatEdit_OnLoad(self);
			</OnLoad>
		</Scripts>
	</EditBox>
	<!-- ChatFrame1 Specific buttons -->
	<Button name="ChatFrameMenuButton" frameStrata="LOW" parent="UIParent">
		<Size>
			<AbsDimension x="32" y="32"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOM" relativeTo="ChatFrame1UpButton" relativePoint="TOP"/>
		</Anchors>
		<Scripts>
			<OnClick>
				PlaySound("igChatEmoteButton");
				ChatFrame_OpenMenu();
			</OnClick>
			<OnEnter>
				GameTooltip_AddNewbieTip(self, CHAT_LABEL, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_CHATMENU, 1);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
		<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-Chat-Up"/>
		<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-Chat-Down"/>
		<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-Chat-Disabled"/>
		<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
	</Button>
	<Frame name="ChatMenu" inherits="UIMenuTemplate" hidden="true" parent="UIParent">
		<Anchors>
			<Anchor point="BOTTOMLEFT" relativeTo="ChatFrameMenuButton" relativePoint="TOPRIGHT"/>
		</Anchors>
		<Scripts>
			<OnLoad>
				self.chatFrame = DEFAULT_CHAT_FRAME;
				ChatMenu_OnLoad(self);
			</OnLoad>
			<OnShow>
				ChatMenu_OnShow(self);
				self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
				self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
			</OnShow>
		</Scripts>
	</Frame>
	<Frame name="EmoteMenu" inherits="UIMenuTemplate" hidden="true" parent="ChatMenu">
		<Scripts>
			<OnLoad>
				EmoteMenu_OnLoad(self);
			</OnLoad>
		</Scripts>
	</Frame>
	<Frame name="LanguageMenu" inherits="UIMenuTemplate" hidden="true" parent="ChatMenu">
		<Scripts>
			<OnLoad>
				LanguageMenu_OnLoad(self);
			</OnLoad>
			<OnEvent>
				LanguageMenu_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
	</Frame>
	<Frame name="VoiceMacroMenu" inherits="UIMenuTemplate" hidden="true" parent="ChatMenu">
		<Scripts>
			<OnLoad>
				VoiceMacroMenu_OnLoad(self);
			</OnLoad>
		</Scripts>
	</Frame>
	<Frame name="ChatFrame2TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame3TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame4TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame5TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame6TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame7TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame8TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame9TabDockRegion" inherits="DockRegionTemplate"/>
	<Frame name="ChatFrame10TabDockRegion" inherits="DockRegionTemplate"/>
	<Button name="ChatFrame2Tab" inherits="ChatTabTemplate" id="2"/>
	<ScrollingMessageFrame name="ChatFrame2" inherits="FloatingChatFrameTemplate" id="2"/>
	<Button name="ChatFrame3Tab" inherits="ChatTabTemplate" id="3"/>
	<ScrollingMessageFrame name="ChatFrame3" inherits="FloatingChatFrameTemplate" id="3"/>
	<Button name="ChatFrame4Tab" inherits="ChatTabTemplate" id="4"/>
	<ScrollingMessageFrame name="ChatFrame4" inherits="FloatingChatFrameTemplate" id="4"/>
	<Button name="ChatFrame5Tab" inherits="ChatTabTemplate" id="5"/>
	<ScrollingMessageFrame name="ChatFrame5" inherits="FloatingChatFrameTemplate" id="5"/>
	<Button name="ChatFrame6Tab" inherits="ChatTabTemplate" id="6"/>
	<ScrollingMessageFrame name="ChatFrame6" inherits="FloatingChatFrameTemplate" id="6"/>
	<Button name="ChatFrame7Tab" inherits="ChatTabTemplate" id="7"/>
	<ScrollingMessageFrame name="ChatFrame7" inherits="FloatingChatFrameTemplate" id="7"/>
	<!-- Hack to get around load order issue -->
	<Script>
		FCF_DockFrame(ChatFrame1, 1);
	</Script>
</Ui>

