(function($) {
	"use strict";

	jQuery(document).ready(function($) {

		//Wow js
		new WOW().init();

		//carousel active
		$(".carousel-inner .item:first-child").addClass("active");
		//Fixed nav on scroll
		$(document).scroll(function(e) {
			var scrollTop = $(document).scrollTop();
			if (scrollTop > $('.navbar').height()) {
				//console.log(scrollTop);
				$('.navbar').addClass('navbar-fixed-top');
			} else {
				$('.navbar').removeClass('navbar-fixed-top');
			}
		});

		//Portfolio Popup
		$('.magnific-popup').magnificPopup({
			type: 'image'
		});

		//TESTIMONIALS SLIDER
		$(".testimonial_slider").owlCarousel({
			navigation : false,
			items: 2,
			autoPlay: true,
			pagination: false,
		});
	});

	jQuery(window).on('load', function() {

		//Portfolio container
		var $container = $('.portfolioContainer');
		$container.isotope({
			filter: '*',
			animationOptions: {
				duration: 750,
				easing: 'linear',
				queue: false
			}
		});

		$('.portfolioFilter a').on('click', function() {
			$('.portfolioFilter a').removeClass('current');
			$(this).addClass('current');
			var selector = $(this).attr('data-filter');
			$container.isotope({
				filter: selector,
				animationOptions: {
					duration: 750,
					easing: 'linear',
					queue: false
				}
			});
			return false;
		});
	});
})(jQuery);