<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="CVBankItemButtonBagTemplate" inherits="CVItemButtonTemplate" virtual="true">
		<Scripts>
			<OnLoad>
				this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
			</OnLoad>
			<OnClick>		
				CharactersViewer.BankFrame.ToggleBag_OnClick();
			</OnClick>
			<OnEnter>
				CharactersViewer.BankFrame.ToggleBag_OnEnter();
	  	</OnEnter>
		</Scripts>
		<Frames>
			<Frame name="$parentHighlightFrame" setAllPoints="true">
				<Layers>
					<Layer>
						<Texture name="$parentTexture" alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight" setAllPoints="true" hidden="true"/>									
					</Layer>
				</Layers>
			</Frame>
		</Frames>
	</Button>


	<Frame name="CVBankFrame" toplevel="true" movable="true" parent="UIParent" 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="30" top="0" bottom="70"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="CVBankPortraitTexture">
					<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\BankFrame\UI-BankFrame">
					<Size>
						<AbsDimension x="512" y="512"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
				</Texture>
				<FontString name="CVBankFrameTitleText" inherits="GameFontHighlight">
					<Anchors>
						<Anchor point="CENTER">
							<Offset>
								<AbsDimension x="6" y="233"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="CVBankFrameItemSlotText" inherits="GameFontNormal" text="ITEMSLOTTEXT">
					<Anchors>
						<Anchor point="CENTER">
							<Offset>
								<AbsDimension x="-11" y="195"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString inherits="GameFontNormal" text="BAGSLOTTEXT">
					<Anchors>
						<Anchor point="CENTER">
							<Offset>
								<AbsDimension x="-11" y="-5"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="CVBankFrameTimestamp" inherits="GameFontNormal" text="temp">
					<Anchors>
						<Anchor point="CENTER" relativeTo="CVBankFrameItemSlotText" relativePoint="CENTER">
							<Offset> 
								<AbsDimension x="0" y="12"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="CVBankFrameMoney1" inherits="GameFontHighlight" text="CHARACTERSVIEWER_ALLIANCE_ALLIANCE">
					<Anchors>
						<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT">
							<Offset> 
								<AbsDimension x="160" y="144"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="CVBankFrameMoney2" inherits="GameFontHighlight" text="CHARACTERSVIEWER_ALLIANCE_HORDE">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="CVBankFrameMoney1" relativePoint="BOTTOMLEFT">
							<Offset> 
								<AbsDimension x="0" y="-9"/> 
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>				
				<FontString name="CVBankFrameMoney3" inherits="GameFontHighlight" text="CHARACTERSVIEWER_ALLIANCE_TOTAL">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="CVBankFrameMoney2" relativePoint="BOTTOMLEFT">
							<Offset> 
								<AbsDimension x="0" y="-9"/> 
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>				
			</Layer>	
		</Layers>
		<Frames>
			<Button name="CVBankCloseButton" inherits="UIPanelCloseButton">
				<Anchors>
					<Anchor point="CENTER" relativeTo="CVBankFrame" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="4" y="-24"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem1" inherits="CVItemButtonTemplate" id="2001">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="40" y="-73"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem2" inherits="CVItemButtonTemplate" id="2002">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem1" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem3" inherits="CVItemButtonTemplate" id="2003">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem2" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem4" inherits="CVItemButtonTemplate" id="2004">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem3" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem5" inherits="CVItemButtonTemplate" id="2005">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem4" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem6" inherits="CVItemButtonTemplate" id="2006">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem5" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem7" inherits="CVItemButtonTemplate" id="2007">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem6" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>

			<Button name="CVBankFrameItem8" inherits="CVItemButtonTemplate" id="2008">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem1" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem9" inherits="CVItemButtonTemplate" id="2009">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem8" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem10" inherits="CVItemButtonTemplate" id="2010">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem9" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem11" inherits="CVItemButtonTemplate" id="2011">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem10" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem12" inherits="CVItemButtonTemplate" id="2012">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem11" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem13" inherits="CVItemButtonTemplate" id="2013">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem12" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem14" inherits="CVItemButtonTemplate" id="2014">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem13" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>

			<Button name="CVBankFrameItem15" inherits="CVItemButtonTemplate" id="2015">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem8" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem16" inherits="CVItemButtonTemplate" id="2016">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem15" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem17" inherits="CVItemButtonTemplate" id="2017">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem16" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem18" inherits="CVItemButtonTemplate" id="2018">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem17" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem19" inherits="CVItemButtonTemplate" id="2019">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem18" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem20" inherits="CVItemButtonTemplate" id="2020">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem19" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem21" inherits="CVItemButtonTemplate" id="2021">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem20" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
      
			<Button name="CVBankFrameItem22" inherits="CVItemButtonTemplate" id="2022">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem15" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-7"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem23" inherits="CVItemButtonTemplate" id="2023">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem22" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem24" inherits="CVItemButtonTemplate" id="2024">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem23" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem25" inherits="CVItemButtonTemplate" id="2025">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem24" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem26" inherits="CVItemButtonTemplate" id="2026">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem25" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem27" inherits="CVItemButtonTemplate" id="2027">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem26" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameItem28" inherits="CVItemButtonTemplate" id="2028">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem27" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>

			<Button name="CVBankFrameBag1" inherits="CVBankItemButtonBagTemplate" id="5">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameItem22" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-32"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag2" inherits="CVBankItemButtonBagTemplate" id="6">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag1" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag3" inherits="CVBankItemButtonBagTemplate" id="7">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag2" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag4" inherits="CVBankItemButtonBagTemplate" id="8">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag3" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag5" inherits="CVBankItemButtonBagTemplate" id="9">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag4" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag6" inherits="CVBankItemButtonBagTemplate" id="10">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag5" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="CVBankFrameBag7" inherits="CVBankItemButtonBagTemplate" id="11">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="CVBankFrameBag6" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="12" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>

			<!-- Bank Money Frame -->
			<Frame name="CVBankFrameMoneyFrame1" inherits="SmallMoneyFrameTemplate" hidden="false">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativeTo="CVBankFrameMoney1" relativePoint="BOTTOMLEFT">
						<Offset> 
							<AbsDimension x="182" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						SmallMoneyFrame_OnLoad();
						MoneyFrame_SetType("STATIC");
					</OnLoad>
					<OnShow>
						-- Do nothing override
					</OnShow>
				</Scripts>
			</Frame>
			<Frame name="CVBankFrameMoneyFrame2" inherits="SmallMoneyFrameTemplate" hidden="false">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativeTo="CVBankFrameMoney2" relativePoint="BOTTOMLEFT">
						<Offset> 
							<AbsDimension x="182" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						SmallMoneyFrame_OnLoad();
						MoneyFrame_SetType("STATIC");
					</OnLoad>
					<OnShow>
						-- Do nothing override
					</OnShow>
				</Scripts>
			</Frame>			
			<Frame name="CVBankFrameMoneyFrame3" inherits="SmallMoneyFrameTemplate" hidden="false">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativeTo="CVBankFrameMoney3" relativePoint="BOTTOMLEFT">
						<Offset> 
							<AbsDimension x="182" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						SmallMoneyFrame_OnLoad();
						MoneyFrame_SetType("STATIC");
					</OnLoad>
					<OnShow>
						-- Do nothing override
					</OnShow>
				</Scripts>
			</Frame>			
		</Frames>
		<Scripts>
			<OnLoad>
				CharactersViewer.BankFrame.OnLoad(); 
			</OnLoad>
			<OnEvent>
				BankFrame_OnEvent(event);
			</OnEvent>
			<OnShow>
				PlaySound("igMainMenuOpen");
			</OnShow>
			<OnHide>
				if ( this.isMoving ) then
					this:StopMovingOrSizing();
					this.isMoving = false;
				end
				CharactersViewer.BankFrame.Hide();
			</OnHide>
			<OnMouseUp>
				if ( this.isMoving ) then
					this:StopMovingOrSizing();
					this.isMoving = false;
				end
			</OnMouseUp>
			<OnMouseDown>
				if ( ( ( not this.isLocked ) or ( this.isLocked == 0 ) ) and ( arg1 == "LeftButton" ) ) then
					this:StartMoving();
					this.isMoving = true;
				end
			</OnMouseDown>
		</Scripts>
	</Frame>
	<Frame name="CVPaperDollFrameDropDown3" inherits="UIDropdownMenuTemplate" enableMouse="true" parent="CVBankFrame">
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="CVBankFrame" relativePoint="BOTTOMLEFT">
				<Offset> 
					<AbsDimension x="5" y="150"/> 
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				CharactersViewer.xml.DropDown_OnLoad();
			</OnLoad>
			<OnShow>
				CharactersViewer.xml.DropDown_OnLoad();
			</OnShow>
			<OnEnter>
				--CharactersViewerDropDown_OnEnter();
			</OnEnter>
		</Scripts>
	</Frame>
</Ui>
