<?xml version="1.0" ?>
<FinalTemplateCollection>
    <Template templateName="CheckboxExitConfirmationTemplate">
        <InOutMovingControl time="0.4">
            <position x="0" y="600" />
            <sound soundId="window_moving" />
            <namedPositions>
                <position x="0" y="0" name="in" />
                <position x="0" y="600" name="out" />
            </namedPositions>
            <path templateName="DialogPathTemplate" />
            <messageReceiver name="Exit panel mover" />
            <children>
                <StaticTextureControl>
                    <position x="253" y="160" />
                    <texture textureId="exit_panel" />
                    <children>
                        <KeyListeningControl>
                            <keys>
                                <key value="VK_RETURN" receiver="lua:MainMenuFunc" message="Exit confirmation dialog yes pressed" />
                                <key value="VK_ESCAPE" receiver="lua:MainMenuFunc" message="Exit confirmation dialog no pressed" />
                            </keys>
                        </KeyListeningControl>
                        <StaticTextControl valign="true">
                            <position x="147" y="120" />
                            <div fontName="White_Brown_16" resourceName="AreYouSureYouWantToExit" />
                        </StaticTextControl>
                        <CheckBoxControl>
                            <position x="45" y="55" />
                            <textures uncheckedNormalId="ExitCBnormal_unchecked" uncheckedActiveId="ExitCBactive_unchecked" checkedNormalId="ExitCBnormal_checked" checkedActiveId="ExitCBactive_checked" />
                            <variable name="isScreensaverEnabled" mode="global" defaultValue="false" />
                        </CheckBoxControl>
                        <MessageButtonControl>
                            <position x="32" y="-25" />
                            <textures normalId="yes_normal" activeId="yes_active" pressedId="yes_pressed" />
                            <message value="Exit confirmation dialog yes pressed" receiver="post:lua:MainMenuFunc" />
                        </MessageButtonControl>
                        <MessageButtonControl>
                            <position x="172" y="-25" />
                            <textures normalId="no_normal" activeId="no_active" pressedId="no_pressed" />
                            <message value="Exit confirmation dialog no pressed" receiver="lua:MainMenuFunc" />
                        </MessageButtonControl>
                    </children>
                </StaticTextureControl>
            </children>
        </InOutMovingControl>
    </Template>
    <Template templateName="PlayersDialogLinksTemplate">
        <StaticTextControl>
            <position x="160" y="34" />
            <div fontName="Orange_15">
                <line>{link normalFontName=&quot;Orange_15&quot; activeFontName=&quot;Orange_15&quot; receiver=&quot;lua:MainMenuFunc&quot; message=&quot;Change player link pressed&quot; activeSound=&quot;text_button_active&quot; pressedSound=&quot;text_button_pressed&quot;}textResource:WelcomePlayer{/link}</line>
            </div>
            <div fontName="White_12">
                <line>{link normalFontName=&quot;White_12&quot; activeFontName=&quot;White_14&quot; receiver=&quot;lua:MainMenuFunc&quot; message=&quot;Change player link pressed&quot; activeSound=&quot;text_button_active&quot; pressedSound=&quot;text_button_pressed&quot;}textResource:ClickHereToChangePlayer{/link}</line>
            </div>
        </StaticTextControl>
    </Template>
    <Template templateName="MoreGamesButtonTemplate">
        <FixedChildrenListControl>
            <StaticTextureControl>
                <texture textureId="more_games_panel" />
            </StaticTextureControl>
            <MessageButtonControl>
                <position x="24" y="7" />
                <textures normalId="more_games_normal" activeId="more_games_active" pressedId="more_games_pressed" />
                <message receiver="lua:MainMenuFunc" value="Main menu more games button pressed" />
            </MessageButtonControl>
        </FixedChildrenListControl>
    </Template>
    <Template templateName="ActiveButtonsTemplate">
        <FixedChildrenListControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="FishdomTextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="76" y="350" />
                        <show delay="0.1" speed="2.0" />
                        <textures normalId="more_games_fishdom" activeId="more_games_fishdom" pressedId="more_games_fishdom" />
                        <message receiver="post:LinkWatcher" value="Fishdom" />
                        <variable name="temp:Advertsement" onOverValue="1" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="Fishdom2TextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="300" y="350" />
                        <show delay="0.2" speed="2.0" />
                        <textures normalId="more_games_fishdom2" activeId="more_games_fishdom2" pressedId="more_games_fishdom2" />
                        <message receiver="post:LinkWatcher" value="Fishdom2" />
                        <variable name="temp:Advertsement" onOverValue="2" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="FishdomH2OTextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="519" y="350" />
                        <show delay="0.3" speed="2.0" />
                        <textures normalId="more_games_h2o" activeId="more_games_h2o" pressedId="more_games_h2o" />
                        <message receiver="post:LinkWatcher" value="Fishdom H2O" />
                        <variable name="temp:Advertsement" onOverValue="3" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="GardenscapesTextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="76" y="165" />
                        <show delay="0.2" speed="2.0" />
                        <textures normalId="more_games_gardenscapes" activeId="more_games_gardenscapes" pressedId="more_games_gardenscapes" />
                        <message receiver="post:LinkWatcher" value="Gardenscapes" />
                        <variable name="temp:Advertsement" onOverValue="4" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="RoyalEnvoyTextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="300" y="165" />
                        <show delay="0.3" speed="2.0" />
                        <textures normalId="more_games_royalenvoy" activeId="more_games_royalenvoy" pressedId="more_games_royalenvoy" />
                        <message receiver="post:LinkWatcher" value="RoyalEnvoy" />
                        <variable name="temp:Advertsement" onOverValue="5" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="CoATextTemplate" />
                <controlToMonitor>
                    <ButtonWithEffectControl>
                        <position x="519" y="165" />
                        <show delay="0.4" speed="2.0" />
                        <textures normalId="more_games_coa" activeId="more_games_coa" pressedId="more_games_coa" />
                        <message receiver="post:LinkWatcher" value="CoA" />
                        <variable name="temp:Advertsement" onOverValue="6" />
                    </ButtonWithEffectControl>
                </controlToMonitor>
            </ContextHelpClientControl>
        </FixedChildrenListControl>
    </Template>
    <Template templateName="InactiveButtonsTemplate">
        <FixedChildrenListControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="FishdomTextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="76" y="350" />
                        <texture textureId="more_games_fishdom" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="Fishdom2TextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="300" y="350" />
                        <texture textureId="more_games_fishdom2" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="FishdomH2OTextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="519" y="350" />
                        <texture textureId="more_games_h2o" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="GardenscapesTextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="76" y="165" />
                        <texture textureId="more_games_gardenscapes" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="RoyalEnvoyTextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="300" y="165" />
                        <texture textureId="more_games_royalenvoy" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
            <ContextHelpClientControl>
                <times initial="0.1" reshow="0.0" />
                <toolTipToShow name="CoATextTemplate" />
                <controlToMonitor>
                    <StaticTextureControl>
                        <position x="519" y="165" />
                        <texture textureId="more_games_coa" />
                    </StaticTextureControl>
                </controlToMonitor>
            </ContextHelpClientControl>
        </FixedChildrenListControl>
    </Template>
    <Template templateName="TryMoreGamesButtonTemplate">
        <ContextHelpClientControl>
            <times initial="0.1" reshow="0.0" />
            <toolTipToShow name="PlayOnTemplate" />
            <controlToMonitor>
                <MessageButtonControl>
                    <position x="265" y="15" />
                    <textures normalId="try_more_normal" activeId="try_more_active" pressedId="try_more_pressed" />
                    <message receiver="post:LinkWatcher" value="More games button" />
                </MessageButtonControl>
            </controlToMonitor>
        </ContextHelpClientControl>
    </Template>
    <Template templateName="TryMoreGamesPictureTemplate">
        <StaticTextureControl>
            <position x="265" y="15" />
            <texture textureId="try_more_normal" />
        </StaticTextureControl>
    </Template>
    <Template templateName="TryMoreGamesNoneTemplate">
        <FixedChildrenListControl />
    </Template>
    <Template templateName="MoreGamesTemplate">
        <ContextHelpServerControl>
            <children>
                <ZGlassControl />
                <KeyListeningControl>
                    <keys>
                        <key value="VK_ESCAPE" receiver="lua:MainMenuFunc" message="More games exit" />
                    </keys>
                </KeyListeningControl>
                <LinkWatcherControl links="../screenbranding/advertisement/links.xml">
                    <messageReceiver name="LinkWatcher" />
                </LinkWatcherControl>
                <StretchBackgroundControl>
                    <texture id="more_games_background" />
                    <messageReceiver name="More games backgroung" />
                </StretchBackgroundControl>
                <VariableDrivenSwitchControl>
                    <variable name="temp:advertisement" type="bool" scope="global" defaultValue="false" />
                    <states>
                        <state default="true" templateName="ActiveButtonsTemplate" />
                        <state variableValue="false" templateName="InactiveButtonsTemplate" />
                    </states>
                </VariableDrivenSwitchControl>
                <StaticTextureControl>
                    <position x="173" y="548" />
                    <texture textureId="more_games_title_panel" />
                </StaticTextureControl>
                <VariableDrivenSwitchControl>
                    <variable name="temp:tryMoreGames" type="string" scope="global" defaultValue="button" />
                    <states>
                        <state variableValue="button" templateName="TryMoreGamesButtonTemplate" />
                        <state variableValue="picture" templateName="TryMoreGamesPictureTemplate" />
                        <state variableValue="none" templateName="TryMoreGamesNoneTemplate" />
                    </states>
                </VariableDrivenSwitchControl>
                <StaticTextureControl>
                    <position x="160" y="15" />
                    <texture textureId="more_games_starfish" />
                </StaticTextureControl>
                <StaticTextureControl>
                    <position x="510" y="0" />
                    <texture textureId="more_games_dragon" />
                </StaticTextureControl>
                <InOutMovingControl time="0.4">
                    <position x="0" y="-60" />
                    <namedPositions>
                        <position x="0" y="1" name="in" />
                        <position x="0" y="-60" name="out" />
                    </namedPositions>
                    <path templateName="QuadraticPathTemplate" />
                    <messageReceiver name="More games done panel mover" />
                    <children>
                        <StaticTextureControl>
                            <texture textureId="more_games_back_panel" />
                            <children>
                                <MessageButtonControl>
                                    <position x="2" y="2" />
                                    <textures normalId="more_games_back_normal" activeId="more_games_back_active" pressedId="more_games_back_pressed" />
                                    <message receiver="lua:MainMenuFunc" value="More games exit" />
                                </MessageButtonControl>
                            </children>
                        </StaticTextureControl>
                    </children>
                </InOutMovingControl>
            </children>
        </ContextHelpServerControl>
    </Template>
    <Template templateName="MainMenuTemplate">
        <ContextHelpServerControl>
            <children>
                <MutableChildrenListControl>
                    <messageReceiver name="Current tank content" />
                </MutableChildrenListControl>
                <ZGlassControl />
                <AlphaChangeControl start="1.0">
                    <speed value="0.0" />
                    <messageReceiver name="Main menu alpha changer" />
                    <children>
                        <InOutMovingControl time="0.5">
                            <position x="800" y="558" />
                            <namedPositions>
                                <position x="569" y="558" name="in" />
                                <position x="800" y="558" name="out" />
                            </namedPositions>
                            <path templateName="QuadraticPathTemplate" />
                            <messageReceiver name="More games panel mover" />
                            <children>
                                <VariableDrivenSwitchControl>
                                    <variable name="temp:adVisible" type="bool" scope="global" defaultValue="false" />
                                    <states>
                                        <state default="true" templateName="EmptyTemplate" />
                                        <state variableValue="true" templateName="MoreGamesButtonTemplate" />
                                    </states>
                                </VariableDrivenSwitchControl>
                            </children>
                        </InOutMovingControl>
                        <InOutMovingControl time="0.5">
                            <position x="0" y="-130" />
                            <namedPositions>
                                <position x="0" y="0" name="in" />
                                <position x="0" y="-130" name="out" />
                            </namedPositions>
                            <path templateName="BluePanelPathTemplate" />
                            <messageReceiver name="Main menu blue panel mover" />
                            <children>
                                <StaticTextureControl>
                                    <position x="121" y="0" />
                                    <texture textureId="main_menu_blue_bar" />
                                    <children>
                                        <RectangleFrameControl width="295" height="36">
                                            <position x="10" y="0" />
                                            <children>
                                                <BubblesBackGround>
                                                    <position x="20" y="-30" />
                                                    <description textureId="bubble_blue" emitters="10" width="265" height="100" minPause="3.0" maxPause="6.0" minSpeed="20.0" maxSpeed="60.0" amplitude="5.0" period="10.0" blendMode="alpha" />
                                                    <scale>
                                                        <range min="0.00" max="0.00" />
                                                        <range min="0.05" max="0.10" />
                                                        <range min="0.10" max="0.15" />
                                                        <range min="0.15" max="0.20" />
                                                        <range min="0.10" max="0.15" />
                                                        <range min="0.05" max="0.10" />
                                                        <range min="0.00" max="0.00" />
                                                    </scale>
                                                </BubblesBackGround>
                                            </children>
                                        </RectangleFrameControl>
                                        <TemplateInstanceControl>
                                            <base templateName="PlayersDialogLinksTemplate" />
                                        </TemplateInstanceControl>
                                    </children>
                                </StaticTextureControl>
                            </children>
                        </InOutMovingControl>
                        <InOutMovingControl time="0.5">
                            <position x="0" y="-130" />
                            <namedPositions>
                                <position x="0" y="0" name="in" />
                                <position x="0" y="-130" name="out" />
                            </namedPositions>
                            <path templateName="MainPanelPathTemplate" />
                            <messageReceiver name="Main menu bottom panel mover" />
                            <children>
                                <StaticTextureControl>
                                    <position x="0" y="0" />
                                    <texture textureId="main_screen_bottom_panel" />
                                    <children>
                                        <ContextHelpClientControl>
                                            <position x="0" y="0" />
                                            <times initial="0.1" reshow="0.0" />
                                            <toolTipToShow name="MainMenuExitButton" />
                                            <controlToMonitor>
                                                <MessageButtonControl>
                                                    <position x="20" y="10" />
                                                    <textures normalId="exit_normal" activeId="exit_active" pressedId="exit_pressed" />
                                                    <message value="Main menu exit button pressed" receiver="lua:MainMenuFunc" />
                                                </MessageButtonControl>
                                            </controlToMonitor>
                                        </ContextHelpClientControl>
                                        <ContextHelpClientControl>
                                            <position x="0" y="0" />
                                            <times initial="0.1" reshow="0.0" />
                                            <toolTipToShow name="MainMenuScreensaverButton" />
                                            <controlToMonitor>
                                                <MessageButtonControl>
                                                    <position x="458" y="10" />
                                                    <textures normalId="screensaver_normal" activeId="screensaver_active" pressedId="screensaver_pressed" />
                                                    <message value="Main menu screensaver button pressed" receiver="lua:MainMenuFunc" />
                                                </MessageButtonControl>
                                            </controlToMonitor>
                                        </ContextHelpClientControl>
                                        <ContextHelpClientControl>
                                            <position x="0" y="0" />
                                            <times initial="0.1" reshow="0.0" />
                                            <toolTipToShow name="MainMenuOptionsButton" />
                                            <controlToMonitor>
                                                <MessageButtonControl>
                                                    <position x="562" y="10" />
                                                    <textures normalId="options_normal" activeId="options_active" pressedId="options_pressed" />
                                                    <message value="Main menu options button pressed" receiver="lua:MainMenuFunc" />
                                                </MessageButtonControl>
                                            </controlToMonitor>
                                        </ContextHelpClientControl>
                                        <ContextHelpClientControl>
                                            <position x="0" y="0" />
                                            <times initial="0.1" reshow="0.0" />
                                            <toolTipToShow name="MainMenuStartButton" />
                                            <controlToMonitor>
                                                <MessageButtonControl>
                                                    <position x="665" y="12" />
                                                    <textures normalId="start_normal" activeId="start_active" pressedId="start_pressed" />
                                                    <message value="Main menu start button pressed" receiver="lua:MainMenuFunc" />
                                                </MessageButtonControl>
                                            </controlToMonitor>
                                        </ContextHelpClientControl>
                                        <KeyListeningControl>
                                            <position x="0" y="0" />
                                            <keys>
                                                <key value="VK_RETURN" receiver="lua:MainMenuFunc" message="Main menu start button pressed" />
                                                <key value="VK_ESCAPE" receiver="lua:MainMenuFunc" message="Main menu exit button pressed" />
                                            </keys>
                                        </KeyListeningControl>
                                        <IfControl variable="global:temp:dev">
                                            <children>
                                                <KeyListeningControl>
                                                    <keys>
                                                        <key value="VK_F8" receiver="post:lua:GameFunc" message="Start intro key pressed" />
                                                    </keys>
                                                </KeyListeningControl>
                                            </children>
                                        </IfControl>
                                    </children>
                                </StaticTextureControl>
                            </children>
                        </InOutMovingControl>
                        <AlphaChangeControl start="1.0">
                            <position x="0" y="0" />
                            <speed value="2.0" />
                            <messageReceiver name="Main menu modal dialog alpha changer" />
                            <children>
                                <ModalDialogControl>
                                    <messageReceiver name="Main menu modal dialog" />
                                    <times starting="0.3" hiding="0.3" />
                                </ModalDialogControl>
                            </children>
                        </AlphaChangeControl>
                    </children>
                </AlphaChangeControl>
                <BorderControl width="800" height="600">
                    <texture textureId="border" />
                </BorderControl>
            </children>
        </ContextHelpServerControl>
    </Template>
    <Template templateName="MainMenuTankTemplate">
        <LongLifeParentControl>
            <storage receiverName="TankContentStorage" />
        </LongLifeParentControl>
    </Template>
</FinalTemplateCollection>
