<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="ISync_BagView.lua"/>
	
	
	<Button name="ISync_BrowseButtonTemplate" hidden="true" virtual="true">
		<Size>
			<AbsDimension x="350"  y="27"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentName" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Size>
						<AbsDimension x="190"   y="22"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="43" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<Texture name="$parentLeft" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
					<Size>
						<AbsDimension x="10"   y="22"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="34" y="2"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="0.078125" top="0" bottom="1.0"/>
				</Texture>
				<Texture name="$parentRight" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
					<Size>
						<AbsDimension x="10"   y="22"/>
					</Size>
					<Anchors>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="0" y="2"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0.75" right="0.828125" top="0" bottom="1.0"/>
				</Texture>
				<Texture file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
					<Size>
						<AbsDimension x="10"   y="22"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0.078125" right="0.75" top="0" bottom="1.0"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button name="$parentItem">
				<Size>
					<AbsDimension x="25"   y="25"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BORDER">
						<Texture name="$parentIconTexture"/>
						<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true">
							<Anchors>
								<Anchor point="BOTTOMRIGHT">
									<Offset>
										<AbsDimension x="-5" y="2"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="0" y="-2"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
					</OnLoad>
					<OnClick>
						ISync:BV_ItemClick(arg1);
					</OnClick>
					<OnEnter>
						ISync:BV_ItemEnter();
					</OnEnter>
					<OnLeave>
						if(GameTooltip:IsVisible()) then GameTooltip:Hide(); end 
					</OnLeave>
				</Scripts>
				<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
			</Button>
			<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate" hidden="true">
				<Anchors>
					<Anchor point="RIGHT">
						<Offset>
							<AbsDimension x="10" y="3"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						SmallMoneyFrame_OnLoad();
						MoneyFrame_SetType("AUCTION");
					</OnLoad>
				</Scripts>
			</Frame>

		</Frames>
		<Scripts>
			<OnLoad>
				this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
			</OnLoad>
			<OnClick>
				ISync:BV_ItemClick(arg1);
			</OnClick>
			<OnEnter>
				ISync:BV_ItemEnter();
			</OnEnter>
			<OnLeave>
				if(GameTooltip:IsVisible()) then GameTooltip:Hide(); end 
			</OnLeave>
			
		</Scripts>
		<HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
			<Size>
				<AbsDimension x="315"   y="22"/>
			</Size>
			<Anchors>
				<Anchor point="TOPLEFT">
					<Offset>
						<AbsDimension x="33" y="0"/>
					</Offset>
				</Anchor>
			</Anchors>
			<TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
		</HighlightTexture>
	</Button>
	
	

	<Frame name="ISync_BV_Frame"  toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" parent="UIParent">
			<Size>
				<AbsDimension x="415" y="480"/>
			</Size>
			<Anchors>
				<Anchor point="CENTER">
					<Offset>
						<AbsDimension x="5" y="0"/>
					</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>
			<Frames>
			
				<Frame name="ISync_BV_Frame_HeaderBox" inherits="OptionFrameBoxTemplate">
					<Size>
						<AbsDimension x="365" y="30"/>
					</Size>
					<Anchors>
						<Anchor point="CENTER" relativeTo="ISync_BV_Frame" relativePoint="CENTER">
							<Offset>
								<AbsDimension x="0" y="247"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Layers>
						<Layer level="BACKGROUND">
							<FontString name="ISync_BV_Frame_HeaderBox_Text" inherits="GameFontNormal" text="ISYNC_BT_BAGVIEW">
								<Anchors>
									<Anchor point="CENTER"> 
										<Offset>
											<AbsDimension x="0" y="0"/>
										</Offset>
									</Anchor>
								</Anchors>
							</FontString>
						</Layer>
					</Layers>
					<Scripts>
						<OnLoad>
							this:SetBackdropBorderColor(0.4, 0.4, 0.4);
							this:SetBackdropColor(1.0, 128/256, 0.0, 0.7);
						</OnLoad>
						<OnMouseDown>
							if( arg1 == "LeftButton" ) then
								GameTooltip:Hide();
								getglobal(this:GetParent():GetName()):StartMoving();
							end
						</OnMouseDown>
						<OnMouseUp>
							getglobal(this:GetParent():GetName()):StopMovingOrSizing();
						</OnMouseUp>
					</Scripts>
				</Frame>


				<Button name="ISync_BV_Frame_CloseButton" inherits="UIPanelCloseButton" toplevel="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="ISync_BV_Frame_HeaderBox" relativePoint="RIGHT">
							<Offset>
								<AbsDimension x="-17" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Button>
				
				    <CheckButton name="ISync_CHK_StackedButton" virtual="true">
					<Size>
					    <AbsDimension x="20" y="20"/>
					</Size>
					<Anchors>
					    <Anchor point="LEFT" relativeTo="ISync_BV_Frame">
						<Offset>
						    <AbsDimension x="120" y="207"/>
						</Offset>
					    </Anchor>
					</Anchors>
					<Layers>
					    <Layer level="ARTWORK">
						<FontString name="ISync_CHK_StackedButtonText" inherits="GameFontHighlightSmall" text="ISYNC_BV_HELP">
						    <Anchors>
							<Anchor point="RIGHT" relativePoint="LEFT">
							    <Offset>
								<AbsDimension x="0" y="1"/>
							    </Offset>
							</Anchor>
						    </Anchors>
						</FontString>
					    </Layer>
					</Layers>
					<Scripts>
					    <OnClick>
						if (this:GetChecked()) then
						    PlaySound("igMainMenuOptionCheckBoxOn");
						    ISync:SetVar({"BAGVIEW","SHOWSTACKED"}, 1, "TRUE");
						else
						    PlaySound("igMainMenuOptionCheckBoxOff");
						     ISync:SetVar({"BAGVIEW","SHOWSTACKED"}, 0, "TRUE");
						end
						ISync:BV_Refresh();
					    </OnClick>
					</Scripts>
					<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
					<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
					<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
					<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
					<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
				    </CheckButton>
				    
				    
				
				    <CheckButton name="ISync_CHK_NillValuesButton" virtual="true">
					<Size>
					    <AbsDimension x="20" y="20"/>
					</Size>
					<Anchors>
					    <Anchor point="LEFT" relativeTo="ISync_BV_Frame">
						<Offset>
						    <AbsDimension x="250" y="207"/>
						</Offset>
					    </Anchor>
					</Anchors>
					<Layers>
					    <Layer level="ARTWORK">
						<FontString name="ISync_CHK_NillValuesButtonText" inherits="GameFontHighlightSmall" text="ISYNC_BV_HELP2">
						    <Anchors>
							<Anchor point="RIGHT" relativePoint="LEFT">
							    <Offset>
								<AbsDimension x="0" y="1"/>
							    </Offset>
							</Anchor>
						    </Anchors>
						</FontString>
					    </Layer>
					</Layers>
					<Scripts>
					    <OnClick>
						if (this:GetChecked()) then
						    PlaySound("igMainMenuOptionCheckBoxOn");
						    ISync:SetVar({"BAGVIEW","SHOWNIL"}, 1, "TRUE");
						else
						    PlaySound("igMainMenuOptionCheckBoxOff");
						    ISync:SetVar({"BAGVIEW","SHOWNIL"}, 0, "TRUE");
						end
						ISync:BV_Refresh();
					    </OnClick>
					</Scripts>
					<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
					<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
					<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
					<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
					<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
				    </CheckButton>


				    <CheckButton name="ISync_CHK_SortValue" virtual="true">
					<Size>
					    <AbsDimension x="20" y="20"/>
					</Size>
					<Anchors>
					    <Anchor point="BOTTOMLEFT" relativeTo="ISync_BV_Frame">
						<Offset>
						    <AbsDimension x="80" y="10"/>
						</Offset>
					    </Anchor>
					</Anchors>
					<Layers>
					    <Layer level="ARTWORK">
						<FontString name="ISync_CHK_SortValueText" inherits="GameFontHighlightSmall" text="ISYNC_BV_HELP3">
						    <Anchors>
							<Anchor point="RIGHT" relativePoint="LEFT">
							    <Offset>
								<AbsDimension x="0" y="1"/>
							    </Offset>
							</Anchor>
						    </Anchors>
						</FontString>
					    </Layer>
					</Layers>
					<Scripts>
					    <OnClick>
						if (this:GetChecked()) then
						    PlaySound("igMainMenuOptionCheckBoxOn");
						    ISync:SetVar({"BAGVIEW","SORT_VALUE"}, 1, "TRUE");
						    ISync:SetVar({"BAGVIEW","SORT_RARITY"}, 0, "TRUE");
						    ISync_CHK_SortRarity:SetChecked(0);
						else
						    PlaySound("igMainMenuOptionCheckBoxOff");
						    ISync:SetVar({"BAGVIEW","SORT_VALUE"}, 0, "TRUE");
						    ISync:SetVar({"BAGVIEW","SORT_RARITY"}, 1, "TRUE");
						    ISync_CHK_SortRarity:SetChecked(1);
						end
						ISync:BV_Refresh();
					    </OnClick>
					</Scripts>
					<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
					<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
					<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
					<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
					<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
				    </CheckButton>
				    
				    
				    <CheckButton name="ISync_CHK_SortRarity" virtual="true">
					<Size>
					    <AbsDimension x="20" y="20"/>
					</Size>
					<Anchors>
					    <Anchor point="BOTTOMLEFT" relativeTo="ISync_BV_Frame">
						<Offset>
						    <AbsDimension x="180" y="10"/>
						</Offset>
					    </Anchor>
					</Anchors>
					<Layers>
					    <Layer level="ARTWORK">
						<FontString name="ISync_CHK_SortRarityText" inherits="GameFontHighlightSmall" text="ISYNC_BV_HELP4">
						    <Anchors>
							<Anchor point="RIGHT" relativePoint="LEFT">
							    <Offset>
								<AbsDimension x="0" y="1"/>
							    </Offset>
							</Anchor>
						    </Anchors>
						</FontString>
					    </Layer>
					</Layers>
					<Scripts>
					    <OnClick>
						if (this:GetChecked()) then
						    PlaySound("igMainMenuOptionCheckBoxOn");
						    ISync:SetVar({"BAGVIEW","SORT_VALUE"}, 0, "TRUE");
						    ISync:SetVar({"BAGVIEW","SORT_RARITY"}, 1, "TRUE");
						    ISync_CHK_SortValue:SetChecked(0);
						else
						    PlaySound("igMainMenuOptionCheckBoxOff");
						    ISync:SetVar({"BAGVIEW","SORT_VALUE"}, 1, "TRUE");
						    ISync:SetVar({"BAGVIEW","SORT_RARITY"}, 0, "TRUE");
						    ISync_CHK_SortValue:SetChecked(1);
						end
						ISync:BV_Refresh();
					    </OnClick>
					</Scripts>
					<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
					<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
					<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
					<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
					<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
				    </CheckButton>
				    
					<Button name="ISync_BrowseButton1" inherits="ISync_BrowseButtonTemplate" id="1">
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset>
									<AbsDimension x="15" y="-40"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton2" inherits="ISync_BrowseButtonTemplate" id="2">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton1" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton3" inherits="ISync_BrowseButtonTemplate" id="3">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton2" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton4" inherits="ISync_BrowseButtonTemplate" id="4">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton3" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton5" inherits="ISync_BrowseButtonTemplate" id="5">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton4" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton6" inherits="ISync_BrowseButtonTemplate" id="6">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton5" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton7" inherits="ISync_BrowseButtonTemplate" id="7">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton6" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton8" inherits="ISync_BrowseButtonTemplate" id="8">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton7" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton9" inherits="ISync_BrowseButtonTemplate" id="9">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton8" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton10" inherits="ISync_BrowseButtonTemplate" id="10">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton9" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton11" inherits="ISync_BrowseButtonTemplate" id="11">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton10" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton12" inherits="ISync_BrowseButtonTemplate" id="12">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton11" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton13" inherits="ISync_BrowseButtonTemplate" id="13">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton12" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton14" inherits="ISync_BrowseButtonTemplate" id="14">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton13" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<Button name="ISync_BrowseButton15" inherits="ISync_BrowseButtonTemplate" id="15">
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BrowseButton14" relativePoint="BOTTOMLEFT">
								<Offset>
									<AbsDimension x="0" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
					</Button>
					<ScrollFrame name="ISync_IC_ScrollFrame" inherits="FauxScrollFrameTemplate">
						<Size>
							<AbsDimension x="296" y="354"/>
						</Size>
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="ISync_BV_Frame">
								<Offset>
									<AbsDimension x="80" y="-65"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture name="$parentScrollBarTop">
									<Size>
										<AbsDimension x="31" y="256"/>
									</Size>
									<Anchors>
										<Anchor point="TOP" relativeTo="$parentScrollBarScrollUpButton">
											<Offset>
												<AbsDimension x="0" y="5"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
								</Texture>
								<Texture>
									<Size>
										<AbsDimension x="31" y="106"/>
									</Size>
									<Anchors>
										<Anchor point="BOTTOM" relativeTo="$parentScrollBarScrollDownButton">
											<Offset>
												<AbsDimension x="0" y="-2"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnVerticalScroll>
								FauxScrollFrame_OnVerticalScroll(16, ISync.BV_UpdateScrollFrame);
							</OnVerticalScroll>
						</Scripts>
					</ScrollFrame>
			</Frames>
			<Scripts>
				<OnShow>
					ISync_CHK_StackedButton:SetChecked(ISync:SetVar({"BAGVIEW","SHOWSTACKED"}, 1));
					ISync_CHK_NillValuesButton:SetChecked(ISync:SetVar({"BAGVIEW","SHOWNIL"}, 1));
					ISync_CHK_SortValue:SetChecked(ISync:SetVar({"BAGVIEW","SORT_VALUE"}, 1));
					ISync_CHK_SortRarity:SetChecked(ISync:SetVar({"BAGVIEW","SORT_RARITY"}, 0));
					ISync:BV_Refresh();
					PlaySound("igBackPackOpen");
				</OnShow>
				<OnLoad> 
					ISync:BV_Load();
				</OnLoad> 
				<OnHide>
					PlaySound("igBackPackClose");
					ISync:BV_Unload();
				</OnHide>
		     		<OnMouseDown> this:StartMoving();  </OnMouseDown>
		      		<OnMouseUp>  this:StopMovingOrSizing(); </OnMouseUp>
		      		<OnDragStop> this:StopMovingOrSizing(); </OnDragStop>
			</Scripts>
	</Frame>
	
</Ui>
