

////////////////////////////////////////////////////////////
      ///////////////////////FAQ////////////////////
      //////////////////////////////////////////////
let items = document.querySelectorAll(".faq-main .faq-item");
items.forEach(function (t) {
  t.addEventListener("click", function (e) {
    items.forEach(function (e) {
      e !== t || e.classList.contains("faq-item-show")
        ? e.classList.remove("faq-item-show")
        : e.classList.add("faq-item-show");
    });
  });
});

////////////////////////////////////////////////////////////
      ////////////////////cursor////////////////////
      //////////////////////////////////////////////

 (function(){
  $('.container-fluid>.row>.panel').on('click',function(){
    var $this=$(this);
    $this.toggleClass('open').delay(400).toggleClass("open-active").siblings().removeClass('open open-active');
  });
  
})();

////////////////////////////////////////////////////////
    ///////////////owl carasal /////////////////
    ////////////////////////////////////////////   
// $(document).ready(function(){
// 			$(window).scroll(function(){
// 				$('.slides').css("opacity", 1 - $(window).scrollTop() / 1000)
// 			})
// 		})   		
	$(document).ready(function() {
      $('.owl-carousel').owlCarousel({
	    nav: true,
      navText: ['<i class="fa-solid fa-arrow-left-long"></i>','<i class="fa-solid fa-arrow-right-long"></i>'],
      dots: false,
      pagination: false,
	    autoplay:true,
	    loop:true,
	    autoplayHoverPause: false,
      margin:30,
      stagePadding:200,
      responsive:{
        0:{
          items: 1,
          stagePadding: 0,
          margin: 30,
          loop:true,
          
        },
        767:{
          items: 1,
          loop:true,
        },
		991:{
          items:3,
          stagePadding:0,
        },
		1400:{
          items:3,
        },
        1600:{
          items: 3,
        }
	}				  //default settings:
   })
   })	
			$(document).ready(function() {
      $('.owl-carousel2').owlCarousel({
				autoplay:true,
                loop:true,
				responsiveClass: true,
                nav: true,
                navText: ['<i class="fa-solid fa-angle-left"></i>','<i class="fa-solid fa-angle-right"></i>'],
				dots: false,
				margin: 20, 
				autoplayHoverPause: true,
                responsive: {
                  0: {
                    items: 1,
                  },
                  600: {
                    items: 1,
                  },
                  1000: {
                    items:1,
                  }
				}
				  //default settings:
              })
            })
       $(document).ready(function() {
              $('.owl-carousel3').owlCarousel({
           nav: true,
      navText: ['<i class="fa-solid fa-angle-left"></i>','<i class="fa-solid fa-angle-right"></i>'],
      dots: false,
      pagination: false,
      autoplay:true,
      loop:true,
      margin:30,
      responsive: {
        0:{
          items: 1,
          stagePadding: 0,
          loop:true,
        },
        767:{
          items: 1,
          loop:true,
        },
    991:{
          items: 2,
        },
    1200:{
          items:3,
        },
        1600:{
          items: 3,
        }
        }
          //default settings:
              })
            })
        $(document).ready(function() {
              $('.owl-carousel4').owlCarousel({
          autoplay:true,
          loop: true,
        responsiveClass: true,
        nav: true,
        navText: ['<i class="fa-solid fa-angle-left"></i>','<i class="fa-solid fa-angle-right"></i>'],
        dots: false,
        margin: 20,    
        autoplayTimeout: 4000,
        smartSpeed: 2000,

                responsive: {
                  0: {
                    items: 1,
                  },
                  600: {
                    items: 2,
                  },
                  1000: {
                    items: 3,
                  },
                  1200: {
                    items: 4,
                  },
                  1600:{
                    items: 4,
                  }
        }
          //default settings:
              })
            })
        $(document).ready(function() {
              $('.owl-carousel5').owlCarousel({
          autoplay:false,
          loop: false,
        responsiveClass: true,
        nav: true,
        navText: ['<i class="fa-solid fa-angle-left"></i>','<i class="fa-solid fa-angle-right"></i>'],
        dots: false,
        center: true,
        margin:0,    
        autoplayTimeout: 4000,
        smartSpeed: 400,

                responsive: {
                  0: {
                    items: 1,
                  },
                  600: {
                    items: 1,
                  },
                  1200: {
                    items: 1,
                  }
        }
          //default settings:
              })
            })

        $(document).ready(function() {
    $('.owl-carousel6').owlCarousel({
    nav: false,
    dots: false,
    loop: true,
    margin: 20,
    autoplay: true,
    slideTransition: 'linear',
    autoplayTimeout: 5000,
    autoplaySpeed:6000,
    autoplayHoverPause: false,

    responsive: {
        0: {
        items: 1,
        },
        600: {
        items: 1,
        },
        1000: {
        items: 4,
        }
        }
          //default settings:
        })
        })

////////////////////////////////////////////////////////
    //////////////////////jarallax //////////////
    ////////////////////////////////////////////
		 // object-fit polyfill run
        objectFitImages();
        /* init Jarallax */
        jarallax(document.querySelectorAll('.jarallax'));
        jarallax(document.querySelectorAll('.jarallax-keep-img'), {
            keepImg: true,
        });	
		
	document.addEventListener('DOMContentLoaded', function(event) {
  // Hamburger menu
  var navbarToggler = document.querySelectorAll('.navbar-toggler')[0];
  navbarToggler.addEventListener('click', function(e) {
    e.target.children[0].classList.toggle('active');
  });
  // Select the <html> element
  var html = document.querySelectorAll('html')[0];
  // Select the first element with the attribute 'data-bs-toggle-theme'
  var themeToggle = document.querySelectorAll('*[data-bs-toggle-theme]')[0];
  // Set the default theme to 'dark' for the <html> element
  html.setAttribute('data-bs-theme', 'dark');
  // Check if a themeToggle element is found
  if (themeToggle) {
    // Add a click event listener to the themeToggle element
    themeToggle.addEventListener('click', function(event) {
      // Prevent the default behavior of the click event
      event.preventDefault();
      // Check the current theme attribute value of the <html> element
      if (html.getAttribute('data-bs-theme') === 'dark') {
        // If the current theme is 'dark', change it to 'light'
        html.setAttribute('data-bs-theme', 'light');
      } else {
        // If the current theme is not 'dark', change it back to 'dark'
        html.setAttribute('data-bs-theme', 'dark');
      }
    });
  }
});	


// // // // // // ////////////////////////////////////////////////
        //////////////////////////////////////////////
        //////////////////////////////////////////////
var window_width = $(window).width() - $('#object').width();

var document_height = $(document).height() - $(window).height();

$(function () {
    $(window).scroll(function () {
        var scroll_position = $(window).scrollTop();
        var object_position_left = window_width * (scroll_position / document_height);
        $('#object').css({
            'left': object_position_left
        });
    });
});


// // // // // // ////////////////////////////////////////////////
        ////////////////number count//////////////////
        //////////////////////////////////////////////



// // // // // // ////////////////////////////////////////////////
        ////////////////dropdown//////////////////
        //////////////////////////////////////////
$(document).ready(function(){
    $(".dropdown").hover(            
        function() {
            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).slideDown("400");
            $(this).toggleClass('open');        
        },
        function() {
            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).slideUp("400");
            $(this).toggleClass('open');       
        }
    );
});
		
				
// // // // // // ////////////////////////////////////////////////
        //////////////////////////////////
        //////////////////////////////////////////
$(window).scroll(function() {
  
  // selectors
  var $window = $(window),
      $body = $('body'),
      $panel = $('.section');
  
  // Change 33% earlier than scroll position so colour is there when you arrive.
  var scroll = $window.scrollTop() + ($window.height() / 3);
 
	$('.section').removeClass('active');
	
  $panel.each(function () {
    var $this = $(this);
    
    // if position is within range of this panel.
    // So position of (position of top of div <= scroll position) && (position of bottom of div > scroll position).
    // Remember we set the scroll to 33% earlier in scroll var.
    if ($this.position().top <= scroll && $this.position().top + $this.height() > scroll) {
      $this.addClass('active');

    }
  });    
  
}).scroll();

////////////////////////////////////////////////////////////
      ////////////////// top button////////////////
      //////////////////////////////////////////////
    jQuery(document).ready(function() {
                var offset = 220;
                var duration = 500;
                jQuery(window).scroll(function() {
                    if (jQuery(this).scrollTop() > offset) {
                        jQuery('.back-to-top').fadeIn(duration);
                    } else {
                        jQuery('.back-to-top').fadeOut(duration);
                    }
                });
                
                jQuery('.back-to-top').click(function(event) {
                    event.preventDefault();
                    jQuery('html, body').animate({scrollTop: 0}, duration);
                    return false;
                })
            });

// // // // // // ////////////////////////////////////////////////
        //////////////////////////////////
        //////////////////////////////////////////





var $ = jQuery.noConflict();
    $(window).load(function() {
    $('.flexslider').flexslider({
          animation: "slide",              //String: Select your animation type, "fade" or "slide"
          //easing: "swing",               //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
          //direction: "horizontal",        //String: Select the sliding direction, "horizontal" or "vertical"
         
    });
    
    $(function() {
        $('.show_menu').click(function(){
                $('.menu').fadeIn();
                $('.show_menu').fadeOut();
                $('.hide_menu').fadeIn();
        });
        $('.hide_menu').click(function(){
                $('.menu').fadeOut();
                $('.show_menu').fadeIn();
                $('.hide_menu').fadeOut();
        });
      });
    });
    
//menu fixed top
window.onscroll = function() {myFunction()};
var header = document.getElementById("myHeader");
var sticky = header.offsetTop;
function myFunction() {
  if (window.pageYOffset > sticky) {
    header.classList.add("sticky");
  } else {
    header.classList.remove("sticky");
  }
}
//menu fixed top end    


   


            
// // // // // // ////////////////////////////////////////////////
        //////////////////////////////////
        //////////////////////////////////////////



// // // // // // ////////////////////////////////////////////////
        /////////////////////video popup/////////////////////////
        //////////////////////////////////////////////
$(function() {
    $('.popup-youtube, .popup-vimeo').magnificPopup({
        disableOn: 700,
        type: 'iframe',
        mainClass: 'mfp-fade',
        removalDelay: 160,
        preloader: false,
        fixedContentPos: false
    });
});
// // // // // // ////////////////////////////////////////////////
        /////////////////////vtabby/////////////////////////
        //////////////////////////////////////////////
$(document).ready(function(){
            $('#tabby-1').tabby();
        });




// // // // // // ////////////////////////////////////////////////
        /////////////////////details menu /////////////////////////
        //////////////////////////////////////////////
$(document).ready(function(){
  $(window).bind('scroll', function() {
    var navHeight = $('.margin_inpageblock').height();
    if ($(window).scrollTop() > navHeight) {
      $('.nav-bar').addClass('fixed');
     }
    else {
      $('.nav-bar').removeClass('fixed');
     }
  });
});

const phoneInput = document.querySelector("#phoneInput");

  // Initialize intlTelInput
  const iti = window.intlTelInput(phoneInput, {
    utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/utils.min.js"
  });

  // Set initial country based on the user's location
  iti.promise.then(() => {
    const countryCode = iti.getSelectedCountryData().iso2;
    iti.setCountry(countryCode);
  });

  // Listen for the country change event
  phoneInput.addEventListener("countrychange", function() {
    const countryCode = iti.getSelectedCountryData().iso2;
    console.log("Selected country code:", countryCode);
  });


