"use strict";function changeSubstrateBottom(){var a=$(".client-item__substrate").width();$(".client-item__substrate-bottom").css({"border-left-width":a/2,"border-right-width":a/2})}$(".clients-carousel").owlCarousel({loop:!0,slideBy:1,smartSpeed:1e3,navContainer:".clients-carousel-nav",navText:['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],margin:40,responsive:{0:{items:1},480:{items:2},768:{items:3},1200:{items:4}}}),$(".responses-carousel").owlCarousel({loop:!0,slideBy:1,smartSpeed:1e3,navContainer:".responses-carousel-nav",navText:['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],margin:30,responsive:{0:{items:1},480:{items:2},768:{items:3},1200:{items:4}}}),$(".education-carousel").owlCarousel({items:4,loop:!0,slideBy:1,smartSpeed:1e3,margin:30,responsive:{0:{items:1},480:{items:2},768:{items:3},1200:{items:4}}}),$(".burger").on("click",function(){$(".main-nav").toggleClass("active").slideToggle(300)}),$(document).click(function(a){$(a.target).closest(".main-nav").length||$(a.target).closest(".burger").length||$(".main-nav.active").removeClass("active").slideUp(300)}),$(".sign-form-wrapper--toggleable .sign-form-top").on("click",function(){$(".sign-form").toggleClass("active").slideToggle(300)}),$(document).click(function(a){$(a.target).closest(".sign-form-wrapper--toggleable").length||$(".sign-form-wrapper--toggleable .sign-form").removeClass("active").slideUp(300)}),changeSubstrateBottom(),$(window).resize(function(){changeSubstrateBottom()}),$(".slide-to").click(function(a){a.preventDefault(),$("body,html").animate({scrollTop:$($(this).attr("href")).offset().top},800)}),$(".tabs a").on("click",function(a){/*a.preventDefault(),console.log("test"),*/$(this).parent("li").hasClass("active")||($(".tabs li.active").removeClass("active"),$(this).parent("li").addClass("active"))}),$(".select").on("click",function(){$(this).toggleClass("active")}),$(document).click(function(a){$(a.target).closest(".select").length||$(".select").removeClass("active")}),$(".select__menu .select__option").on("click",function(){$(this).siblings(".active").removeClass("active"),$(this).addClass("active").parents(".select").find(".select__selected").text($(this).text()).siblings("input").val($(this).data("value"))});

//prize


jQuery(document).ready(() => {
  let form = jQuery('#form-prize');
  let result = jQuery('#result');

  const query = () => {
    var url = "/wp-content/themes/newclinic/scripts/mail.php";
    if (jQuery('#check').prop('checked')) {
      jQuery.ajax({
        type: "POST",
        url: url,
        data: form.serialize(),
        success: (data) => {
          form.hide();
          result.append(`<h3 class="text-info">Спасибо <span class="text-success">${data}</span>, Ваш ответ принят!</h3>`);
          localStorage.setItem('prize', 'register');
        }
      });
    } else {
      alert('Вы не приняли соглашение');
    }
  }

  form.submit((e) => {
    e.preventDefault();
    query();
  });
  

});

$(document).ready(function () {
  let yaid = yaCounter11807641.getClientID();
  $('#cliendID').html(yaid);
});
$('[data-toggle="tooltip"]').tooltip();