var Wick = Wick || {};
Wick.Finance = (function(){
    var $terms = $('.terms');


    function toggleContent () {
        var thisItem = $(this).parent('.terms');

        if (thisItem.hasClass('terms_expanded')) {
            thisItem.removeClass('terms_expanded').find('.terms__btn-toggle').text('Show more');
        } else {
            thisItem.addClass('terms_expanded').find('.terms__btn-toggle').text('Show less');
        }
        return false;
    }

    function bindEvents () {
        $terms.on('click', '.terms__btn-toggle, .terms__btn-accordion', toggleContent);
    }

    if ($terms.length) {
        bindEvents();
    }
})();
