PageSourceSearch

https://www.ymc.ru/local/templates/ymcV2/js/common.js?v=1790914717

js ymc.ru collected 2026-10-02 04:18:52 UTC 26,690 bytes, 963 lines download raw bytes

1$(function () {
2	"use strict";
3
4	function isMobile() {
5		// На сервере — считаем "не мобилкой", чтобы избежать ошибок
6		if (typeof window === "undefined") return false;
7
8		// 1. Проверяем по ширине viewport — основной критерий
9		if (window.innerWidth <= 1024) {
10			return true;
11		}
12
13		// 2. Дополнительно проверяем userAgent на случай больших планшетов (iPad Pro и т.п.)
14		const ua = navigator.userAgent;
15		const mobileKeywords = /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|Mobile|Tablet|Windows Phone/i;
16		return mobileKeywords.test(ua);
17	}
18
19	var $window = $(window);
20	var windowWidth = $window.width();
21
22	if ($(".aglaya").length > 0) {
23		$(".aglaya").insertBefore(".sub-groups");
24	}
25
26	$(".collapse-list").slideUp();
27
28	$(".collapse-link").click(function () {
29		$(this).next(".collapse-list").slideToggle();
30	});
31
32	$(".services__item-title a").click(function () {
33		return false;
34	});
35
36	$("a[target=blank]").attr("target", "_blank");
37
38	function get_cookie(cookie_name) {
39		var results = document.cookie.match("(^|;) ?" + cookie_name + "=([^;]*)(;|$)");
40
41		if (results) return unescape(results[2]);
42		else return null;
43	}
44
45	setTimeout(function () {
46		if (get_cookie("acceptCookie") != "yes") {
47			$("#cookie").show();
48		}
49	}, 1000);
50
51	$(".cookieclick").click(function () {
52		$("#cookie").hide();
53		document.cookie = "acceptCookie=yes; max-age=2592000;path=/";
54	});
55
56	/*******************************************************/
57	//MENU MOBILE
58	/*******************************************************/
59	var $menu = $(".header__nav"),
60		$buttonMenuMobile = $(".header__button-menu");
61	$buttonMenuMobile.click(function (e) {
62		e.stopPropagation();
63		$(this).toggleClass("active");
64		$menu.slideToggle(200);
65	});
66
67	/*******************************************************/
68	//SUBMENU MOBILE
69	/*******************************************************/
70	$menu.find("a").click(function (e) {
71		if ($window.width() <= 992) {
72			var $this = $(this),
73				$ul = $this.prev("ul"),
74				$li = $this.closest("li");
75			if ($ul.length && !$li.hasClass("active")) {
76				e.preventDefault();
77				$ul.slideDown(300);
78				$li.addClass("active").siblings().removeClass("active").find("ul").slideUp(300);
79			}
80		}
81	});
82
83	$window.resize(function () {
84		if (windowWidth != $window.width()) {
85			windowWidth = $window.width();
86			$buttonMenuMobile.removeClass("active");
87			$menu.removeAttr("style");
88			$menu.find("ul, li").removeAttr("style").removeClass("active");
89		}
90	});
91
92	/*******************************************************/
93	//DROPDOWN
94	/*******************************************************/
95	$(".dropdown").click(function (e) {
96		if (!$(e.target).data("search")) {
97			e.stopPropagation();
98			$(this).toggleClass("active").siblings(".dropdown").removeClass("active");
99		}
100	});
101	$(document).on("click", function (e) {
102		if (!$(e.target).closest(".dropdown").length) {
103			$(".dropdown").removeClass("active");
104		}
105		e.stopPropagation();
106	});
107
108	/*******************************************************/
109	//SLIDER
110	/*******************************************************/
111	$(".slider").addClass("owl-carousel").owlCarousel({
112		loop: true,
113		items: 1,
114		nav: true,
115		navText: "",
116		autoplayTimeout: 7000,
117		autoplay: true,
118		smartSpeed: 600,
119		singleItem: true,
120		dotsContainer: ".banner-dots",
121	});
122
123	$(".service-slider")
124		.addClass("owl-carousel")
125		.owlCarousel({
126			loop: true,
127			items: 1,
128			nav: true,
129			dots: true,
130			navText: ["&#8592", "&#8594"],
131			autoplayTimeout: 3000,
132			autoplay: true,
133			smartSpeed: 600,
134			margin: 0,
135		});
136
137	$(".nt-slider")
138		.addClass("owl-carousel")
139		.owlCarousel({
140			loop: true,
141			items: 2,
142			nav: true,
143			dots: true,
144			autoplayTimeout: 3000,
145			autoplay: true,
146			smartSpeed: 600,
147			margin: 30,
148			navText: ["&#8592", "&#8594"],
149			responsive: {
150				0: {
151					// от 0px
152					items: 1,
153				},
154				600: {
155					// от 600px
156					items: 2,
157				},
158			},
159		});
160
161	$(".aglaya-slider")
162		.addClass("owl-carousel")
163		.owlCarousel({
164			loop: true,
165			items: 3,
166			nav: true,
167			dots: true,
168			navText: ["&#8592", "&#8594"],
169			autoplayTimeout: 3000,
170			autoplay: true,
171			smartSpeed: 600,
172			margin: 30,
173		});
174
175	$(".oms-slider")
176		.addClass("owl-carousel")
177		.owlCarousel({
178			loop: true,
179			items: 4,
180			nav: true,
181			dots: true,
182			navText: ["&#8592", "&#8594"],
183			autoplayTimeout: 3000,
184			autoplay: true,
185			smartSpeed: 600,
186			margin: 20,
187		});
188
189	$(".rybinsk-carousel")
190		.addClass("owl-carousel")
191		.owlCarousel({
192			loop: true,
193			items: 1,
194			nav: true,
195			navText: ["&#8592", "&#8594"],
196			autoplayTimeout: 2000,
197			autoplay: true,
198			smartSpeed: 600,
199			singleItem: true,
200
201			responsive: {
202				600: {
203					items: 2,
204					margin: 20,
205				},
206				768: {
207					items: 3,
208					margin: 20,
209				},
210			},
211		});
212	/*******************************************************/
213	//POPUP
214	/*******************************************************/
215
216	$(".popup-with-move-anim").magnificPopup({
217		type: "inline",
218		fixedContentPos: false,
219		fixedBgPos: true,
220		overflowY: "auto",
221		closeBtnInside: true,
222		preloader: false,
223		midClick: true,
224		removalDelay: 300,
225		mainClass: "my-mfp-slide-bottom",
226	});
227	/*******************************************************/
228	//VIDEO POPUP
229	/*******************************************************/
230	$(".popup-youtube").magnificPopup({
231		type: "iframe",
232		mainClass: "mfp-fade",
233		removalDelay: 160,
234		preloader: false,
235		fixedContentPos: false,
236	});
237
238	/*******************************************************/
239	//КЛИК ПО ССЫЛКЕ ВРАЧА
240	/*******************************************************/
241
242	// $(document).on('click','.online-fancy',function(e){
243	//                e.preventDefault;
244	//                $.fancybox.open([ {
245	//                    href: 'https://www.ymc.ru/'+$(this).attr('href'),
246	//                    type: 'ajax',
247	//                    padding: [30,30,30,30]
248	//                    }])
249
250	//                 return false;
251	//            });
252
253	$(document).on("click", ".doc-item a, .order-doc a", function (e) {
254		e.preventDefault;
255		$.fancybox.open([
256			{
257				href: $(this).attr("href") + "?ajax-mode=Y",
258				type: "ajax",
259				padding: [30, 30, 30, 30],
260				afterShow: function (data) {
261					$(".fancybox-inner")
262						.find(".service-slider")
263						.addClass("owl-carousel")
264						.owlCarousel({
265							loop: true,
266							items: 1,
267							nav: false,
268							dots: true,
269							navText: ["&#8592", "&#8594"],
270							autoplayTimeout: 3000,
271							autoplay: true,
272							smartSpeed: 600,
273							margin: 0,
274						});
275				},
276				helpers: {
277					overlay: {
278						locked: false,
279					},
280				},
281				// afterLoad : function(data){
282				//     console.log($(data).html());
283				//     $('.content-wrap').addClass('blur');
284				//     $('.fast-fixed').addClass('blur');
285				// },
286				// beforeClose : function(){
287				//     $('.content-wrap').removeClass('blur');
288				//     $('.fast-fixed').removeClass('blur');
289				// }
290			},
291		]);
292		return false;
293	});
294
295	$(".fancy-photo").fancybox();
296
297	$(".3d").fancybox({
298		width: "100%",
299		height: "100%",
300		preload: true,
301		padding: 0,
302	});
303
304	$(".spec-item").hover(
305		function () {
306			var clone = $(this).clone().addClass("clone");
307			clone.appendTo($(this));
308		},
309		function () {
310			$(".clone").remove();
311		},
312	);
313
314	/*******************************************************/
315	//поиск по категориям
316	/*******************************************************/
317
318	$(document).on("click", ".search-where-list li", function (e) {
319		var req = $(this).data("search");
320		var val = $(this).text();
321
322		$(this).closest(".dropdown").removeClass("active").find(".search-where-title span").text(val);
323
324		$(document).find(".search-narrow_down").attr("value", req);
325		$(".search-page form").submit();
326	});
327
328	/*******************************************************/
329	// табы в карточке специалиста
330	/*******************************************************/
331
332	$(document).on("click", ".spec-tabs-item", function () {
333		$(".tab-content, .spec-tabs-item").removeClass("active");
334		var i = $(this).index(".spec-tabs-item");
335		$(".tab-content").eq(i).addClass("active");
336		$(this).addClass("active");
337		$.fancybox.update();
338	});
339
340	/*******************************************************/
341	// табы в отзывах специалиста
342	/*******************************************************/
343
344	$(document).on("click", ".otz-tabs-item", function () {
345		$(".otz-tab-content, .otz-tabs-item").removeClass("active");
346		var i = $(this).index(".otz-tabs-item");
347		$(".otz-tab-content").eq(i).addClass("active");
348		$(this).addClass("active");
349	});
350
351	if ($(".otz-tabs").length > 0) {
352		if (location.href.indexOf("#form") >= 0) {
353			$(".otz-tabs-item").eq(2).click();
354		}
355	}
356
357	/*******************************************************/
358	// ajax новости
359	/*******************************************************/
360
361	$(document).on("click", ".down-still", function () {
362		var href = $(this).attr("href");
363		var thisis = $(this);
364
365		$.ajax({
366			url: href,
367			success: function (data) {
368				$(thisis).remove();
369				var app = $(data).find(".news__box .news__item, .news__box .down-still-wrap");
370				$(document).find(".news__box").append(app);
371			},
372		});
373		return false;
374	});
375
376	/*******************************************************/
377	// ajax цены
378	/*******************************************************/
379
380	$(document).on("click", ".pr-ot-get", function (e) {
381		e.preventDefault;
382		var val = $(this).data("val");
383		var name = $.trim($(this).text());
384
385		$.fancybox.open([
386			{
387				href: "/price-list/ajax.php?get-price=" + val,
388				type: "ajax",
389				padding: [30, 30, 30, 30],
390				helpers: {
391					overlay: {
392						locked: false,
393					},
394				},
395			},
396		]);
397
398		return false;
399	});
400
401	/*******************************************************/
402	// вакансии
403	/*******************************************************/
404
405	$("a.show-vac").click(function () {
406		$(this)
407			.prev("div")
408			.slideToggle("medium", function (e) {
409				if ($(this).next("a").hasClass("active")) {
410					$(this).next("a").removeClass("active");
411					$(this).next("a").text("Развернуть описание вакансии");
412				} else {
413					$(this).next("a").addClass("active");
414					$(this).next("a").text("Свернуть описание вакансии");
415				}
416			});
417		event.preventDefault();
418		return false;
419	});
420
421	/*******************************************************/
422	//BACK-TO-TOP
423	/*******************************************************/
424
425	$(window).scroll(function () {
426		if ($(this).scrollTop() > 500) {
427			$(".back-to-top").show(500);
428		} else {
429			$(".back-to-top").hide(500);
430		}
431	});
432
433	$(".back-to-top").click(function () {
434		$("html,body").animate({ scrollTop: 0 }, 500);
435	});
436
437	// Рейтинг в отзыве
438
439	$(".rating-star").hover(
440		function () {
441			$(this).prevAll().addClass("active");
442		},
443		function () {
444			$(this).prevAll().removeClass("active");
445		},
446	);
447
448	$(".rating-star").click(function () {
449		$(this).addClass("clicked");
450		$(this).prevAll().addClass("clicked");
451		$(this).nextAll().removeClass("clicked");
452
453		$("[name=rating]").val($(this).data("rating"));
454	});
455
456	/*******************************************************/
457	//отправка форм
458	/*******************************************************/
459
460	$(".phoneInput").inputmask("+7 999 999-99-99");
461
462	$(".dateInput").inputmask({
463		alias: "datetime",
464		inputFormat: "dd.mm.yyyy",
465		placeholder: "__.__.____",
466	});
467
468	$(document).on("click", ".feedbacksubmit", function () {
469		var form = $(this).parents("form");
470		var flag = 0;
471
472		var action = "/ajax/" + form.data("action") + ".php";
473
474		form.find("[data-require]").removeClass("red");
475		form.find(".agree-error, .success, .rating-yandex").hide();
476
477		// $('#feedbackForm [data-require=Y]').removeClass('red');
478		// $('.feedbackFormInputs .agree-error').addClass('hidden');
479
480		form.find("[data-require]").each(function () {
481			if (!$.trim($(this).val())) {
482				$(this).addClass("red");
483				flag++;
484			}
485		});
486
487		if (form.find("[name=agree]").length > 0 && form.find("[name=agree]").prop("checked") != true) {
488			form.find(".agree-error").show();
489			flag++;
490		}
491
492		if (flag == 0) {
493			var d = [];
494			var i = 0;
495
496			var jsondata = {
497				name: form.find("input[name=name]").val(),
498				phone: form.find("input[name=phone]").val(),
499				message: form.find("textarea[name=message]").val(),
500				rating: form.find("input[name=rating]").val(),
501			};
502
503			$.ajax({
504				type: "POST",
505				url: action,
506				data: jsondata,
507				success: function (data) {
508					form.find(".success").show();
509					form.find(".feedbacksubmit").hide();
510
511					if ($("[name=rating]").val() > 3) {
512						$(".rating-yandex").show();
513					}
514				},
515				error: function (xhr, str) {
516					console.log("Ошибка отправки");
517				},
518			});
519		}
520	});
521
522	// варианты для записи к врачу
523
524	$(document).on("click", ".false-appointment", function (e) {
525		e.preventDefault();
526		$(this).hide();
527
528		$(this).siblings(".false-appointment-content").addClass("active");
529	});
530
531	// чистим имена врачей в быстрой записи
532
533	$('.shedule_line-name:contains("Некрасова")').each(function () {
534		var text = $(this).text().split("(");
535		text = text[0];
536		$(this).text(text);
537	});
538
539	// новая быстрая запись
540
541	// $(document).on('click', '.online-sections .spec-section-a', function (e) {
542	//          // e.preventDefault();
543	//          alert("a");
544	// });
545
546	if ($(".online-sections").length > 0) {
547		var code = location.href.split("#");
548		code = code[1];
549
550		if (code) {
551			var category = $(".spec-section-a[data-code=" + code + "]");
552
553			var title = category.text();
554			var section = category.data("section");
555
556			$(".spec-section-a__active_").text(title);
557
558			$(".group_toggle").hide();
559			$(".group_toggle[data-groups~=sect" + section + "ion]").css("display", "flex");
560		}
561	}
562
563	$(".online-sections .spec-section-a").click(function (e) {
564		e.preventDefault();
565
566		var title = $(this).text();
567		var section = $(this).data("section");
568
569		$(".online-sections .spec-section-a").removeClass("active");
570		$(this).addClass("active");
571
572		$(".spec-section-a__active_").text(title);
573
574		if (section == 0) {
575			$(".group_toggle").css("display", "flex");
576			location.href = "#";
577		} else {
578			$(".group_toggle").hide();
579			$(".group_toggle[data-groups~=sect" + section + "ion]").css("display", "flex");
580
581			location.href = "#" + $(this).data("code");
582		}
583	});
584
585	$(".date-arrow").click(function () {
586		if ($(this).hasClass("active")) {
587			$(".date-arrow, .week-list li, .doctor_schedule li, .week-date").toggleClass("active");
588		}
589	});
590
591	/*******************************************************/
592	// выбор города в записи
593	/*******************************************************/
594
595	$(".city-select-item[data-yar]").on("click", function () {
596		$(".shedule_line-wrap").css("display", "flex");
597		$('.shedule_line-wrap[data-clinic="63464"]').css("display", "none");
598		$(".city-select-item[data-ryb]").removeClass("active");
599		$(".city-select-item[data-yar]").addClass("active");
600		$(".ryb-discont").hide();
601	});
602
603	$(".city-select-item[data-ryb]").on("click", function () {
604		$(".shedule_line-wrap").css("display", "none");
605		$('.shedule_line-wrap[data-clinic="63464"]').css("display", "flex");
606		$(".city-select-item[data-ryb]").addClass("active");
607		$(".city-select-item[data-yar]").removeClass("active");
608		$(".ryb-discont").show();
609	});
610
611	if (window.location.href.indexOf("city=rybinsk") > -1) {
612		$(".city-select-item[data-ryb]").click();
613		$(".city-select").hide();
614	}
615
616	// $('.date-left-arrow').click(function(){
617	//     if($(this).hasClass('active')) {
618	//         $(this).removeClass('active');
619	//         $('.date-right-arrow').addClass('active');
620
621	//         $('.right-date-1, .left-date-1').hide();
622	//         $('.right-date, .left-date').show();
623
624	//         $('.doctor_schedule li, .week-list li').hide();
625	//         $('.doctor_schedule li, .week-list li').not('.next-week').show();
626	//     }
627	// })
628
629	// $('.date-right-arrow').click(function(){
630	//      if($(this).hasClass('active')) {
631	//         $(this).removeClass('active');
632	//          $('.date-left-arrow').addClass('active');
633
634	//         $('.right-date-1, .left-date-1').show();
635	//         $('.right-date, .left-date').hide();
636
637	//         $('.doctor_schedule li, .week-list li').hide();
638	//         $('.doctor_schedule li.next-week, .week-list li.next-week').show();
639	//     }
640	// })
641
642	function find(array, value) {
643		for (var i = 0; i < array.length; i++) {
644			if (array[i] === value) return i;
645		}
646
647		return -1;
648	}
649
650	// виджет заявки
651
652	$(document).on("click", ".feedback-widget", function (e) {
653		e.preventDefault;
654		$.fancybox.open([
655			{
656				href: $(this).attr("href") + "?ajax-mode=Y",
657				type: "ajax",
658				maxWidth: 640,
659				padding: [30, 30, 30, 30],
660				helpers: {
661					overlay: {
662						locked: false,
663					},
664				},
665			},
666		]);
667		return false;
668	});
669
670	$("a[role=button]").click(function () {
671		$(".panel-collapse#" + $(this).attr("aria-controls")).slideToggle();
672		return false;
673	});
674
675	// PRICE LIST NEW
676
677	$(document).on("click", ".price__new-section", function () {
678		var groupID = $(this).data("id");
679		$(".price__new-content").load("/ajax/get_price_categories.php?ID=" + groupID, function () {
680			if ($(".get-category-list").length == 1) {
681				$(".get-category-list").trigger("click");
682			}
683			history.pushState("", "", "/price-list/?g=" + groupID);
684		});
685		$(".price__new-section").removeClass("active");
686		$(this).addClass("active");
687
688		$(".price__new .h2").text($(this).text());
689
690		return false;
691	});
692
693	$(document).on("click", ".get-category-list", function () {
694		var obj = $(this);
695		var parentID = $(".price__new-section.active").data("id");
696		var groupID = $(this).data("id");
697
698		if (obj.children().length > 0) {
699			obj.toggleClass("active");
700			obj.children().eq(0).slideToggle();
701		} else {
702			obj.addClass("loading");
703			obj.append("<div></div>");
704			obj
705				.children()
706				.eq(0)
707				.load("/ajax/get_price_category.php?ID=" + groupID, function () {
708					obj.removeClass("loading");
709					obj.children().eq(0).slideDown();
710					obj.addClass("active");
711					history.pushState("", "", "/price-list/?g=" + parentID + "&s=" + groupID);
712				});
713		}
714
715		$("html, body").animate({ scrollTop: obj.offset().top - 40 }, 500);
716
717		if (obj.hasClass("active")) {
718			history.pushState("", "", "/price-list/?g=" + parentID + "&s=" + groupID);
719		} else {
720			history.pushState("", "", "/price-list/?g=" + parentID);
721		}
722
723		return false;
724	});
725
726	if ($(".price__new-sections").length > 0 && window.location.search.indexOf("?g=") == -1) {
727		$(".price__new-sections").children(".price__new-section").first().trigger("click");
728	}
729
730	if ($(".get-category-list.active").length > 0 && window.location.search.indexOf("&s=") !== -1) {
731		$(".get-category-list.active").trigger("click");
732		setTimeout(function () {
733			$("html, body").animate({ scrollTop: $(".get-category-list.active").offset().top - 40 }, 500);
734			console.log($(".get-category-list.active").offset().top);
735		}, 1000);
736	}
737
738	// вынесено из ЛК
739
740	$(".payment-docs [data-field]").change(function () {
741		if ($("[data-field]:checked").length == 3) {
742			$(".go-pay").removeClass("disabled");
743		}
744	});
745
746	$(".covidPay").on("click", ".go-pay", function (e) {
747		if ($(this).hasClass("disabled")) {
748			e.preventDefault();
749			return false;
750		} else {
751			e.preventDefault();
752			var form = $(this).parents("form");
753			var flag = 0;
754
755			form.find("[data-require]").removeClass("red");
756
757			form.find("[data-require]").each(function () {
758				if (!$.trim($(this).val())) {
759					$(this).addClass("red");
760					flag++;
761				}
762			});
763			if (flag == 0) {
764				form.submit();
765				console.log("Я отправляюсь");
766			} else {
767				console.log("Ошибки");
768				return false;
769			}
770		}
771	});
772
773	$(".faq-box h3").on("click", function () {
774		$(this).toggleClass("active").next("div").slideToggle();
775	});
776
777	$(".spoilers-wrap h3").on("click", function () {
778		$(this).toggleClass("active").next("div").slideToggle();
779	});
780
781	// ОГЛАВЛЕНИЕ
782
783	if ($(".ancor__parent").length > 0) {
784		$(".ancor__parent").prepend('<div class="ancors__list"></div>');
785
786		let ancors = "";
787
788		var n = 0;
789		$(".ancor__parent h2").each(function (i) {
790			n = i + 1;
791			ancors += '<div class="ancor__item">' + n + ". " + $(this).text() + "</div>";
792			$(this).addClass("ancor__target");
793		});
794
795		if ($("#servi-prices").length > 0) {
796			n++;
797			ancors += '<div class="ancor__item">' + n + ". Цены</div>";
798			$("#servi-prices").addClass("ancor__target");
799		}
800
801		$(".ancors__list").html(ancors).prepend("<h2>Содержание</h2>");
802
803		$(".ancor__item").on("click", function (e) {
804			$("body, html").animate({ scrollTop: $(".ancor__target").eq($(this).index(".ancor__item")).offset().top }, 500);
805		});
806	}
807
808	$("[data-tab-target]").click(function () {
809		$("[data-tab-target]").removeClass("active");
810		$(this).addClass("active");
811
812		$("[data-tab-content]").removeClass("active");
813		$("[data-tab-content=" + $(this).data("tab-target") + "]").addClass("active");
814	});
815
816	// карты
817
818	if ($(".rybinsk__map").length) {
819		ymaps.ready(mapInit);
820
821		function mapInit() {
822			var myMap = new ymaps.Map("rybinsk-map", {
823				center: [58.049078, 38.844186],
824				zoom: 13,
825				controls: ["zoomControl"],
826			});
827			var officePlacemark = new ymaps.Placemark(
828				[58.049078, 38.844186],
829				{
830					hintContent: "",
831					balloonContent: "",
832				},
833				{
834					iconLayout: "default#image",
835					iconImageHref: "/services/rybinsk/map.svg",
836					iconImageSize: [60, 80],
837					iconImageOffset: [-30, -80],
838				},
839			);
840
841			myMap.geoObjects.add(officePlacemark);
842		}
843	}
844
845	$(".js-form").on("click", function () {
846		let modalId = "form";
847		if ($(this).data("modal")) {
848			modalId = $(this).data("modal");
849		}
850		modalShow(modalId);
851	});
852
853  // if(isMobile()) {
854  //   $(".js-form").attr("href", "tel:+74852588828");
855  // } else {
856  //   $(".js-form").attr("href", "tel:+74852588828").text("Запись по телефону +7 4852 58-88-28");
857  // }
858	
859
860	function modalShow(modalId) {
861		$("#modal-" + modalId).show();
862		$("#openModal").addClass("open");
863		$("html").addClass("overflow");
864
865		$(document).on("click", ".modal-close", function (event) {
866			$("#openModal").removeClass("open");
867			$("html").removeClass("overflow");
868			setTimeout(function () {
869				$("#modal-" + modalId).hide();
870			}, 350);
871		});
872	}
873
874	$(document).on("click", ".form-submit", function (e) {
875		var flag = 0;
876		e.preventDefault();
877		var curObj = $(this);
878		var form = curObj.closest("form");
879		$(".input-error").hide();
880		$(".form-success").removeClass("active");
881
882		form.find("[data-required]").each(function () {
883			if ($(this).val() == "") {
884				$(this).next(".input-error").show();
885				flag++;
886			}
887		});
888
889		form.find("[data-required-checkbox]").each(function () {
890			if (!$(this).prop("checked")) {
891				$(this).closest("label").next('[data-error="checkbox"]').show();
892				flag++;
893			}
894		});
895
896		if (flag == 0) {
897			var t = $("input[name=PHONE]").val();
898			var n = $("input[name=NAME]").val();
899			t = t.replace(/[^0-9]/gim, "").slice(1);
900
901			if (t.length == 10) {
902				$.ajax({
903					url: "https://web.ymc.ru/call",
904					method: "POST", // Современный аналог type: "post"
905					data: { number: t, name: "" },
906					cache: false,
907					success: function (res, textStatus, xhr) {
908						// Сюда код попадет только при статусе 200 (или других 2xx)
909						console.log("ответ 200", res);
910
911						// Приводим к строке на случай, если сервер вдруг вернет JSON или число
912						const responseText = String(res);
913
914						if (responseText.indexOf("Ждите звонка!") > -1) {
915							$(".form-success").addClass("active");
916
917							setTimeout(function () {
918								$(".form-success").removeClass("active");
919								// Убедитесь, что переменная form существует в этой области видимости!
920								form.find("input[type='text'], textarea").val("");
921								form.find(".checkbox").removeClass("active");
922								$("#openModal").removeClass("open");
923								$("html").removeClass("overflow");
924
925								setTimeout(function () {
926									$("#modal-form").hide();
927								}, 350);
928							}, 5000);
929						} else {
930							console.log("Неожиданный ответ сервера: ", res);
931						}
932					},
933					error: function (xhr, textStatus, errorThrown) {
934						// Сюда код попадет при статусах 4xx (403, 404) и 5xx
935						if (xhr.status === 403 || xhr.status === 404) {
936							alert("Ошибка " + xhr.status);
937						} else {
938							console.log("Произошла ошибка сети или сервера: ", xhr.status, errorThrown);
939							// Можно добавить универсальное сообщение для пользователя, например:
940							// alert('Произошла ошибка при отправке. Попробуйте позже.');
941						}
942					},
943				});
944			}
945		} else {
946			return false;
947		}
948	});
949	// $(document).on('click','.get-category-list',function(e){
950	//              e.preventDefault;
951	//              $.fancybox.open([ {
952	//                  href: $(this).attr('href'),
953	//                  type: 'ajax',
954	//                  padding: [30,30,30,30],
955	//                  helpers: {
956	//                      overlay: {
957	//                          locked: false
958	//                      }
959	//                  }
960	//              }]);
961	//              return false;
962	//          });
963});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.