{% block ajax_data_content %}
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
        $("input[type=button]").button();

        $('a.jqprint').unbind('click').bind('click', function(){
            $(this).closest('.report-table').jqprint();

         return( false );
        });

        /*$(document).ready(function(){
            //set slider position
            if(!jQuery.support.boxModel)
            {
        $(".horizontal-scroller:visible").css("position", "absolute");
            }
            else
            {
                $(".horizontal-scroller:visible").css("position", "fixed");
            }
        });*/

    </script>

    {% if is_infouser %}
        <script type="text/javascript">
            $('#dialog .bound').each( function () {
                  var riid = $(this).html();
                var new_a = $(this).html('<img style="float:right;margin-right:5px;" src="/assets/report/images/loupe2.png" />');
                $(this).before(riid);
                $(this).attr('rel', '{{ path('report_infomations_document') }}').cluetip({
                    width: 600,
                    ajaxCache: true,
                    arrows: true,
                    ajaxSettings : {
                        type : 'POST',
                          dataType: 'json',
                          data : ({
                            rid : riid,
                            sbasid : '{{ app['request'].get('sbasid') }}',
                            collection : '{{ app['request'].get('collection') }}',
                            dmin : '{{ app['request'].get('dmin') }}',
                            dmax : '{{ app['request'].get('dmax') }}',
                            from : 'TOOL'
                        })
                    },
                    ajaxProcess : function (data) {
                      return data.rs;
                    }
              });
            });
       </script>
    {% endif %}

    {% if is_plot %}
        <script type="text/javascript">
                $("table:visible:first thead tr").prepend("<th>{{ 'report::Heures' | trans }}</th>");
                $("table:visible:first tbody tr:first").prepend("<th>{{ 'report:: Connexion' | trans }}</th>");
                $colspan = $("table:visible:first tfoot tr:first td").attr("colspan");
                $colspan++;
                $("table:visible:first tfoot tr:first td").attr("colspan", $colspan);
         </script>
    {% endif %}

    {% if is_nav %}
        {% for key, result in result %}
        {% set index = key %}
            <div class="graph">
                {% include "report/generate_tab.html.twig" %}
                <table class="navi">
                    <caption></caption>
                    <thead>
                        <th></th>
                    {% if result.legend|length > 1 %}
                        {% for key, value in result.legend %}
                            <th>{{ value }}</th>
                        {% endfor %}
                    {% endif %}
                    </thead>
                    <tbody>
                        <tr>
                        <th></th>
                        {% if result.value|length > 1 %}
                            {% for key, value in result.value %}
                                <td>{{ value }}</td>
                            {% endfor %}
                        {% endif %}
                        </tr>
                    </tbody>
                </table>
            </div>
        {% endfor %}
    {% elseif is_plot %}
        {% include "report/generate_tab.html.twig" %}
            <table class="tblsite" style="visibility:hidden;">
                <caption></caption>
                <thead>
                    <th></th>
                {% if result.legend|length > 1 %}
                    {% for key, value in result.legend %}
                        <th>{{ value }}</th>
                    {% endfor %}
                {% endif %}
                </thead>
                <tbody>
                    <tr>
                    <th>{{ "report:: Connexion" | trans }}</th>
                    {% if result.result.0|length > 1 %}
                        {% for key, value in result.result.0 %}
                            <td>{{ value }}</td>
                        {% endfor %}
                    {% endif %}
                    </tr>
                </tbody>
            </table>
        <script type="text/javascript">

        </script>
    {% else %}
            {% include "report/generate_tab.html.twig" %}
    {% endif %}
{% endblock %}

