(function( $ ) {
	'use strict';
    
    $(document).ready(function() {

        $('.tod-accordion').each(function(){
            const accordionTitle =  $(this).find('.accordion-title').first();
            const accordionContent = $(this).find('.accordion-content').first();

            const parent = $(this);
            accordionTitle.click(function(){
                parent.toggleClass('closed');
                if(parent.hasClass('closed')){
                    accordionContent.slideUp(200);
                }else{
                    accordionContent.slideDown(200);
                }
            });
        });

    });

})( jQuery );