<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="BankFrame.lua"/>
	<Button name="BankItemButtonGenericTemplate" inherits="ItemButtonTemplate" virtual="true">
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentIconQuestTexture">
					<Size x="37" y="38"/>
					<Anchors>
						<Anchor point="TOP" x="0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>	
		<Frames>
			<Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate"/>
		</Frames>
		<Scripts>
			<OnLoad>
				BankFrameItemButton_OnLoad(self);
			</OnLoad>
			<OnEnter>
				BankFrameItemButton_OnEnter(self, motion);
			</OnEnter>
			<OnLeave>
				GameTooltip_Hide();
				ResetCursor();
			</OnLeave>
			<OnClick>
				if ( IsModifiedClick() ) then
					BankFrameItemButtonGeneric_OnModifiedClick(self, button);
				else
					BankFrameItemButtonGeneric_OnClick(self, button);
				end
			</OnClick>
            <OnDragStart>
                BankFrameItemButtonGeneric_OnClick(self, "LeftButton");
            </OnDragStart>
            <OnReceiveDrag>
                BankFrameItemButtonGeneric_OnClick(self, "LeftButton");
            </OnReceiveDrag>
		</Scripts>
	</Button>
	<Button name="BankItemButtonBagTemplate" inherits="ItemButtonTemplate" virtual="true">
		<Frames>
			<Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate"/>
			<Frame name="$parentHighlightFrame" setAllPoints="true">
				<Layers>
					<Layer>
						<Texture name="$parentTexture" alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight" setAllPoints="true" hidden="true"/>
					</Layer>
				</Layers>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad>
				BankFrameBagButton_OnLoad(self);
			</OnLoad>				
			<OnEvent>
				BankFrameBagButton_OnEvent(self, event, ...);
			</OnEvent>
			<OnEnter>
				BankFrameItemButton_OnEnter(self, motion);
			</OnEnter>
			<OnLeave>
				GameTooltip_Hide();
				ResetCursor();
			</OnLeave>
			<OnClick>
				if ( IsModifiedClick("PICKUPITEM") ) then
					BankFrameItemButtonBag_Pickup(self);
				else
					BankFrameItemButtonBag_OnClick(self, button);
				end
			</OnClick>
	        <OnDragStart>
				BankFrameItemButtonBag_Pickup(self, button);
			</OnDragStart>
	        <OnReceiveDrag>
				BankFrameItemButtonBag_OnClick(self, nil);
			</OnReceiveDrag>
		</Scripts>
	</Button>

	<Texture name="Bank-Slot-BG" file="Interface\BankFrame\Bank-Parts" virtual="true" >
		<Size x="51" y="50"/>	
		<TexCoords left="0.01562500" right="0.81250000" top="0.11718750" bottom="0.50781250"/>	
	</Texture>
	<Texture name="Bank-Rivet" file="Interface\BankFrame\Bank-Parts" virtual="true" >
		<Size x="12" y="12"/>	
		<TexCoords left="0.01562500" right="0.20312500" top="0.00781250" bottom="0.10156250"/>	
	</Texture>

	<Frame name="BankFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" inherits="PortraitFrameTemplate">
		<Size x="386" y="415"/>
		<Layers>
			<Layer level="ARTWORK">
				<Texture name="BankPortraitTexture" >
					<Size x="60" y="60"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="-5" y="5"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND">
				<Texture file="Interface\BankFrame\Bank-Background" horizTile="true" vertTile="true">
					<Size x="256" y="256"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="0" y="-20"/>
						<Anchor point="BOTTOMRIGHT"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BORDER">
				<Texture name="LeftTopCorner-Shadow" file="Interface\BankFrame\CornersShadow" virtual="true" >
					<Size x="44" y="44"/>	
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="BankFrame" relativePoint="TOPLEFT" x="2" y="-22"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.70312500" top="0.00390625" bottom="0.17578125"/>	
				</Texture>
				<Texture name="LeftBottomCorner-Shadow" file="Interface\BankFrame\CornersShadow">
					<Size x="44" y="44"/>
					<Anchors>
						<Anchor point="BOTTOMLEFT" relativeTo="BankFrame" relativePoint="BOTTOMLEFT" x="2" y="27"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.70312500" top="0.18359375" bottom="0.35546875"/>	
				</Texture>
				<Texture name="RightTopCorner-Shadow" file="Interface\BankFrame\CornersShadow">
					<Size x="44" y="44"/>
					<Anchors>
						<Anchor point="TOPRIGHT" relativeTo="BankFrame" relativePoint="TOPRIGHT" x="-3" y="-22"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.70312500" top="0.36328125" bottom="0.53515625"/>	
				</Texture>
				<Texture name="RightBottomCorner-Shadow" file="Interface\BankFrame\CornersShadow">
					<Size x="44" y="44"/>
					<Anchors>
						<Anchor point="BOTTOMRIGHT" relativeTo="BankFrame" relativePoint="BOTTOMRIGHT" x="-3" y="27"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.70312500" top="0.54296875" bottom="0.71484375"/>
				</Texture>
				<Texture name="Right-Shadow" file="Interface\BankFrame\VertShadow" virtual="true" vertTile="true" >
					<Size x="17" y="256"/>
					<Anchors>
						<Anchor point="TOPRIGHT" relativeTo="RightTopCorner-Shadow" relativePoint="BOTTOMRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeTo="RightBottomCorner-Shadow" relativePoint="TOPRIGHT"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.28125000" top="0.00000000" bottom="1.00000000"/>	
				</Texture>
				<Texture name="Left-Shadow" file="Interface\BankFrame\VertShadow" virtual="true" vertTile="true" >
					<Size x="17" y="256"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LeftTopCorner-Shadow" relativePoint="BOTTOMLEFT"/>
						<Anchor point="BOTTOMLEFT" relativeTo="LeftBottomCorner-Shadow" relativePoint="TOPLEFT"/>
					</Anchors>
					<TexCoords left="0.31250000" right="0.57812500" top="0.00000000" bottom="1.00000000"/>	
				</Texture>
				<Texture name="Bottom-Shadow" file="Interface\BankFrame\HorizShadow" virtual="true" horizTile="true" >
					<Size x="256" y="17"/>
					<Anchors>
						<Anchor point="BOTTOMLEFT" relativeTo="LeftBottomCorner-Shadow" relativePoint="BOTTOMRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeTo="RightBottomCorner-Shadow" relativePoint="BOTTOMLEFT"/>
					</Anchors>
					<TexCoords left="0.00000000" right="1.00000000" top="0.01562500" bottom="0.28125000"/>	
				</Texture>
				<Texture name="Top-Shadow" file="Interface\BankFrame\HorizShadow" virtual="true" horizTile="true" >
					<Size x="256" y="17"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LeftTopCorner-Shadow" relativePoint="TOPRIGHT"/>
						<Anchor point="TOPRIGHT" relativeTo="RightTopCorner-Shadow" relativePoint="TOPLEFT"/>
					</Anchors>
					<TexCoords left="0.00000000" right="1.00000000" top="0.31250000" bottom="0.57812500"/>	
				</Texture>
				<FontString name="BankFrameTitleText" inherits="GameFontHighlight">
					<Anchors>
						<Anchor point="CENTER" x="-3" y="233"/>
					</Anchors>
				</FontString>
				<FontString inherits="GameFontNormal" text="ITEMSLOTTEXT">
					<Anchors>`
						<Anchor point="CENTER" x="-3" y="145"/>
					</Anchors>
				</FontString>
				<FontString inherits="GameFontNormal" text="BAGSLOTTEXT">
					<Anchors>
						<Anchor point="CENTER" x="-3" y="-55"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Button name="BankFrameItem1" inherits="BankItemButtonGenericTemplate" id="1">
				<Anchors>
					<Anchor point="TOPLEFT" x="28" y="-75"/>
				</Anchors>
			</Button>
			<!-- The other 27 items are created in BankFrame_OnLoad -->

			<Button name="BankFrameBag1" inherits="BankItemButtonBagTemplate" id="5">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameItem1" relativePoint="BOTTOMLEFT" x="0" y="-164"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag2" inherits="BankItemButtonBagTemplate" id="6">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag1" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag3" inherits="BankItemButtonBagTemplate" id="7">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag2" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag4" inherits="BankItemButtonBagTemplate" id="8">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag3" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag5" inherits="BankItemButtonBagTemplate" id="9">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag4" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag6" inherits="BankItemButtonBagTemplate" id="10">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag5" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Button name="BankFrameBag7" inherits="BankItemButtonBagTemplate" id="11">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="BankFrameBag6" relativePoint="TOPRIGHT" x="12" y="0"/>
				</Anchors>
			</Button>
			<Frame name="BankFramePurchaseInfo" hidden="false">
				<Size x="380" y="78"/>
				<Anchors>
					<Anchor point="CENTER" relativeTo="BankFrame" relativePoint="CENTER" x="-18" y="-145"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString inherits="GameFontHighlight" text="BANKSLOTPURCHASE_LABEL" justifyH="LEFT">
							<Size x="380" y="0"/>
							<Anchors>
								<Anchor point="CENTER" x="42" y="20"/>
							</Anchors>
						</FontString>
						<FontString name="BankFrameSlotCost" inherits="GameFontNormal" text="COSTS_LABEL">
							<Size x="0" y="12"/>
							<Anchors>
								<Anchor point="LEFT" relativePoint="LEFT" x="45" y="-10"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Frames>
					<Button name="BankFramePurchaseButton" inherits="UIPanelButtonTemplate" virtual="true" text="BANKSLOTPURCHASE">
						<Size x="124" y="21"/>
						<Anchors>
							<Anchor point="RIGHT" relativePoint="RIGHT" x="-10" y="-10"/>
						</Anchors>
						<Scripts>
							<OnClick>
								PlaySound("igMainMenuOption");
								StaticPopup_Show("CONFIRM_BUY_BANK_SLOT");
							</OnClick>
						</Scripts>
					</Button>
					<Frame name="BankFrameDetailMoneyFrame" inherits="SmallMoneyFrameTemplate" hidden="false">
						<Anchors>
							<Anchor point="LEFT" relativeTo="BankFrameSlotCost" relativePoint="RIGHT" x="10" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								SmallMoneyFrame_OnLoad(self);
								MoneyFrame_SetType(self, "STATIC");
							</OnLoad>
						</Scripts>
					</Frame>
				</Frames>
			</Frame>
			<Frame name="BankFrameMoneyFrameInset" inherits="InsetFrameTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="3" y="27"/>
					<Anchor point="BOTTOMRIGHT" x="-5" y="5"/>
				</Anchors>
			</Frame>
			<Frame name="BankFrameMoneyFrameBorder" inherits="ThinGoldEdgeTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="5" y="25"/>
					<Anchor point="BOTTOMRIGHT" x="-8" y="6"/>
				</Anchors>
			</Frame>
			<Frame name="BankFrameMoneyFrame" inherits="SmallMoneyFrameTemplate" hidden="false">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-5" y="8"/>
				</Anchors>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad function="BankFrame_OnLoad"/>
			<OnEvent function="BankFrame_OnEvent"/>
			<OnShow function="BankFrame_OnShow"/>
			<OnHide function="BankFrame_OnHide"/>
		</Scripts>
	</Frame>

	<EditBox name="BankItemSearchBox" inherits="BagSearchBoxTemplate" parent="BankFrame" letters="15">
		<Size x="130" y="20"/>
		<Anchors>
			<Anchor point="TOPRIGHT" x="-24" y="-33"/>
		</Anchors>
	</EditBox>
</Ui>