<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:include href="include.xsl" />
    <xsl:template match="/root">
        <html lang="ru">
            <head>
                <title>
                    <xsl:value-of select="$domain" /> ::
                    <xsl:value-of select="$slogan_ru" />
                </title>
                <meta charset="UTF-8"/>
                <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
                <meta content="text/html; charset=utf-8" http-equiv="Content-type"/>
                <meta name="robots" content="INDEX,FOLLOW"/>
                <meta name="zen-verification"
                      content="iJPmmxXlF90pWT2kSvlOGdg0aRLgyGgFv97HotfCksTnFoqT9pn6hgvoxwGbH60K" />
                <link rel="shortcut icon" href="{$favicon}" type="image/x-icon"/>
                <link rel="stylesheet" href="x/xstyle/resources/default.css"/>
                <link rel="stylesheet" href="x/xstyle/resources/style.css"/>
                <link rel="stylesheet" href="x/xstyle/resources/slider.css"/>
            </head>
            <body>
                <div id="header">
                    <xsl:for-each select="$header_ru">
                        <span>
                            <a href="{@href}">
                                <xsl:value-of select="." />
                            </a>
                        </span>
                    </xsl:for-each>
                </div>
                <div id="map">
                    <span><h2>Карта сайта</h2></span>
                    <br />
                    <xsl:for-each select="$map">
                        <xsl:variable name="outer-id" select="./id" />
                        <xsl:variable name="title" select="./description/annotation/ru" />
                        <h3>
                            <a href="#ru/{$outer-id}" title="{$title}">
                                <div class="menu_level1">
                                    <xsl:value-of select="./description/name/ru" />
                                </div>
                            </a>
                        </h3>
                        <xsl:for-each select="document(concat('xmap/', ./id, '/menu.xml'))/menu//item[@active='true']">
                            <h4>
                                <a href="#ru/{$outer-id}/{./id}">
                                    <div class="menu_level2">
                                        <xsl:value-of select="./ru" />
                                    </div>
                                </a>
                            </h4>
                        </xsl:for-each>
                    </xsl:for-each>
                </div>
                <p class="page_break"> </p>
                <div id="content">
                    <xsl:for-each select="$map">
                        <xsl:variable name="outer-id" select="./id" />
                        <xsl:variable name="title" select="./description/annotation/ru" />
                        <a name="ru/{$outer-id}"> </a>
                        <h2>
                            <a href="x/xmap/{$outer-id}/index.html" title="Список файлов раздела x/xmap/{$outer-id}/">
                                <div class="menu_level1">
                                    <xsl:value-of select="./description/name/ru" />
                                </div>
                            </a>
                        </h2>
                        <xsl:for-each select="document(concat('xmap/', ./id, '/menu.xml'))/menu//item[@active='true']">
                            <a name="ru/{$outer-id}/{./id}" />
                            <h3>
                                <a href="x/xmap/{$outer-id}/{./id}/index.html" title="Список файлов раздела x/xmap/{$outer-id}/{./id}/">
                                    <div class="menu_level2">
                                        <xsl:value-of select="./ru" />
                                    </div>
                                </a>
                            </h3>
                            <xsl:copy-of select="document(
                                        concat('xmap/', $outer-id, '/', ./id, '/content.xml'))/content/ru/*" />
                            <xsl:if test="$outer-id='catalog'">
                                <xsl:variable name="slider" select="document(
                                            concat('xmap/', $outer-id, '/',
                                            ./id, '/slider.xml'))/slider/ru//item[@active='true']" />
                                <xsl:if test="$slider">
                                    <div class="wrapper">
                                        <div class="slider">
                                            <xsl:for-each select="$slider">
                                                <a href="{./href}" title="{./title}" target="blank">
                                                    <img class="slides" src="{./src}" />
                                                </a>
                                            </xsl:for-each>
                                        </div>
                                    </div>
                                </xsl:if>
                            </xsl:if>
                        </xsl:for-each>
                        <p class="page_break"> </p>
                    </xsl:for-each>
                </div>
                <div id="footer">
                    <xsl:value-of select="$footer" />
                </div>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>