<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">
	
	<Button name="ISyncItemButtonTemplate" virtual="true">
			<Size>
				<AbsDimension x="300" y="16"/>
			</Size>
			<Scripts>
				<OnLoad>
					this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
				</OnLoad>
				<OnClick>
					if(ISync) then ISync:ButtonClick(arg1); end
				</OnClick>
				<OnEnter>
					if(ISync) then ISync:ButtonEnter(); end
					ISync_QuickSearch:ClearFocus();
				</OnEnter>
				<OnLeave>
					if(GameTooltip:IsVisible()) then GameTooltip:Hide(); end 
				</OnLeave>
			</Scripts>
			
			<NormalText name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
				<Size>
					<AbsDimension x="275" y="12"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="20" y="0"/>
						</Offset>
					</Anchor>
				</Anchors> 
			</NormalText>
		<Layers>
			<Layer level="ARTWORK">

				<Texture name="$parentSubItem" file="Interface\MoneyFrame\Arrow-Right-Down">
					<Size>
						<AbsDimension x="12" y="12"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="20" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
	</Button>
	
	
	<Button name="ISync_FavItemButtonTemplate" virtual="true">
		<Size>
			<AbsDimension x="300" y="16"/>
		</Size>
		<Scripts>
			<OnLoad>
				this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
			</OnLoad>
			<OnClick>
				ISync:Fav_ButtonClick(arg1);
			</OnClick>
			<OnEnter>
				ISync:Fav_ButtonEnter()
			</OnEnter>
			<OnLeave>
				if(GameTooltip:IsVisible()) then GameTooltip:Hide(); end 
			</OnLeave>
		</Scripts>

		<NormalText name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
			<Size>
				<AbsDimension x="275" y="12"/>
			</Size>
			<Anchors>
				<Anchor point="LEFT">
					<Offset>
						<AbsDimension x="20" y="0"/>
					</Offset>
				</Anchor>
			</Anchors> 
		</NormalText>
	</Button>
	
	
	<Frame name="ISync_FavRemItem_ButtonTemplate" virtual="true">
		<Size>
		    <AbsDimension x="90" y="16"/>
		</Size>
		<Frames>
		    <Button name="$parent_Blip">
			<Size>
			    <AbsDimension x="26" y="19"/>
			</Size>
			<Anchors>
			    <Anchor point="LEFT">
				<Offset>
				    <AbsDimension x="-13" y="0"/>
				</Offset>
			    </Anchor>
			</Anchors>
			<NormalTexture name="$parentTexture" file="Interface\Buttons\UI-MinusButton-Up.blp">
			    <Size>
				<AbsDimension x="17" y="17"/>
			    </Size>
			    <Anchors>
				<Anchor point="LEFT"/>
			    </Anchors>
			</NormalTexture>
			<PushedTextOffset>
			    <AbsDimension x="0" y="0"/>
			</PushedTextOffset>
			<Scripts>
				<OnLoad>
					this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
				</OnLoad>
				<OnEnter>
					if(this:GetParent().name and this:GetParent().quality) then
						GameTooltip:SetOwner(this, "ANCHOR_LEFT");
						GameTooltip:SetText(ISYNC_FAV_CLICKREMOVE_TOOLTIP.."\n".."|c"..ISync:ReturnHexColor(this:GetParent().quality)..this:GetParent().name.."|r", 1, 0.72, 0, nil, 1);
						GameTooltip:Show();
					end
				</OnEnter>
				<OnLeave>
					GameTooltip:Hide();						
				</OnLeave>
				<OnClick>
					if(this:GetParent().name and this:GetParent().quality) then
						ISync:FavRem_Click(this:GetParent());
					end
				</OnClick>
			</Scripts>
   						
   			</Button>
		</Frames>
	</Frame>
	
	
	<CheckButton name="ISync_TabTemplate" virtual="true" hidden="true">
		<Size>
			<AbsDimension x="32" y="32"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture file="Interface\SpellBook\SpellBook-SkillLineTab">
					<Size>
						<AbsDimension x="64" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-3" y="11"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnClick>
				if(ISync) then ISync:TabClick(); end
			</OnClick>
			<OnEnter>
				GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
				GameTooltip:SetText(this.tipinfo);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
		<NormalTexture/>
		<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
		<CheckedTexture file="Interface\Buttons\CheckButtonHilight" alphaMode="ADD"/>
	</CheckButton>
	
	
	<EditBox name="ISync_SearchBoxTemplate" letters="256" historyLines="0" virtual="true" autoFocus="false">
		<Size>
			<AbsDimension x="200" y="20"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentLeft" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
					<Size>
						<AbsDimension x="12" y="29"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-11" y="2"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="0.09375" top="0" bottom="1.0"/>
				</Texture>
				<Texture name="$parentMiddle" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
					<Size>
						<AbsDimension x="195" y="29"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
					</Anchors>
					<TexCoords left="0.09375" right="0.90625" top="0" bottom="1.0"/>
				</Texture>
				<Texture name="$parentRight" file="Interface\ClassTrainerFrame\UI-ClassTrainer-FilterBorder">
					<Size>
						<AbsDimension x="12" y="29"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
					</Anchors>
					<TexCoords left="0.90625" right="1.0" top="0" bottom="1.0"/>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnEscapePressed>
				this:ClearFocus()
			</OnEscapePressed>
			<OnEnterPressed>

				ISync:SF_Reset();
				ISYNC_SHOWSEARCH_CHK = 1;
				ISync:Main_Refresh();
				
			</OnEnterPressed>
			<OnClick>
				this:SetFocus();
			</OnClick>
			<OnLeave>this:SetFocus();</OnLeave>
			<OnEnter>this:SetFocus();</OnEnter>
		</Scripts>
		<FontString inherits="ChatFontNormal"/>
	</EditBox>
	
	
	<Frame name="ISync_GB_Template" virtual="true">
		<Size>
		    <AbsDimension x="90" y="16"/>
		</Size>
		<Frames>
		    <Button name="$parent_Blip">
			<Size>
			    <AbsDimension x="26" y="19"/>
			</Size>
			<Anchors>
			    <Anchor point="LEFT">
				<Offset>
				    <AbsDimension x="-13" y="0"/>
				</Offset>
			    </Anchor>
			</Anchors>
			<NormalTexture name="$parentTexture" file="Interface\AddOns\ItemSync\images\ISync_ItemID_ItemPic">
			    <Size>
				<AbsDimension x="17" y="17"/>
			    </Size>
			    <Anchors>
				<Anchor point="LEFT"/>
			    </Anchors>
			</NormalTexture>
			<PushedTextOffset>
			    <AbsDimension x="0" y="0"/>
			</PushedTextOffset>

			<Scripts>
				<OnLoad>
					this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
				</OnLoad>
				<OnEnter>
					GameTooltip:SetOwner(this, "ANCHOR_LEFT");
					GameTooltip:SetText(ISYNC_ITEMID_GREENBUTTON_WARNING2, 1, 0.72, 0, nil, 1);
					GameTooltip:Show();
				</OnEnter>
				<OnLeave>
					GameTooltip:Hide();						
				</OnLeave>
				<OnClick>
					if(ISync) then ISync:BlipClick(arg1); end
				</OnClick>
			</Scripts>
   						
   			</Button>
		</Frames>
	</Frame>
	
	<Frame name="ISyncFrame_MainTemplate" virtual="true" toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true">
			<Size>
				<AbsDimension x="360" y="495"/>
			</Size>
			<Anchors>
	 			<Anchor point="TOPLEFT">
	 				<Offset>
	 					<AbsDimension x="0" y="-104"/>
	 				</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">
					<FontString name="$parentInfo" inherits="GameFontNormalSmall" justifyH="LEFT">
						<Anchors>
							<Anchor point="TOP"> 
								<Offset>
									<AbsDimension x="80" y="-26"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					
				</Layer>
			</Layers>
			<Frames>
			
				<Frame name="$parentHeader_Box" inherits="OptionFrameBoxTemplate" enableMouse="true" >
					<Size>
						<AbsDimension x="335" y="30"/>
					</Size>
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER">
							<Offset>
								<AbsDimension x="0" y="255"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Layers>
						<Layer level="BACKGROUND">
							<FontString name="$parentText" inherits="GameFontNormal" text="">
								<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(162/255, 162/255, 217/255, 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="$parent_CloseButton" inherits="UIPanelCloseButton" toplevel="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentHeader_Box" relativePoint="RIGHT">
							<Offset>
								<AbsDimension x="-17" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Button>
			</Frames>
	
 
 			<Scripts>
		     		<OnMouseDown> this:StartMoving();  </OnMouseDown>
		      		<OnMouseUp>  this:StopMovingOrSizing(); </OnMouseUp>
		      		<OnDragStop> this:StopMovingOrSizing(); </OnDragStop>
 			</Scripts>
	
	</Frame>




	<Frame name="ISync_DBPopUp" toplevel="true" frameStrata="DIALOG" movable="false" enableMouse="true" hidden="true" parent="UIParent">
		<Size>
			<AbsDimension x="325" y="125"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent"/>
		</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="$parentHeaderTexture" file="Interface\DialogFrame\UI-DialogBox-Header">
					<Size>
						<AbsDimension x="256" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="TOP">
							<Offset>
								<AbsDimension x="0" y="12"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString name="$parentHeaderText" inherits="GameFontNormal" text="ISYNC_DBUPDATE">
					<Anchors>
						<Anchor point="TOP" relativeTo="$parentHeaderTexture">
							<Offset>
								<AbsDimension x="0" y="-14"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentInfo" justifyV="top" inherits="GameFontNormal">
					<Size>
						<AbsDimension x="350" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="TOP">
							<Offset>
								<AbsDimension x="0" y="-30"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Button name="$parentReadyButton" hidden="false" inherits="GameMenuButtonTemplate" text="Yes">
				<Size>
					<AbsDimension x="125" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="RIGHT" relativePoint="CENTER">
						<Offset>
							<AbsDimension x="-10" y="-20"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						if(ISync) then
							ISync:CleanupDB(1, nil);
							ISYNC_LOADYES = 1;
							ISync:SetVar({"ISYNC_VER","OLDVERSION"}, ISYNC_VERSION,"TRUE");
							DEFAULT_CHAT_FRAME:AddMessage("|c00A2D96FItemSync:|r |cffffffff"..ISYNC_OLDDBDELETED..".|r");
						end
							
						this:GetParent():Hide();
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentNotReadyButton" hidden="false" inherits="GameMenuButtonTemplate" text="No">
				<Size>
					<AbsDimension x="125" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativePoint="CENTER">
						<Offset>
							<AbsDimension x="10" y="-20"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ISYNC_LOADYES = 0;
						this:GetParent():Hide();
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnShow>
				PlaySound("UChatScrollButton");
				getglobal(this:GetName() .. "Info"):SetText(ISYNC_DBUPDATE_INFO);
			</OnShow>
			<OnHide>
				PlaySound("UChatScrollButton");
			</OnHide>
		</Scripts>
	</Frame>

	
</Ui>