<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
	<Script file="TradeFrame.lua"/>
	<Frame name="TradeHighlightTemplate" hidden="false" virtual="true">
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentTop" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
					<Size>
						<AbsDimension x="161" y="16"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
					<TexCoords left="0" right="0.62890625" top="0" bottom="0.0625"/>
				</Texture>
				<Texture name="$parentBottom" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
					<Size>
						<AbsDimension x="161" y="16"/>
					</Size>
					<Anchors>
						<Anchor point="BOTTOMLEFT"/>
					</Anchors>
					<TexCoords left="0" right="0.62890625" top="0.9375" bottom="1.0"/>
				</Texture>
				<Texture name="$parentMiddle" file="Interface\TradeFrame\UI-TradeFrame-Highlight">
					<Size>
						<AbsDimension x="161" y="10"/>
					</Size>
					<Anchors>
						<Anchor point="TOP" relativeTo="$parentTop" relativePoint="BOTTOM"/>
						<Anchor point="BOTTOM" relativeTo="$parentBottom" relativePoint="TOP"/>
					</Anchors>
					<TexCoords left="0" right="0.62890625" top="0.0625" bottom="0.9375"/>
				</Texture>
			</Layer>
		</Layers>
	</Frame>
	<Frame name="TradeItemTemplate" virtual="true">
		<Size>
			<AbsDimension x="153" y="37"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentSlotTexture" file="Interface\Buttons\UI-EmptySlot">
					<Size>
						<AbsDimension x="64" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-13" y="13"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<Texture name="$parentNameFrame" file="Interface\QuestFrame\UI-QuestItemNameFrame">
					<Size>
						<AbsDimension x="124" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentSlotTexture" relativePoint="RIGHT">
							<Offset>
								<AbsDimension x="-20" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString name="$parentName" inherits="GameFontNormalSmall" text="Item Name" justifyH="LEFT">
					<Size>
						<AbsDimension x="90" y="30"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentNameFrame">
							<Offset>
								<AbsDimension x="15" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</Frame>
	<Frame name="RecipientTradeItemTemplate" inherits="TradeItemTemplate" virtual="true">
		<Frames>
			<Button name="$parentItemButton" inherits="ItemButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel() + 2);
					</OnLoad>
					<OnClick>
						if ( IsModifiedClick() ) then
							HandleModifiedItemClick(GetTradeTargetItemLink(self:GetParent():GetID()));
						else
							ClickTargetTradeButton(self:GetParent():GetID());
						end
					</OnClick>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetTradeTargetItem(self:GetParent():GetID());
						CursorUpdate(self);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
						ResetCursor();
					</OnLeave>
					<OnUpdate>
						if ( GameTooltip:IsOwned(self) ) then
							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
							GameTooltip:SetTradeTargetItem(self:GetParent():GetID());
						end
						CursorOnUpdate(self);
					</OnUpdate>
				</Scripts>
			</Button>
		</Frames>
	</Frame>
	<Frame name="PlayerTradeItemTemplate" inherits="TradeItemTemplate" virtual="true">
		<Frames>
			<Button name="$parentItemButton" inherits="ItemButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent"/>
				</Anchors>
				<Scripts>
					<OnClick>
						if ( IsModifiedClick() ) then
							HandleModifiedItemClick(GetTradePlayerItemLink(self:GetParent():GetID()));
						else
							ClickTradeButton(self:GetParent():GetID(), button == "RightButton");
						end
					</OnClick>
					<OnDragStart>
						ClickTradeButton(self:GetParent():GetID());
					</OnDragStart>
					<OnReceiveDrag>
						ClickTradeButton(self:GetParent():GetID());
					</OnReceiveDrag>
					<OnLoad>
						self:RegisterForDrag("LeftButton");
						self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
						self:SetFrameLevel(self:GetFrameLevel() + 2);
					</OnLoad>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetTradePlayerItem(self:GetParent():GetID());
						CursorUpdate(self);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
						ResetCursor();
					</OnLeave>
					<OnUpdate>
						if ( GameTooltip:IsOwned(self) ) then
							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
							GameTooltip:SetTradePlayerItem(self:GetParent():GetID());
						end
						CursorOnUpdate(self);
					</OnUpdate>
				</Scripts>
			</Button>
		</Frames>
	</Frame>
	<Frame name="TradeFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hidden="true">
		<Size>
			<AbsDimension x="384" y="512"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-104"/>
				</Offset>
			</Anchor>
		</Anchors>
		<HitRectInsets>
			<AbsInset left="0" right="35" top="0" bottom="72"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="TradeFrameRecipientPortrait">
					<Size>
						<AbsDimension x="60" y="60"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="183" y="-6"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<Texture name="TradeFramePlayerPortrait">
					<Size>
						<AbsDimension x="60" y="60"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="7" y="-6"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture file="Interface\TradeFrame\UI-TradeFrame-TopLeft">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture file="Interface\TradeFrame\UI-TradeFrame-TopRight">
					<Size>
						<AbsDimension x="128" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPRIGHT"/>
					</Anchors>
				</Texture>
				<Texture file="Interface\TradeFrame\UI-TradeFrame-BotLeft">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="BOTTOMLEFT"/>
					</Anchors>
				</Texture>
				<Texture file="Interface\TradeFrame\UI-TradeFrame-BotRight">
					<Size>
						<AbsDimension x="128" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="BOTTOMRIGHT"/>
					</Anchors>
				</Texture>
				<FontString name="TradeFrameRecipientNameText" inherits="GameFontNormal" text="Player Name">
					<Size>
						<AbsDimension x="80" y="12"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="TradeFrame">
							<Offset>
								<AbsDimension x="245" y="-17"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="TradeFramePlayerNameText" inherits="GameFontNormal" text="Recipient Name">
					<Size>
						<AbsDimension x="100" y="12"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="TradeFrame">
							<Offset>
								<AbsDimension x="75" y="-17"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="TradeFramePlayerEnchantText" inherits="GameFontHighlightSmall" text="TRADEFRAME_ENCHANT_SLOT_LABEL">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="TradeFrame">
							<Offset>
								<AbsDimension x="26" y="-374"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="TradeFrameRecipientEnchantText" inherits="GameFontHighlightSmall" text="TRADEFRAME_ENCHANT_SLOT_LABEL">
					<Anchors>
						<Anchor point="LEFT" relativeTo="TradeFramePlayerEnchantText">
							<Offset>
								<AbsDimension x="170" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="TradeHighlightPlayer" inherits="TradeHighlightTemplate">
				<Size>
					<AbsDimension x="161" y="266"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeFrame">
						<Offset>
							<AbsDimension x="19" y="-100"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeHighlightRecipient" inherits="TradeHighlightTemplate">
				<Size>
					<AbsDimension x="161" y="266"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="189" y="-100"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeHighlightPlayerEnchant" inherits="TradeHighlightTemplate">
				<Size>
					<AbsDimension x="161" y="61"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeHighlightPlayer" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeHighlightRecipientEnchant" inherits="TradeHighlightTemplate">
				<Size>
					<AbsDimension x="161" y="61"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeHighlightRecipient" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem1" inherits="RecipientTradeItemTemplate" id="1">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="195" y="-104"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem2" inherits="RecipientTradeItemTemplate" id="2">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem1" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem3" inherits="RecipientTradeItemTemplate" id="3">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem2" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem4" inherits="RecipientTradeItemTemplate" id="4">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem3" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem5" inherits="RecipientTradeItemTemplate" id="5">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem4" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem6" inherits="RecipientTradeItemTemplate" id="6">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem5" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradeRecipientItem7" inherits="RecipientTradeItemTemplate" id="7">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeRecipientItem6" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-28"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture file="Interface\TradeFrame\UI-TradeFrame-EnchantIcon">
							<Size>
								<AbsDimension x="62" y="62"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
			</Frame>
			<Frame name="TradePlayerItem1" inherits="PlayerTradeItemTemplate" id="1">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="26" y="-104"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem2" inherits="PlayerTradeItemTemplate" id="2">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem1" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem3" inherits="PlayerTradeItemTemplate" id="3">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem2" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem4" inherits="PlayerTradeItemTemplate" id="4">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem3" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem5" inherits="PlayerTradeItemTemplate" id="5">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem4" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem6" inherits="PlayerTradeItemTemplate" id="6">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem5" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
			<Frame name="TradePlayerItem7" inherits="PlayerTradeItemTemplate" id="7">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradePlayerItem6" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-28"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture file="Interface\TradeFrame\UI-TradeFrame-EnchantIcon">
							<Size>
								<AbsDimension x="62" y="62"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnEnter>
						if ( self.hasItem ) then
							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
							GameTooltip:SetTradePlayerItem(self:GetParent():GetID());
						else
							GameTooltip_AddNewbieTip(self, ENCHANT_SLOT, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_ENCHANTSLOT, 1);
						end
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
			<Button name="TradeFrameTradeButton" inherits="UIPanelButtonTemplate" text="TRADE">
				<Size>
					<AbsDimension x="85" y="22"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativeTo="TradeFrame" relativePoint="BOTTOMRIGHT">
						<Offset>
							<AbsDimension x="-113" y="55"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						AcceptTrade();
					</OnClick>
				</Scripts>
				<ButtonText text="TRADE"/>
				<NormalFont style="GameFontNormal"/>
				<HighlightFont style="GameFontHighlight"/>
				<DisabledFont style="GameFontDisable"/>
			</Button>
			<Button name="TradeFrameCancelButton" inherits="UIPanelButtonTemplate" text="CANCEL">
				<Size>
					<AbsDimension x="77" y="22"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="TradeFrameTradeButton" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="3" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						TradeFrameCancelButton_OnClick();
					</OnClick>
				</Scripts>
				<ButtonText text="CANCEL"/>
				<NormalFont style="GameFontNormal"/>
				<HighlightFont style="GameFontHighlight"/>
				<DisabledFont style="GameFontDisable"/>
			</Button>
			<Button name="TradeFrameCloseButton" inherits="UIPanelCloseButton">
				<Anchors>
					<Anchor point="TOPRIGHT" relativeTo="TradeFrame" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-25" y="-8"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Frame name="TradePlayerInputMoneyFrame" inherits="MoneyInputFrameTemplate">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="26" y="-73"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						MoneyInputFrame_SetMode(self, "compact");
						MoneyInputFrame_SetOnValueChangedFunc(self, TradeFrame_UpdateMoney);
						self:RegisterEvent("PLAYER_TRADE_MONEY");
					</OnLoad>
					<OnEvent>
						if ( event == "PLAYER_TRADE_MONEY" ) then
							MoneyInputFrame_SetCopper(self, GetPlayerTradeMoney());
						end
					</OnEvent>
				</Scripts>
			</Frame>
			<Frame name="TradeRecipientMoneyFrame" inherits="SmallMoneyFrameTemplate">
				<Anchors>
					<Anchor point="TOPRIGHT">
						<Offset>
							<AbsDimension x="-40" y="-80"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						SmallMoneyFrame_OnLoad(self);
						MoneyFrame_SetType(self, "TARGET_TRADE");
					</OnLoad>
				</Scripts>
			</Frame>
		</Frames>
		<Scripts>
			<OnEvent>
				TradeFrame_OnEvent(self, event, ...);
			</OnEvent>
			<OnShow>
				TradeFrame_OnShow(self);
				PlaySound("igCharacterInfoOpen");
			</OnShow>
			<OnHide>
				TradeFrame_OnHide();
				PlaySound("igCharacterInfoClose");
			</OnHide>
			<OnLoad>
				TradeFrame_OnLoad(self);
			</OnLoad>
			<OnMouseUp>
				TradeFrame_OnMouseUp();
			</OnMouseUp>
		</Scripts>
	</Frame>
</Ui>
