<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Script file="RaidFrame.lua"/>
	<Frame name="RaidInfoInstanceTemplate" virtual="true">
		<Size>
			<AbsDimension x="230" y="40"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentID" inherits="GameFontDisableSmall" justifyH="RIGHT">
					<Size>
						<AbsDimension x="55" y="10"/>
					</Size>
					<Anchors>
						<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
							<Offset>
								<AbsDimension x="0" y="-11"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentReset" inherits="GameFontHighlightSmall" >
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-2" y="-26"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="$parentName" enableMouse="true">
				<Size>
					<AbsDimension x="170" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="-2" y="-10"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
							<Anchors>
								<Anchor point="LEFT"/>
								<Anchor point="RIGHT"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnEnter>
						local text = _G[self:GetName().."Text"];
						if text:GetWidth() > self:GetWidth() then
							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
							GameTooltip:SetText(text:GetText());
						end
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
		</Frames>
	</Frame>
	<Frame name="RaidFrame" setAllPoints="true" hidden="true" parent="FriendsFrame">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="RaidFrameRaidDescription" inherits="GameFontNormal" text="RAID_DESCRIPTION" justifyH="LEFT">
					<Size>
						<AbsDimension x="300" y="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="29" y="-85"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Button name="RaidFrameConvertToRaidButton" inherits="UIPanelButtonTemplate" text="CONVERT_TO_RAID">
				<Size>
					<AbsDimension x="115" y="21"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="72" y="-37"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ConvertToRaid();
					</OnClick>
				</Scripts>
				<NormalFont style="GameFontNormalSmall"/>
				<HighlightFont style="GameFontHighlightSmall"/>
				<DisabledFont style="GameFontDisableSmall"/>
			</Button>
			<Button name="RaidFrameRaidInfoButton" inherits="UIPanelButtonTemplate" text="RAID_INFO">
				<Size>
					<AbsDimension x="90" y="21"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="RaidFrameConvertToRaidButton" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="65" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						if RaidInfoFrame:IsShown() then
							RaidInfoFrame:Hide();
						else
							RaidInfoFrame:Show();
						end
					</OnClick>
				</Scripts>
				<NormalFont style="GameFontNormalSmall"/>
				<HighlightFont style="GameFontHighlightSmall"/>
				<DisabledFont style="GameFontDisableSmall"/>
			</Button>
			<Frame name="RaidInfoFrame" enableMouse="true" hidden="true">
				<Size>
					<AbsDimension x="270" y="250"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-33" y="-28"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
					<BackgroundInsets>
						<AbsInset left="11" right="12" top="12" bottom="11"/>
					</BackgroundInsets>
					<TileSize>
						<AbsValue val="32"/>
					</TileSize>
					<EdgeSize>
						<AbsValue val="32"/>
					</EdgeSize>
				</Backdrop>
				<Layers>
					<Layer level="ARTWORK">
						<Texture name="RaidInfoDetailHeader" file="Interface\RaidFrame\UI-RaidInfo-Header">
							<Size>
								<AbsDimension x="250" y="64"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="11" y="-10"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="OVERLAY">
						<Texture name="RaidInfoDetailCorner" file="Interface\DialogFrame\UI-DialogBox-Corner">
							<Size>
								<AbsDimension x="32" y="32"/>
							</Size>
							<Anchors>
								<Anchor point="TOPRIGHT">
									<Offset>
										<AbsDimension x="-6" y="-7"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
						<FontString name="RaidInfoHeader" inherits="GameFontNormal" text="RAID_INFORMATION">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="20" y="-15"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="RaidInfoSubheader" inherits="GameFontHighlightSmall" text="RAID_INFO_DESC">
							<Anchors>
								<Anchor point="TOPLEFT" relativeTo="RaidInfoHeader" relativePoint="BOTTOMLEFT">
									<Offset>
										<AbsDimension x="0" y="-5"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="RaidInfoInstanceLabel" inherits="GameFontDisableSmall" text="INSTANCE" justifyH="LEFT">
							<Size>
								<AbsDimension x="195" y="12"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT" relativeTo="RaidInfoSubheader" relativePoint="BOTTOMLEFT">
									<Offset>
										<AbsDimension x="0" y="-13"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="RaidInfoIDLabel" inherits="GameFontDisableSmall" text="ID">
							<Anchors>
								<Anchor point="LEFT" relativeTo="RaidInfoInstanceLabel" relativePoint="RIGHT"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Frames>
					<Button name="RaidInfoCloseButton" inherits="UIPanelCloseButton">
						<Anchors>
							<Anchor point="TOPRIGHT">
								<Offset>
									<AbsDimension x="-2" y="-3"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<ScrollFrame name="RaidInfoScrollFrame">
						<Size>
							<AbsDimension x="235" y="158"/>
						</Size>
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset x="21" y="-70"/>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
									<Size>
										<AbsDimension x="30" y="125"/>
									</Size>
									<Anchors>
										<Anchor point="TOPRIGHT">
											<Offset>
												<AbsDimension x="6" y="23"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0" right="0.484375" top="0" bottom="0.5"/>
								</Texture>
								<Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
									<Size>
										<AbsDimension x="30" y="105"/>
									</Size>
									<Anchors>
										<Anchor point="BOTTOMRIGHT">
											<Offset>
												<AbsDimension x="6" y="-13"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
								</Texture>
							</Layer>
						</Layers>
						<Frames>
							<Slider name="$parentScrollBar" inherits="UIPanelScrollBarTemplate">
								<Anchors>
									<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
										<Offset>
											<AbsDimension x="0" y="3"/>
										</Offset>
									</Anchor>
									<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
										<Offset>
											<AbsDimension x="0" y="5"/>
										</Offset>
									</Anchor>
								</Anchors>
							</Slider>
						</Frames>
						<Scripts>
							<OnLoad>
								ScrollFrame_OnLoad(self);
							</OnLoad>
							<OnScrollRangeChanged>
								ScrollFrame_OnScrollRangeChanged(self, yrange);
							</OnScrollRangeChanged>
							<!--  The code to disable the ScrollDownButton is pretty hacked, but it works -->
							<OnVerticalScroll>
								local scrollbar = getglobal(self:GetName().."ScrollBar");
								scrollbar:SetValue(offset);
								local min;
								local max;
								min, max = scrollbar:GetMinMaxValues();
								if offset == 0 then
									getglobal(scrollbar:GetName().."ScrollUpButton"):Disable();
								else
									getglobal(scrollbar:GetName().."ScrollUpButton"):Enable();
								end
								if (scrollbar:GetValue() - max) == 0 then
									getglobal(scrollbar:GetName().."ScrollDownButton"):Disable();
								else
									getglobal(scrollbar:GetName().."ScrollDownButton"):Enable();
								end
							</OnVerticalScroll>
							<OnMouseWheel>
								ScrollFrameTemplate_OnMouseWheel(self, delta);
							</OnMouseWheel>
						</Scripts>
						<ScrollChild>
							<Frame name="RaidInfoScrollChildFrame" enableMouse="true">
								<Size x="220" y="40"/>
								<Anchors>
									<Anchor point="TOPLEFT"/>
								</Anchors>
								<Frames>
									<Frame name="RaidInfoInstance1" inherits="RaidInfoInstanceTemplate">
										<Anchors>
											<Anchor point="TOPLEFT">
												<Offset>
													<AbsDimension x="0" y="0"/>
												</Offset>
											</Anchor>
										</Anchors>
									</Frame>
								</Frames>
							</Frame>
						</ScrollChild>
					</ScrollFrame>
				</Frames>
				<Scripts>
					<OnShow>
						if (GetNumRaidMembers() > 0 ) then
							RaidInfoFrame:SetPoint("TOPLEFT", "RaidFrame", "TOPRIGHT", -13, -28);
						else
							RaidInfoFrame:SetPoint("TOPLEFT", "RaidFrame", "TOPRIGHT", -33, -28);
						end
					</OnShow>
				</Scripts>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad>
				RaidFrame_OnLoad(self);
			</OnLoad>
			<OnShow>
				RaidFrame_Update();
				RequestRaidInfo();
			</OnShow>
			<OnEvent>
				RaidFrame_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
		<HitRectInsets>
			<AbsInset left="0" right="100" top="0" bottom="100"/>
		</HitRectInsets>
	</Frame>
</Ui>
