<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="XPerl_TargetTarget.lua"/>

        <Frame>
		<Scripts>
			<OnUpdate>
                                XPerl_TargetTarget_OnUpdate(arg1, XPerl_TargetTarget)

                                if (XPerl_TargetTargetTarget) then
                                        XPerl_TargetTarget_OnUpdate(arg1, XPerl_TargetTargetTarget)
                                end
			</OnUpdate>
		</Scripts>
        </Frame>

        <!-- Frame to display TargetTarget's health -->

        <Frame name="XPerl_TargetTarget_Template" clampedToScreen="true" frameStrata="LOW" virtual="true" movable="true" parent="UIParent" hidden="true" enableMouse="true">
		<Size>
			<!-- The size of this frame determines what can be clicked for the menu and moving, hence it is the same size as the name frame. -->
			<AbsDimension x="160" y="60"/>
		</Size>

		<!-- Script Events -->

		<Scripts>
			<OnLoad>
                                XPerl_TargetTarget_OnLoad()
			</OnLoad>
			<OnEvent>
                                XPerl_TargetTarget_OnEvent()
			</OnEvent>
		</Scripts>

		<Frames>
			<!-- TargetTarget Name -->

                        <Frame name="$parent_NameFrame">
				<Size>
                                        <AbsDimension x="136" y="24"/>
				</Size>
				<Anchors>
                                        <Anchor point="TOPLEFT"/>
				</Anchors>
                                <Backdrop bgFile="Interface\Addons\XPerl\Images\XPerl_FrameBack" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
                                                <AbsValue val="32"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="5" right="5" top="5" bottom="5"/>
					</BackgroundInsets>
				</Backdrop>
				<Layers>
					<Layer level="OVERLAY">
						<!-- PVP Icon -->
                                                <Texture name="$parent_PVPStatus" file="Interface\TargetingFrame\UI-PVP-FFA" hidden="true">
							<Size>
								<AbsDimension x="40" y="40"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
									<Offset>
										<AbsDimension x="-5" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

                                                <!-- Raid Target Icon -->
                                                <Texture name="$parent_RaidIcon" file="Interface\TargetingFrame\UI-RaidTargetingIcons" hidden="true">
							<Size>
                                                                <AbsDimension x="32" y="32"/>
							</Size>
							<Anchors>
                                                                <Anchor point="CENTER"/>
							</Anchors>
						</Texture>

                                                <!-- Combat Icon -->
                                                <Texture name="$parent_ActivityStatus" file="Interface\CharacterFrame\UI-StateIcon" hidden="true">
							<Size>
								<AbsDimension x="32" y="31"/>
							</Size>
							<Anchors>
                                                                <Anchor point="RIGHT"/>
							</Anchors>
                                                        <TexCoords left="0.5" right = "1.0" top="0.0" bottom="0.5"/>
						</Texture>

                                                <!-- Warning Icon -->
                                                <Texture name="$parent_Warning" file="Interface\Minimap\Ping\ping6" alphaMode="ADD" hidden="true">
							<Size>
								<AbsDimension x="32" y="31"/>
							</Size>
							<Anchors>
                                                                <Anchor point="TOP" relativePoint="TOP">
									<Offset>
                                                                                <AbsDimension x="0" y="2"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

                                                <FontString name="$parent_NameBarText" inherits="GameFontNormal" text="Error!">
                                                        <Anchors>
                                                                <Anchor point="TOPLEFT"/>
                                                                <Anchor point="BOTTOMRIGHT">
                                                                        <Offset>
                                                                                <AbsDimension x="0" y="1"/>
                                                                        </Offset>
                                                                </Anchor>
                                                        </Anchors>
                                                </FontString>
                                                <Texture name="$parent_PVPRankIcon">
							<Size><AbsDimension x="32" y="32"/></Size>
							<Anchors>
                                                                <Anchor point="TOP">
									<Offset><AbsDimension x="-40" y="3"/></Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
			</Frame>

			<!--Level Frame-->

                        <Frame name="$parent_LevelFrame">
				<Size>
                                        <AbsDimension x="27" y="24"/>
				</Size>
				<Anchors>
                                        <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parent_NameFrame">
						<Offset>
                                                        <AbsDimension x="-3" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
                                <Backdrop bgFile="Interface\Addons\XPerl\Images\XPerl_FrameBack" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
                                                <AbsValue val="32"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="5" right="5" top="5" bottom="5"/>
					</BackgroundInsets>
				</Backdrop>
				<Layers>
					<Layer level="OVERLAY">
                                                <FontString name="$parentText" inherits="GameFontNormalSmall" text="Error!">
                                                        <FontHeight>
                                                                <AbsValue val="16"/>
                                                        </FontHeight>
							<Anchors>
                                                                <Anchor point="CENTER">
									<Offset>
                                                                                <AbsDimension x="0" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
                                                </FontString>
					</Layer>
				</Layers>
			</Frame>

                        <!-- TargetTarget Stats -->
                        <Frame name="$parent_StatsFrame" inherits="XPerl_Stats_Template">
				<Anchors>
                                        <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent_NameFrame">
						<Offset>
							<AbsDimension x="0" y="2"/>
						</Offset>
					</Anchor>
				</Anchors>
                        </Frame>

                        <Button name="$parent_CastClickOverlay" topLevel="true">    --frameStrata="MEDIUM">
                                <HighlightTexture file="Interface\Addons\XPerl\Images\XPerl_Highlight" alphaMode="ADD">
                                        <TexCoords left="0" right="1" top="0.5" bottom="1"/>
                                </HighlightTexture>
                                <Anchors>
                                        <Anchor point="BOTTOMLEFT" relativeTo="$parent_StatsFrame"/>
                                        <Anchor point="TOPRIGHT" relativeTo="$parent_LevelFrame"/>
                                </Anchors>
                                <Scripts>
                                        <OnLoad>
                                                this:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')
                                                this:RegisterForDrag("LeftButton")
                                        </OnLoad>
                                        <OnClick>
                                                XPerl_OnClick_Handler(arg1, this:GetParent().unitid)
                                        </OnClick>
                                        <OnDragStart>
                                                if (XPerlLocked == 0) then
                                                        this:GetParent():StartMoving()
                                                end
                                        </OnDragStart>
                                        <OnDragStop>
                                                this:GetParent():StopMovingOrSizing()
                                                if (this:GetParent() == XPerl_TargetTargetTarget) then
                                                        XPerl_SavePosition(XPerl_TargetTargetTarget)
                                                end
                                        </OnDragStop>
                                        <OnEnter>
                                                XPerl_TargetTarget_ResetFade()
                                                XPerl_PlayerTip(this:GetParent().unitid)
                                        </OnEnter>
                                        <OnLeave>
                                                XPerl_PlayerTipHide()
                                        </OnLeave>
                                </Scripts>
                        </Button>

			<!-- Buffs Frame -->
                        <Frame name="$parent_BuffFrame">
				<Size>
					<AbsDimension x="100" y="50"/>
				</Size>
				<Anchors>
                                        <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent_StatsFrame">
						<Offset>
                                                        <AbsDimension x="2" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>
		</Frames>
	</Frame>

        <Frame name="XPerl_TargetTarget" inherits="XPerl_TargetTarget_Template" movable="true" parent="UIParent" hidden="true" enableMouse="true">
		<Anchors>
                        <Anchor point="TOPLEFT">
				<Offset>
                                        <AbsDimension x="590" y="-12"/>
				</Offset>
			</Anchor>
		</Anchors>
        </Frame>

        <!-- Target History Template, frames created on demand -->
        <Frame name="XPerl_History_Template" virtual="true" enableMouse="true">
                <Size>
                        <AbsDimension x="160" y="24"/>
                </Size>
                <Backdrop bgFile="Interface\Addons\XPerl\Images\XPerl_FrameBack" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
                        <EdgeSize>
                                <AbsValue val="16"/>
                        </EdgeSize>
                        <TileSize>
                                <AbsValue val="32"/>
                        </TileSize>
                        <BackgroundInsets>
                                <AbsInset left="5" right="5" top="5" bottom="5"/>
                        </BackgroundInsets>
                </Backdrop>
		<Scripts>
                        <OnMouseUp>
                                XPerl_TargetTarget_History_OnMouseUp()
                        </OnMouseUp>
                        <OnEnter>
                                XPerl_TargetTarget_History_OnEnter()
                        </OnEnter>
                </Scripts>
                <Layers>
                        <Layer level="OVERLAY">
                                <FontString name="$parent_NameBarText" inherits="GameFontNormal" text="">
                                        <Anchors>
                                                <Anchor point="TOPLEFT"/>
                                                <Anchor point="BOTTOMRIGHT">
                                                        <Offset>
                                                                <AbsDimension x="0" y="1"/>
                                                        </Offset>
                                                </Anchor>
                                        </Anchors>
                                </FontString>
                        </Layer>
                </Layers>
        </Frame>
</Ui>
