/*

Template:  The Corps - Responsive Multi-purpose HTML5 Template
Author: potenzaglobalsolutions.com
Version: 1
Design and Developed by: potenzaglobalsolutions.com

NOTE:  

*/


/*================================================
[  Table of contents  ]
================================================
 
:: Preloader
:: mega menu 
:: Back to top 

======================================
[ End table content ]
======================================*/


/*************************
       preloader
*************************/
 $(window).load(function() {
      //preloader
      $("#load").fadeOut();
       $('#loading').delay(0).fadeOut('slow');
   });
  

/*************************
       mega menu
*************************/
    
        jQuery(document).ready(function () {
            jQuery('#menu').megaMenu({
                // DESKTOP MODE SETTINGS
                logo_align          : 'left',         // align the logo left or right. options (left) or (right)
                links_align         : 'left',        // align the links left or right. options (left) or (right)
                socialBar_align     : 'left',    // align the socialBar left or right. options (left) or (right)
                searchBar_align     : 'right',   // align the search bar left or right. options (left) or (right)
                trigger             : 'hover',           // show drop down using click or hover. options (hover) or (click)
                effect              : 'fade',             // drop down effects. options (fade), (scale), (expand-top), (expand-bottom), (expand-left), (expand-right)
                effect_speed        : 400,          // drop down show speed in milliseconds
                sibling             : true,              // hide the others showing drop downs if this option true. this option works on if the trigger option is "click". options (true) or (false)
                outside_click_close : true,  // hide the showing drop downs when user click outside the menu. this option works if the trigger option is "click". options (true) or (false)
                top_fixed           : false,           // fixed the menu top of the screen. options (true) or (false)
                sticky_header       : false,       // menu fixed on top when scroll down down. options (true) or (false)
                sticky_header_height: 250,  // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
                menu_position       : 'horizontal',    // change the menu position. options (horizontal), (vertical-left) or (vertical-right)
                full_width          : false,           // make menu full width. options (true) or (false)
                // MOBILE MODE SETTINGS
                mobile_settings     : {
                    collapse            : true,    // collapse the menu on click. options (true) or (false)
                    sibling             : true,      // hide the others showing drop downs when click on current drop down. options (true) or (false)
                    scrollBar           : true,    // enable the scroll bar. options (true) or (false)
                    scrollBar_height    : 400,  // scroll bar height in px value. this option works if the scrollBar option true.
                    top_fixed           : false,       // fixed menu top of the screen. options (true) or (false)
                    sticky_header       : false,   // menu fixed on top when scroll down down. options (true) or (false)
                    sticky_header_height: 200   // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
                }
            });
        }); 
 
 
/*************************
        Back To Top
*************************/

  $(document).ready(function(){
      var $scrolltop = $('.car-top');
      var $window = $(window);

      $scrolltop.on('click', function () {
          $('html,body').animate({
                    scrollTop: 0
             }, 800);
          $(this).addClass("car-run");
          setTimeout(function(){ $scrolltop.removeClass('car-run');},1000);
          return false;
      });
      $window.on('scroll', function () {   
          if($window.scrollTop() >= 200) {
              $scrolltop.addClass("show");
              $scrolltop.addClass("car-down");
             } else {
               $scrolltop.removeClass("show");
               setTimeout(function(){ $scrolltop.removeClass('car-down');},300);
            }
       });
  });


  $('.owl-carousel-1').owlCarousel({
     items:3,
      responsive:{
        0:{
            items:1
        },
        600:{
            items:2
        },
        992:{
            items:3
        },
        1400:{
            items:3
        }
    },
     margin:40,
     loop:true,
     autoplay:true,
     autoplayTimeout:3000,
     autoplayHoverPause:true, 
     dots:false,
     nav:true,
     navText:["<i class='fa fa-angle-left fa-2x'></i>","<i class='fa fa-angle-right fa-2x'></i>"],     
    });


$('.owl-carousel-2').owlCarousel({
     items:5,
      responsive:{
        0:{
            items:1
        },
        400:{
            items:2
        },
        600:{
            items:3
        },
        767:{
            items:4
        },
        1000:{
            items:5
        },
        1400:{
            items:5
        }
    },
     margin:40,
     loop:true,
     autoplay:true,
     autoplayTimeout:2000,
     autoplayHoverPause:true, 
     dots:false,
     nav:false     
    });