$(window).scroll(function() 
{
 if ($(this).scrollTop() > 1)
 {
  $('.header-block').addClass("sticky-header");
 }
 else
 {
  $('.header-block').removeClass("sticky-header");
 }
});

$(document).ready(function(){
  $(".navs-toggle-icon").click(function(){
    $("body").toggleClass("toggle-open");
  });
});

$('a[href="#search"]').click(function() {
  event.preventDefault()
  $("#search-box").addClass("-open");
  setTimeout(function() {
    inputSearch.focus();
  }, 800);
});

$('a[href="#close"]').click(function() {
  event.preventDefault()
  $("#search-box").removeClass("-open");
});

$(document).keyup(function(e) {
  if (e.keyCode == 27) { // escape key maps to keycode `27`
    $("#search-box").removeClass("-open");
  }
});


$(window).on('load',function(){
  setTimeout(function(){ // allowing 3 secs to fade out loader
  $('.page-loader').fadeOut('slow');
  },3500);
});

jQuery('.primary-menu ul li').each(function() {
  jQuery(this).children('ul').before('<span class="sub"><i class="fa fa-angle-down" aria-hidden="true"></i></span>');   
});
jQuery('.primary-menu ul li .sub').click(function(e) {
  jQuery(this).next('ul').slideToggle();
  jQuery(this).toggleClass('submenu-hide');
});

 

// jQuery(document).ready(function() {
// 		        var owl = jQuery('#bannerslider');
// 		            owl.owlCarousel({
// 		                loop: true,
// 		                margin: 0,
// 						nav: false,
// 						dots: true,
// 						autoplay:false,
//             mouseDrag: false,
// 							autoplayTimeout:3000,
//               animateOut: 'fadeOut',							
// 		                navRewind: false,
// 		                responsive: {
// 		                  0: {
// 		                    items: 1
// 		                  },
// 		                  600: {
// 		                    items: 1
// 		                  },
// 		                  1000: {
// 		                    items: 1
// 		                }
// 		}
// 	})
// });


jQuery(document).ready(function() {
  
    jQuery(window).on('load', function() {
        var owl = jQuery('.bannerslider');

        // Initialize Owl Carousel with lazy loading enabled
        owl.owlCarousel({
            loop: true,
            margin: 0,
            nav: false,
            dots: true,
            autoplay: true,
            lazyLoad: true, // Lazy loading images
            mouseDrag: false,
            animateOut: 'fadeOut', // Smooth fade out transition
            autoplayTimeout: 5000, // Time between slides
            navRewind: false,
            responsive: {
                0: {
                    items: 1
                },
                600: {
                    items: 1
                },
                1000: {
                    items: 1
                }
            }
        });

     
        jQuery('body').addClass('loaded');
    });
});



jQuery(document).ready(function() {
            var owl = jQuery('#massage-slider');
                owl.owlCarousel({
                    loop: true,
                    margin: 30,
            nav: true,
            dots: false,
            autoplay:true,
              autoplayTimeout:5000,
              autoplayHoverPause: true,
              animateOut: 'fadeOut',
                    navRewind: false,
                    responsive: {
                      0: {
                        items: 1
                      },
                      600: {
                        items: 1
                      },
                      768: {
                        items: 2
                      },
                       991: {
                        items: 2
                      },
                      1200: {
                        items: 4
                    }
    }
  })
});


jQuery(document).ready(function() {
            var owl = jQuery('#price-slider');
                owl.owlCarousel({
                    loop: true,
                    margin: 30,
            nav: true,
            dots: false,
            autoplay:true,
              autoplayTimeout:6000,
              autoplayHoverPause: true,
              animateOut: 'fadeOut',
                    navRewind: false,
                    responsive: {
                      0: {
                        items: 1
                      },
                      600: {
                        items: 1
                      },
                      768: {
                        items: 2
                      },
                       991: {
                        items: 2
                      },
                      1200: {
                        items: 4
                    }
    }
  })
});

jQuery(document).ready(function() {
            var owl = jQuery('#therapy-price-slider');
                owl.owlCarousel({
                    loop: true,
                    margin: 15,
            nav: true,
            dots: false,
            autoplay:true,
              autoplayTimeout:6000,
              autoplayHoverPause: true,
              animateOut: 'fadeOut',
                    navRewind: false,
                    responsive: {
                      0: {
                        items: 1
                      },
                      600: {
                        items: 1
                      },
                      768: {
                        items: 2
                      },
                       991: {
                        items: 2
                      },
                      1200: {
                        items: 3
                    }
    }
  })
});
jQuery(document).ready(function() {
            var owl = jQuery('.priceslider');
                owl.owlCarousel({
                    loop: true,
                    margin: 15,
            nav: true,
            dots: false,
            autoplay:true,
              autoplayTimeout:6000,
              autoplayHoverPause: true,
              animateOut: 'fadeOut',
                    navRewind: false,
                    responsive: {
                      0: {
                        items: 1
                      },
                      600: {
                        items: 1
                      },
                      768: {
                        items: 2
                      },
                       991: {
                        items: 2
                      },
                      1200: {
                        items: 3
                    }
    }
  })
});

