$(document).ready(function(){
	$('a[href*="#"].jquery-pag').click(function() {
	
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		&& location.hostname == this.hostname) {
		
			var $target = $(this.hash);
			
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			
			if ($target.length) {
			
				var targetOffset = $target.offset().top;
				
				$('html,body').animate({scrollTop: targetOffset}, 1000);
				
				return false;
		
			}
		
		}
	
	});
	
	// tabs de servicios
	$('#serviciosTab a').click(function(){
		$('#serviciosList a').removeClass('active');
		$('#serviciosList a[href="'+$(this).attr('href')+'"]').addClass('active');
	});
	$('#serviciosList a').click(function(){
		$('#serviciosTab a').removeClass('active');
		$('#serviciosTab a[href="'+$(this).attr('href')+'"]').addClass('active');
	});
	
	var grid = $('.grid');
	grid.isotope({
		// options
		itemSelector: '.grid-item',
		layoutMode: 'masonry'
	});
	
	$('.grid-filter button').click(function(){
		var elFiltro = $(this).attr('data-filter');
		grid.isotope({
			filter:elFiltro
		});
	});
	
	setTimeout(function(){
		grid.isotope({
			filter:'*'
		});
	},600);
		
	
	$('body > div:last-of-type').addClass('banner-oculto');
	
	$('#menu_principal .nav-link, main').click(function(){
		$('#menu_principal').removeClass('show');
	});
	$(window).scroll(function(){
		$('#menu_principal').removeClass('show');
	});

}); // document ready






