/*
	Разработка шаблонов для DataLife Engine
	------------------	
	Author:	ThemeSkeleton
	------------------
	Website: http://themeskeleton.com/
	------------------	
	E-mail: themeskeleton@gmail.com
	------------------
	Skype: ThemeSkeleton
	------------------
	ICQ: 722880
	------------------
*/

jQuery(window).load(function(){

$(".loader").fadeOut('slow');
jQuery('body').delay(350).css({'overflow':'visible'});

});

jQuery(function($) {'use strict',
	"use strict";

	new WOW().init();
	$('#recent_project').parallax("50%", 0.1);
	$('.finance_bg_text').parallax("50%", 0.1);
	$('#background_para').parallax("50%", 0.2);
 
	$('#finance_bg_text_2').parallax("50%", 0.1);
	$('#logistic_bg_text_3').parallax("50%", 0.1);

	$('.callback_bg').parallax("50%", 0.1);
var revapi;
		revapi = jQuery("#rev_slider").revolution({
			sliderType:"standard",
			sliderLayout:"fullwidth",
			delay:5000,
			navigation: {
				arrows:{enable:true}				
			},
			touch:{
			 touchenabled:"on",
			 swipe_threshold: 75,
			 swipe_min_touches: 1,
			 swipe_direction: "horizontal",
			 drag_block_vertical: false
		 },			
			gridwidth:1170,
			gridheight:788		
});	
var revapi;
		revapi = jQuery("#rev_slider_3").revolution({
			sliderType:"standard",
			sliderLayout:"fullwidth",
			hide_under:778,
			delay:5000,
			navigation: {
				arrows:{enable:true}				
			},
			touch:{
			 touchenabled:"on",
			 swipe_threshold: 75,
			 swipe_min_touches: 1,
			 swipe_direction: "horizontal",
			 drag_block_vertical: false
		 },			
			gridwidth:1170,
			gridheight:920		
});	

$("#our_team_slider").owlCarousel({
		autoPlay: 3000,
		items : 5,
        paginationSpeed : 400,
		pagination : true
});
$("#about_slider").owlCarousel({
		  autoPlay: true,
		  singleItem : true,
		  navigation : false,
		  pagination : true
});

  var owl = $("#map_banner");

  owl.owlCarousel({
    autoPlay: false,
    navigation : false,
    pagination: true,
    singleItem : true,
    transitionStyle : "goDown"
  });
$(".recent_project-slider, .recent_project_3_slider, #our_team_slider_3, #services_slider").owlCarousel({
     
          autoPlay: false,
          items : 3,
		  navigation : true,
		  pagination : false,
		  navigationText: [
			"<i class='fa fa-angle-left'></i>",
			"<i class='fa fa-angle-right'></i>"],
		  itemsDesktop : [1199,3],
          itemsDesktopSmall : [979,3]
 });

$("#testimonial-slider").owlCarousel({
		autoPlay: 3000, 
		slideSpeed : 300,
		paginationSpeed : 400,
		singleItem:true,
		pagination:true,
		paginationNumbers:false,
 
 });
$("#latest_news-slider").owlCarousel({
		autoPlay: 3000, 
		items : 2,
		slideSpeed : 300,
		paginationSpeed : 400,
		pagination:true,
		paginationNumbers:false,
 
 });
$("#latest_news-slider_1").owlCarousel({
		autoPlay: 3000, 
		items : 3,
		slideSpeed : 300,
		paginationSpeed : 400,
		paginationNumbers:false,
		dots:true,
 
 });
$("#latest_shop-slider_1").owlCarousel({
		autoPlay: 3000, 
		items : 3,
		slideSpeed : 300,
		paginationSpeed : 400,
		paginationNumbers:false,
		dots:true,
 
 });
$("#team_slider_2").owlCarousel({
		  autoPlay: true,
		  singleItem : true,
		  pagination : false,
          navigation : true,
          pagination : false,
          navigationText: [
          "<i class='fa fa-angle-left' aria-hidden='true'></i>",
          "<i class='fa fa-angle-right' aria-hidden='true'></i>"],
});
$("#project_slider").owlCarousel({
		  autoPlay: true,
		  singleItem : true,
		  navigation : false,
		  pagination : true
});
$("#shop-slider").owlCarousel({
          autoPlay: false,
          singleItem : true,
		  navigation : true,
		  pagination : false,
		  navigationText: [
			"",
			""],
 });
$("#shop_2_slider").owlCarousel({
		autoPlay: 3000,
		items : 3,
        paginationSpeed : 400,
		pagination : true
});
                    
  $('#testimonial-slider_2').owlCarousel({
		center: true,
		items: 3,
		loop: true,
		margin: 0,
        dots: true,
        dotData: true,
   

	});

 	 $('a[href=".team"]').on('click', function(event) {
		 event.preventDefault();
		 $('#team').addClass('open');
		 $('#team > form > input[type="search"]').focus();
	 });
	 $('#team, #team button.close').on('click keyup', function(event) {
	  if (event.target == this || event.target.className == 'close' || event.keyCode == 27) {
		  $(this).removeClass('open');
	  }
	 });

 $(".items > li > a").on('click', function(e) {
	  e.preventDefault();
	  var $this = $(this);
	  if ($this.hasClass("expanded")) {
		 $this.removeClass("expanded");
	  } 
	  else {
	  $(".items a.expanded").removeClass("expanded");
	  $this.addClass("expanded");
	  $(".sub-items").filter(":visible").slideUp("normal");
	}
	  $this.parent().children("ul").stop(true, true).slideToggle("normal");
});
	  
		jQuery('.toggle-heading').on('click', function(){
			jQuery(this).find('i').toggleClass('fa-minus fa-plus');
		});

});
jQuery(document).ready(function(){
	jQuery('.office_menu').find('ul').hide();
	jQuery('.office_menu').on('click', '.selected', function(){
		var checkClass = jQuery(this).hasClass('active');
		if(!checkClass){
			jQuery(this).addClass('active');
			jQuery(this).parent('.office_menu').find('ul').slideDown();
		}else{
			jQuery(this).removeClass('active');
			jQuery(this).parent('.office_menu').find('ul').slideUp();
		}
	});
	jQuery('.office_menu').on('click', 'ul a', function(e){
		e.preventDefault();
		jQuery('.addressbox').fadeOut();
		var clickDataVal = jQuery(this).data('office');

		var txt = jQuery(this).html();
		jQuery(this).parents('.office_menu').find('.selected').html(txt);
		jQuery(this).parents('.office_menu').find('.selected').removeClass('active');
		jQuery(this).parents('ul').slideUp();

		jQuery('.addressbox').each( function(){
			var elemDataVal = jQuery(this).data('office');
			if(clickDataVal == elemDataVal){
				jQuery(this).delay(300).fadeIn();
			}
		});
	});
	
});



function scrollToTop() {
    if ($('.scroll-to-target').length) {
        $(".scroll-to-target").on('click', function() {
            var target = $(this).attr('data-target');	
            $('html, body').animate({
                scrollTop: $(target).offset().top
            }, 1000);
        });
    }
}
jQuery(document).on('ready', function () {
	(function ($) {
        scrollToTop ();
	})(jQuery);
});


