// On Document Load
jQuery(window).load(function(){
    //site loader
    jQuery('.cover').hide();
});

jQuery(document).ready(function ($) {
  $(window).scroll(function() {    
      var scroll = $(window).scrollTop();

      if (scroll >= 50) {
          $(".site-header").addClass("fixHeader");
      } else {
          $(".site-header").removeClass("fixHeader");
      }
  });


    //What happen on window scroll
    function back_to_top(){
        var scrollTop = $(window).scrollTop();
        var offset = 500;
        if (scrollTop < offset) {
            $('.salientthemes-back-to-top').hide();
        } else {
            $('.salientthemes-back-to-top').show();
        }
    }
    jQuery(window).on("scroll", function (e) {
        back_to_top();
    });
    back_to_top();
    $('a[href*="#"]').on('click', function(event){
        if ($(this.hash).length){
            event.preventDefault();
            $("html, body").stop().animate({scrollTop: $(this.hash).offset().top - 70}, 2e3, "easeInOutExpo");
        }
    });
    /*wow js*/
    wow = new WOW({
            boxClass: 'salientthemes-animate'
        }
    )
    wow.init();

    // slick jQuery
    
    jQuery('.carousel-group').slick({
      autoplay: true,
      autoplaySpeed: 3000,
      dots: true,
      slidesToShow: 3,
      slidesToScroll: 1,
      lazyLoad: 'ondemand',
      responsive: [
         {
           breakpoint: 1024,
           settings: {
             slidesToShow: 3,
             slidesToScroll: 3,
             infinite: true,
             dots: true
           }
         },
         {
           breakpoint: 768,
           settings: {
             slidesToShow: 2,
             slidesToScroll: 2
           }
         },
         {
           breakpoint: 481,
           settings: {
             slidesToShow: 1,
             slidesToScroll: 1
           }
         }
         // You can unslick at a given breakpoint now by adding:
         // settings: "unslick"
         // instead of a settings object
       ]
    });

    // mmenu
    jQuery("#site-navigation").mmenu({
       // options
       "classes": "mm-slide mm-light",
       "counters": true,
       "header": true,
       "offCanvas": {
          "position"  : "right",
          "zposition": "back"
           },
       "extensions" : [ 'effect-slide-menu', 'pageshadow' ],
       "navbar"         : {
        "title"     : 'MENU'
       },
       "navbars"        : [{
            "position"  : 'top',
            "content"       : [
                'prev',
                'title',
                'close'
            ]
        }
       ]
    }, {
       // configuration
       clone: true
    });

/*preety photo*/
      $("area[rel^='momentpopup']").prettyPhoto();
      
      $(".element-item:first a[rel^='momentpopup']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: true});
      $(".element-item:gt(0) a[rel^='momentpopup']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
    
      $("#custom_content a[rel^='momentpopup']:first").prettyPhoto({
        custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
        changepicturecallback: function(){ initialize(); }
      });

      $("#custom_content a[rel^='momentpopup']:last").prettyPhoto({
        custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
        changepicturecallback: function(){ _bsap.exec(); }
      });


});

