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

	<Button name="XPerl_Party_FrameTemplate" inherits="SecureUnitButtonTemplate" virtual="true" clampedToScreen="true" frameStrata="LOW" hidden="true">
		<Size>
			<AbsDimension x="160" y="60"/>
		</Size>

		<Scripts>
			<OnLoad>
				self:RegisterForClicks("AnyUp")
				self:RegisterForDrag("LeftButton")
				XPerl_Party_OnLoad(self)
				self:SetScript("OnEnter", XPerl_Unit_OnEnter)
				self:SetScript("OnLeave", XPerl_Unit_OnLeave)
			</OnLoad>
			<OnDragStart>
				if (XPerlLocked == 0) then
					XPerl_Party_Anchor:StartMoving()
				end
			</OnDragStart>
			<OnDragStop>
				XPerl_Party_Anchor:StopMovingOrSizing()
				XPerl_SavePosition(XPerl_Party_Anchor)
			</OnDragStop>
		</Scripts>

		<Frames>
			<!-- Party Portrait -->
			<Frame name="$parentportraitFrame" inherits="XPerl_Portrait_Template" hidden="true">
				<Anchors>
					<Anchor point="TOPLEFT"/>
				</Anchors>
			</Frame>

			<!-- Party Name -->
			<Button name="$parentnameFrame" inherits="SecureUnitButtonTemplate">
				<Scripts>
					<OnLoad>
						self:RegisterForClicks("AnyUp")
						self:RegisterForDrag("LeftButton")
						XPerl_RegisterUnitText(_G[self:GetName().."text"])
						self:SetScript("OnEnter", function(self) XPerl_Unit_OnEnter(self:GetParent()) end)
						self:SetScript("OnLeave", function(self) XPerl_Unit_OnLeave(self:GetParent()) end)
					</OnLoad>
					<OnDragStart>
						if (XPerlLocked == 0) then
							XPerl_Party_Anchor:StartMoving()
						end
					</OnDragStart>
					<OnDragStop>
						XPerl_Party_Anchor:StopMovingOrSizing()
						XPerl_SavePosition(XPerl_Party_Anchor)
					</OnDragStop>
				</Scripts>
				<Size>
					<AbsDimension x="106" 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="4" right="4" top="4" bottom="4"/>
					</BackgroundInsets>
				</Backdrop>
				<Layers>
					<Layer level="OVERLAY">
						<!-- Combat Icon -->
						<Texture name="$parentcombatIcon" 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>

						<!-- PVP Icon -->
						<Texture name="$parentpvpIcon" file="Interface\TargetingFrame\UI-PVP-FFA" hidden="true">
							<Size>
								<AbsDimension x="36" y="36"/>
							</Size>
							<Anchors>
								<Anchor point="RIGHT">
									<Offset>
										<AbsDimension x="16" y="-7"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<!-- 30 Yard Range Icon, the return -->
						<Texture name="$parentrangeIcon" file="Interface\Addons\XPerl\images\XPerl_30Yard" hidden="true">
							<Size>
								<AbsDimension x="48" y="19"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER" relativePoint="TOP">
									<Offset>
										<AbsDimension x="0" y="-2"/>
									</Offset>
								</Anchor>
							</Anchors>
							<TexCoords left="0" right="1" top="0" bottom="0.4" />
						</Texture>
					</Layer>

					<Layer level="OVERLAY">
						<!-- Leader Icon -->
						<Texture name="$parentleaderIcon" file="Interface\GroupFrame\UI-Group-LeaderIcon" hidden="true">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="10" y="7"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
						<!-- Master Icon -->
						<Texture name="$parentmasterIcon" file="Interface\GroupFrame\UI-Group-MasterLooter" hidden="true">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="25" y="7"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<Texture name="$parentroleIcon" file="Interface\GroupFrame\UI-Group-MainAssistIcon" hidden="true">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="40" y="5"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Size><AbsDimension x="16" y="16"/></Size>
						</Texture>

						<!-- Warning Icon -->
						<Texture name="$parentwarningIcon" 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="$parenttext" inherits="GameFontNormal">
							<Anchors>
								<Anchor point="TOPLEFT"/>
								<Anchor point="BOTTOMRIGHT">
									<Offset>
										<AbsDimension x="0" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
			</Button>

			<!-- Party Level Frame -->

			<Frame name="$parentlevelFrame">
				<Size>
					<AbsDimension x="34" y="42"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentnameFrame"/>
				</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="8"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="4" right="4" top="4" bottom="4"/>
					</BackgroundInsets>
				</Backdrop>
				<Layers>
					<Layer level="OVERLAY">
						<!-- Level Text -->
						<FontString name="$parenttext" inherits="GameFontNormalSmall" setAllPoints="true">
							<Size>
								<AbsDimension x="32" y="12"/>
							</Size>
							<Color r="1.0" g="1.0" b="0"/>
						</FontString>

						<!-- Class Icon -->
						<Texture name="$parentclassTexture" file="Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes">
							<Size>
								<AbsDimension x="20" y="20"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
									<Offset>
										<AbsDimension x="5" y="-5"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						XPerl_RegisterUnitText(_G[self:GetName().."text"])
					</OnLoad>
				</Scripts>
			</Frame>

			<!-- Party Stats -->
			<Frame name="$parentstatsFrame" inherits="XPerl_Stats_Template">
				<Size>
					<AbsDimension x="140" y="41"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentlevelFrame">
						<Offset>
							<AbsDimension x="-4" y="-1"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Frames>
					<Frame name="$parentready" hidden="true" setAllPoints="true" topLevel="true">
						<Layers>
							<Layer level="OVERLAY">
								<!-- Class Icon -->
								<Texture name="$parentcheck">
									<Size>
										<AbsDimension x="32" y="32"/>
									</Size>
									<Anchors>
										<Anchor point="RIGHT">
											<Offset>
												<AbsDimension x="-5" y="0"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
					</Frame>
				</Frames>
			</Frame>

			<!-- Party Target Frame -->
			<Button name="$parenttargetFrame" hidden="true" inherits="SecureUnitButtonTemplate">	--frameStrata="MEDIUM"
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent():GetFrameLevel() + 1)
						self:RegisterForClicks("AnyUp")
						XPerl_SecureUnitButton_OnLoad(self, nil, XPerl_ShowGenericMenu)
						self:SetAttribute("useparent-unit", true)
						self:SetAttribute("unitsuffix", "target")
						self:SetScript("OnEnter", XPerl_Unit_OnEnter)
						self:SetScript("OnLeave", XPerl_Unit_OnLeave)
					</OnLoad>
				</Scripts>
				<Size><AbsDimension x="68" y="24"/></Size>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="$parentnameFrame">
						<Offset>
							<AbsDimension x="-2" 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="4" right="4" top="4" bottom="4"/>
					</BackgroundInsets>
				</Backdrop>
				<HighlightTexture file="Interface\Addons\XPerl\Images\XPerl_Highlight" alphaMode="ADD">
					<TexCoords left="0" right="1" top="0.5" bottom="1"/>
				</HighlightTexture>
				<Frames>
					<StatusBar name="$parenthealthBar" inherits="XPerlStatusBar">
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset><AbsDimension x="5" y="-16"/></Offset>
							</Anchor>
							<Anchor point="BOTTOMRIGHT">
								<Offset><AbsDimension x="-5" y="5"/></Offset>
							</Anchor>
						</Anchors>
						<BarColor r="0" g="0.8" b="0"/>
					</StatusBar>
				</Frames>
				<Layers>
					<Layer level="OVERLAY">
						<!-- Combat Icon -->
						<Texture name="$parentcombatIcon" file="Interface\CharacterFrame\UI-StateIcon" hidden="true">
							<Size><AbsDimension x="22" y="21"/></Size>
							<Anchors>
								<Anchor point="TOPRIGHT"/>
							</Anchors>
						</Texture>

						<!-- PVP Icon -->
						<Texture name="$parentpvpIcon" file="Interface\TargetingFrame\UI-PVP-FFA" hidden="true">
							<Size><AbsDimension x="32" y="32"/></Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset><AbsDimension x="-3" y="0"/></Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<Texture name="$parentraidIcon" file="Interface\TargetingFrame\UI-RaidTargetingIcons" hidden="true">
							<Size><AbsDimension x="16" y="16"/></Size>
							<Anchors>
								<Anchor point="CENTER" relativePoint="RIGHT">
									<Offset><AbsDimension x="1" y="0"/></Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<FontString name="$parenttext" inherits="GameFontNormalSmall">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset><AbsDimension x="3" y="-4"/></Offset>
								</Anchor>
								<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT">
									<Offset><AbsDimension x="-3" y="-14"/></Offset>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
			</Button>

			<!-- Buffs Frame -->
			<Frame name="$parentbuffFrame">
				<Size>
					<AbsDimension x="170" y="20"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentstatsFrame">
						<Offset>
							<AbsDimension x="5" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>

			<Frame name="$parentdebuffFrame">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentbuffFrame"/>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentbuffFrame"/>
				</Anchors>
			</Frame>

			<Frame name="$parenthighlight" inherits="XPerl_HighlightTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentnameFrame"/>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentstatsFrame"/>
				</Anchors>
			</Frame>

			<Frame name="$parenthitIndicator" frameStrata="HIGH">
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parenttext" inherits="NumberFontNormalHuge" hidden="true" text="Error!">
							<FontHeight>
								<AbsValue val="30"/>
							</FontHeight>
							<Color r="1.0" g="1.0" b="1.0"/>
							<Anchors>
								<Anchor point="CENTER" relativePoint="CENTER"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
			</Frame>
		</Frames>
	</Button>

	<Frame name="XPerl_Party_Anchor" frameStrata="LOW" parent="UIParent" clampedToScreen="true" movable="true">
		<Size>
			<AbsDimension x="100" y="60"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-150"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Frames>
			<Frame name="$parentVirtual" hidden="true">
				<Size><AbsDimension x="80" y="10"/></Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT"/>
				</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="16"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="4" right="4" top="4" bottom="4"/>
					</BackgroundInsets>
				</Backdrop>
				<Scripts>
					<OnLoad>
						self:RegisterForDrag("LeftButton")
					</OnLoad>
					<OnDragStart>
						if (XPerlLocked == 0) then
							XPerl_Party_Anchor:StartMoving()
						end
					</OnDragStart>
					<OnDragStop>
						XPerl_Party_Anchor:StopMovingOrSizing()
						XPerl_SavePosition(XPerl_Party_Anchor)
					</OnDragStop>
				</Scripts>
				<Layers>
					<Layer>
						<FontString name="$parentText" setAllPoints="true" inherits="GameFontNormal" text="Party"/>
					</Layer>
				</Layers>
			</Frame>
		</Frames>
	</Frame>

	<Frame name="XPerl_Party_SecureHeader" parent="XPerl_Party_Anchor" clampedToScreen="true" inherits="SecurePartyHeaderTemplate" hidden="true">
		<Size>
			<AbsDimension x="100" y="60"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="XPerl_Party_Anchor" relativePoint="CENTER"/>
		</Anchors>
		<Attributes>
			<Attribute name="template" type="string" value="XPerl_Party_FrameTemplate"/>
			<Attribute name="templateType" type="string" value="Button"/>
			<Attribute name="minWidth" type="number" value="80"/>
			<Attribute name="minHeight" type="number" value="10"/>
			<Attribute name="xOffset" type="number" value="0"/>
		</Attributes>
	</Frame>

	<!-- The Real Frames -->
	<Button name="XPerl_party1" inherits="XPerl_Party_FrameTemplate" parent="XPerl_Party_SecureHeader" id="1">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-150"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>
	<Button name="XPerl_party2" inherits="XPerl_Party_FrameTemplate" parent="XPerl_Party_SecureHeader" id="2">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-230"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>
	<Button name="XPerl_party3" inherits="XPerl_Party_FrameTemplate" parent="XPerl_Party_SecureHeader" id="3">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-310"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>
	<Button name="XPerl_party4" inherits="XPerl_Party_FrameTemplate" parent="XPerl_Party_SecureHeader" id="4">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="0" y="-390"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>

	<Frame name="XPerl_Party_Events">
		<Scripts>
			<OnLoad function="XPerl_Party_Events_OnLoad"/>
		</Scripts>
	</Frame>
</Ui>
