{% extends '_templates/base.twig' %}

{% block head %}
    <meta name="cs:page" content="home">
{% endblock %}

{% block title %}
    {{ page.page_title }}
{% endblock %}

{% block style %}
{% endblock %}

{% block content %}
    {% include '_templates/includes/header.twig' %}

    <section class="main home">
        {% include 'home/submenu.twig' %}

        {% include '_templates/includes/preloader.twig' %}

        <div data-b2c-content style="display: none">

            {% include 'home/home.twig' %}
        </div>
    </section>

    {% include '_templates/includes/footer.twig' %}

{% endblock %}

{% block scripts %}
    <script type="text/javascript">
        /* <![CDATA[ */
        var motorBusca = new MotorBusca(CHAVE_MOTOR, motorConfig);

        {% if motores().hospedagem.stAtivo %}
        motorBusca.motorHotel('.pnlMotor.hotel');
        {% endif %}

        {% if motores().aereo.stAtivo %}
        motorBusca.motorAereo('.pnlMotor.aereo');
        {% endif %}

        {% if motores().pacoteAereo.stAtivo %}
        motorBusca.motorPacoteAereo('.pnlMotor.pacoteAereo', null, false);
        {% endif %}

        {% if motores().pacoteHotel.stAtivo %}
        motorBusca.motorPacoteHotel('.pnlMotor.pacoteHotel');
        {% endif %}

        {% if motores().pacoteDinamico.stAtivo %}
        motorBusca.motorPacoteDinamico('.pnlMotor.pacoteDinamico', null, false);
        {% endif %}

        {% if motores().pacoteRodoHotel.stAtivo %}
        motorBusca.motorRodoHotel('.pnlMotor.rodoHotel');
        {% endif %}

        {% if motores().pacoteRodoServico.stAtivo %}
        motorBusca.motorRodoServico('.pnlMotor.rodoServico');
        {% endif %}

        {% if motores().servico.stAtivo %}
        motorBusca.motorServico('.pnlMotor.servico');
        {% endif %}
        /*]]>*/
    </script>

    <script>
        (function () {

            $('.submenu').on('click', 'li', function (e) {
                e.preventDefault();
                var el = $(this);

                el.closest('ul').find('li').removeClass('active');
                el.addClass('active');

                $('.pnlMotor').removeClass('show');
                var ref = el.find('a').attr('ref');

                $(ref).addClass('show');
            });

            $('.pnlMotor').eq(0).addClass('show');
            $('.submenu li').eq(0).addClass('active');

            B2C.home.init();
        })();
    </script>
{% endblock %}