+function ($) {
	'use strict';

	var isTouch = 'ontouchstart' in document.documentElement;

	$('.carousel img.lazyload').each(function() {
		lazySizes.loader.unveil(this);
	});
	$('.frame-layout-1 .ce-gallery img.lazyload').each(function() {
		lazySizes.loader.unveil(this);
	});
	// var grid = $('.frame-layout-1 .ce-gallery');
	$(document).ready(function() {
		var grid = $('.isotope');
	    grid.isotope({
	        itemSelector: '.item',
	        layoutMode: 'packery',
	        resizesContainer: true,
	    });

	    grid.on('click', '.item', function() {
		    var activeItem = $(".gigante");
		    var newActiveItem = $(this);
		    if(!newActiveItem.hasClass('gigante')){
		        activeItem.removeClass('gigante');
		        newActiveItem.addClass('gigante');
		    }
			grid.isotope('layout');
	    });
	});


	$(window).on('load', function() {
		var grid = $('.isotope');
		grid.isotope({
	        itemSelector: '.item',
	        layoutMode: 'packery',
	        resizesContainer: true,
	    });
	});


}(jQuery);
