text: /* JS Document */
  
  /******************************
  
  [Table of Contents]
  
  1. Vars and Inits
  2. Set Header
  3. Init Menu
  4. Init Gallery
  5. Init Milestones
  6. Init Logos Slider
  
  
  ******************************/
  
  $(document).ready(function()
  {
  	"use strict";
  
  	/* 
  
  	1. Vars and Inits
  
  	*/
  
  	var header = $('.header');
  	var ctrl = new ScrollMagic.Controller();
  
  	setHeader();
  	initMenu();
  	initGallery();
  	initMilestones();
  	initLogosSlider();
  
  	$(window).on('resize', function()
  	{
  		setHeader();
  
  		setTimeout(function()
  		{
  			$(window).trigger('resize.px.parallax');
  		}, 375);
  	});
  
  	$(document).on('scroll', function()
  	{
  		setHeader();
  	});
  
  	/* 
  
  	2. Set Header
  
  	*/
  
  	function setHeader()
  	{
  		var header = $('.header');
  
  		if($(window).scrollTop() > 91)
  		{
  			header.addClass('scrolled');
  		}
  		else
  		{
  			header.removeClass('scrolled');
  		}
  	}
  
  	/* 
  
  	3. Init Menu
  
  	*/
  
  	function initMenu()
  	{
  		if($('.menu').length && $('.hamburger').length)
  		{
  			var menu = $('.menu');
  			var hamburger = $('.hamburger');
  			var close = $('.menu_close');
  
  			hamburger.on('click', function()
  			{
  				menu.toggleClass('active');
  			});
  
  			close.on('click', function()
  			{
  				menu.toggleClass('active');
  			});
  		}
  	}
  
  	/* 
  
  	7. Init Gallery
  
  	*/
  
  	function initGallery()
  	{
  		if($('.gallery_item').length)
  		{
  			$('.colorbox').colorbox(
  			{
  				rel:'colorbox',
  				photo: true,
  				maxWidth:'95%',
  				maxHeight:'95%'
  			});
  		}
  	}
  
  	/* 
  
  	5. Init Milestones
  
  	*/
  
  	function initMilestones()
  	{
  		if($('.milestone_counter').length)
  		{
  			var milestoneItems = $('.milestone_counter');
  
  	    	milestoneItems.each(function(i)
  	    	{
  	    		var ele = $(this);
  	    		var endValue = ele.data('end-value');
  	    		var eleValue = ele.text();
  
  	    		/* Use data-sign-before and data-sign-after to add signs
  	    		infront or behind the counter number */
  	    		var signBefore = "";
  	    		var signAfter = "";
  
  	    		if(ele.attr('data-sign-before'))
  	    		{
  	    			signBefore = ele.attr('data-sign-before');
  	    		}
  
  	    		if(ele.attr('data-sign-after'))
  	    		{
  	    			signAfter = ele.attr('data-sign-after');
  	    		}
  
  	    		var milestoneScene = new ScrollMagic.Scene({
  		    		triggerElement: this,
  		    		triggerHook: 'onEnter',
  		    		reverse:false
  		    	})
  		    	.on('start', function()
  		    	{
  		    		var counter = {value:eleValue};
  		    		var counterTween = TweenMax.to(counter, 4,
  		    		{
  		    			value: endValue,
  		    			roundProps:"value", 
  						ease: Circ.easeOut, 
  						onUpdate:function()
  						{
  							document.getElementsByClassName('milestone_counter')[i].innerHTML = signBefore + counter.value + signAfter;
  						}
  		    		});
  		    	})
  			    .addTo(ctrl);
  	    	});
  		}
  	}
  
  	/* 
  
  	6. Init Logos Slider
  
  	*/
  
  	function initLogosSlider()
  	{
  		if($('.logos_slider').length)
  		{
  			var logosSlider = $('.logos_slider');
  			logosSlider.owlCarousel(
  			{
  				items:4,
  				loop:true,
  				autoplay:false,
  				smartSpeed:1200,
  				nav:false,
  				dots:false,
  				responsive:
  				{
  					0:{items:1},
  					769:{items:2},
  					992:{items:3},
  					1200:{items:4}
  				}
  			});
  		}
  	}
  
  });