{style}
    #admin-finance-statistics-header #finance-statistics-menu {
        float:right;
    }

    #admin-finance-statistics-container .ow_ajaxloader_preloader {
        min-height:300px;
    }

    #admin-finance-history {
        float:right;
    }
{/style}

{script}
    var defaultPeriod = "{$defaultPeriod}";

    $("#finance-statistics-menu a").on("click", function(){
        defaultPeriod = $(this).attr("id");
        defaultPeriod = defaultPeriod.replace("finance_menu_statistics_", "");

        reloadChart();
    });

    /**
     * Reload chart
     *
     * @return void
     */
    function reloadChart()
    {
        if (!defaultPeriod)
        {
            return;
        }

        OW.loadComponent("ADMIN_CMP_FinanceStatistic", [{ "defaultPeriod" : defaultPeriod }], "#admin-finance-statistics-container");
    }
{/script}

<div id="admin-finance-statistics-header">
    <div id="finance-statistics-menu">
        {$menu}
    </div>
    <div class="clearfix"></div>
</div>

<div id="admin-finance-statistics-container">
    {$statistics}
</div>

<div id="admin-finance-history">
    {decorator name="button_list_item" langLabel="admin+statistics_history" onclick="location.href='{url_for_route for='admin_finance'}'"}
</div>
<div class="clearfix"></div>
