$(document).ready(function(){

    $('#testimonials-slider').owlCarousel({
        items:1,
        loop:true,
        margin:10,
        nav: true,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        dots: true,
        responsive:{
            0:{
                items:1,
            },
            600:{
                items:1,
            },
            1000:{
                items:1,
            },
        }
      });



      $('#project-galley-slider').owlCarousel({
        loop:true,
        center: false,
        margin:10,
        nav:true,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        dots:true,
        autoplay:true,
        autoplayTimeout:2000,
        // autoplayHoverPause:false,
        responsive:{
            0:{
                items:1
            },
            600:{
                items:2
            },
            1000:{
                items:3
            }
        }
    })


});




$(window).scroll(function(){
    if ($(window).scrollTop() >= 200) {
        $('.navbar').addClass('fixed-header');
    }
    else {
        $('.navbar').removeClass('fixed-header');
    }
  });




/*----------------------------
 Gallery
------------------------------ */
 "use strict";
    $("a.gallery").prettyPhoto({theme: 'dark_rounded', social_tools:false});


    $(document).ready(function(){
        $("area[rel^='prettyPhoto']").prettyPhoto();
        
        $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: true});
        $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});

        $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
            custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
            changepicturecallback: function(){ initialize(); }
        });

        $("#custom_content a[rel^='prettyPhoto']: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(); }
        });
    });




/*****************mega-portfolio********************/

var api=jQuery('.megafolio-container').megafoliopro(
    {
      filterChangeAnimation:"rotatescale",  // fade, rotate, scale, rotatescale, pagetop, pagebottom,pagemiddle
      filterChangeSpeed:800,          // Speed of Transition
      filterChangeRotate:99,          // If you ue scalerotate or rotate you can set the rotation (99 = random !!)
      filterChangeScale:0.6,          // Scale Animation Endparameter
      delay:20,               // The Time between the Animation of single mega-entry points
      paddingHorizontal:20,          // Padding between the mega-entrypoints
      paddingVertical:20,
      layoutarray:[10]    // Defines the Layout Types which can be used in the Gallery. 2-9 or "random". You can define more than one, like {5,2,6,4} where the first items will be orderd in layout 5, the next comming items in layout 2, the next comming items in layout 6 etc... You can use also simple {9} then all item ordered in Layout 9 type.

    });

  // CALL FILTER FUNCTION IF ANY FILTER HAS BEEN CLICKED
  jQuery('.filter').click(function() {  
      jQuery('.filter').removeClass("active");
      api.megafilter(jQuery(this).data('category'));    
      jQuery(this).addClass("active");
  });