;
(function($) {
    'use strict';

    $(document).ready(function() {
        fancyfilter_masonry_grid_layout();


    });

    /*-------------------------------------------
         Masonry Filter
   --------------------------------------------*/
    function fancyfilter_masonry_grid_layout() {
        var grid_layout = $('.grid-init');

        $.each(grid_layout, function(index, value) {
            var el = $(this);
            var parentClass = $(this).parent().attr('class');
            var $selector = $('#' + el.attr('id'));
                var fancyfilterMasonry = $($selector).isotope({
                    itemSelector: '.grid-item',
                    percentPosition: true,
                    masonry: {
                        columnWidth: 0,
                        gutter: 0
                    }
                });
                $(document).on('click', '.' + parentClass + ' .fancyfilter-filter-nav ul li', function() {
                    var filterValue = $(this).attr('data-filter');
                    fancyfilterMasonry.isotope({
                        filter: filterValue
                    });
                });
            
        });

    }

    /*----------------------------
         Active Button
    ----------------------------*/
    $(document).on('click', '.fancyfilter-filter-nav ul li', function() {
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
    });
	lightbox.option({
      'resizeDuration': 100,
      'wrapAround': true
    })

})(jQuery);