jQuery(function()
{
    'use strict';

    var page = jQuery(document);

    // toggle financial statement section
    page.on('contentloaded', function(event)
    {
        var block = jQuery(event.target);
        var section = block.find('section.statements');

        if (!section.length)
        {
            return;
        }

        var toggle = section.find('.toggle');

        toggle.click(function(event)
        {
            event.stopPropagation();

            var open = !section.is('.open');

            section.toggleClass('open', open);
        });

        toggle.closest('.heading').click(function(event)
        {
            toggle.click();
        });
    });
});
