


$(document).ready(function () {
  $('.list-bar').click(function () {
    $('.header-bottom-mobile').slideToggle();
  });

  $('.menu-mobile .mm1').click(function () {
    $(this).parent().find('.nav-sub').slideToggle();
  });

  $('.menu-mobile .mm2').click(function () {
    $(this).parent().find('.nav-sub-child').slideToggle();
  });


  $(".pt_list_menu_c2").each(function () {
    let length = $(this).find("li").length;
    if (length) {
      $(this).prev("a").append("<i class='icon-sidebar-menu fa fa-angle-right'></i>");
    }
  })

  $('.nav-item .links i').click(function () {
    event.preventDefault();
    $(this).parent().parent().find('.nav-sub').slideToggle();
    $(this).parent(".links").toggleClass('active');
  });


  /*js hide headertop*/
  $(window).scroll(function (event) {
    var pos_body = $('html,body').scrollTop();
    if (pos_body > 70) {
      $(".header").addClass('fixed');
    }
    else {
      $(".header").removeClass('fixed');
    }
  });
  $(".icon-sidebar-menu").click(function(){
    event.preventDefault();
    $(this).parent("a").next(".pt_list_menu_c2").slideToggle();
    $(this).toggleClass('active');
  })
});

function myFunction(x) {
  x.classList.toggle("change");
}

function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}

$(document).ready(function () {
  $(window).scroll(function (event) {
    var pos_body = $('html').scrollTop();
    if (pos_body > 100) {
      $('#menu').addClass('topfix');
    }
    else {
      $('#menu').removeClass('topfix');
    }
  });

  $(window).scroll(function (event) {
    var pos_body = $('body').scrollTop();
    if (pos_body > 100) {
      $('#menu').addClass('topfix2');
    }
    else {
      $('#menu').removeClass('topfix2');
    }
  });
});
