1 $(document).ready(function() { 2 3 $('#videoPlaceholder').click(function (event) { 4 var videoSrc = 'https://www.youtube.com/embed/NWyLFxcxyy0?autoplay=1'; 5 event.preventDefault(); 6 $(this).html('<iframe width="100%" height="247" src="' + videoSrc + '" frameborder="0" allowfullscreen></iframe>') 7}) 8 9 $('.article-slider').owlCarousel({ 10 items: 1, 11 //autoHeight: true, 12 dots: false, 13 //autoHeight: true, 14 //loop: true, 15 nav: true, 16 responsiveClass: true, 17 responsive: { 18 0: { 19 items: 1, 20 dotsClass: 'owl-dots container' 21 }, 22 768: { 23 items: 2, 24 dotsClass: 'owl-dots container', 25 //dots: true, 26 }, 27 1000: { 28 items: 4, 29 } 30 } 31 }); 32 33 $('.owl-main-box.flex-row').owlCarousel({ 34 items: 1, 35 //autoHeight: true, 36 dots: false, 37 //autoHeight: true, 38 //loop: true, 39 nav: true, 40 responsiveClass: true, 41 responsive: { 42 0: { 43 items: 1, 44 dotsClass: 'owl-dots container' 45 }, 46 768: { 47 items: 2, 48 dotsClass: 'owl-dots container', 49 //dots: true, 50 }, 51 1000: { 52 items: 3, 53 } 54 } 55 }); 56 57 $('.reviews-container-slider').owlCarousel({ 58 items: 1, 59 //autoHeight: true, 60 dots: false, 61 nav: true, 62 autoHeight: true, 63 loop: true, 64 responsiveClass: true, 65 responsive: { 66 0: { 67 items: 1, 68 }, 69 768: { 70 items: 1, 71 nav: true, 72 //dots: false, 73 }, 74 } 75 }); 76 77 $('.reviews-container-slider .review-button_showhidden').click(function () { 78 var text = $(this).prev('.review-content'); 79 if(text.is(':hidden')) { 80 $(this).text("СвеÑнÑÑÑ Ð¾ÑзÑв"); 81 } 82 else { 83 $(this).text("РаÑкÑÑÑÑ Ð¾ÑзÑв"); 84 } 85 $(this).toggleClass('active'); 86 text.slideToggle(300); 87 }) 88 89 $('.custom-programs-list').owlCarousel({ 90 items: 4, 91 //autoHeight: true, 92 margin: 10, 93 dots: false, 94 nav: true, 95 autoHeight: true, 96 loop: false, 97 responsiveClass: true, 98 responsive: { 99 0: { 100 items: 1, 101 }, 102 768: { 103 items:2, 104 nav: true, 105 mouseDrag: true, 106 touchDrag: true, 107 }, 108 1200: { 109 items: 4, 110 mouseDrag: false, 111 touchDrag: false, 112 }, 113 } 114 }); 115 116 $('.custom-treatment__slider').owlCarousel({ 117 items: 1, 118 dots: true, 119 nav: false, 120 loop: true, 121 responsiveClass: true, 122 }); 123 124 /* main slick */ 125 $('.slider-for').slick({ 126 slidesToShow: 1, 127 slidesToScroll: 1, 128 arrows: false, 129 fade: true, 130 asNavFor: '.slider-nav' 131}); 132$('.slider-nav').slick({ 133 slidesToShow: 4, 134 slidesToScroll: 1, 135 asNavFor: '.slider-for', 136 dots: false, 137 centerMode: false, 138 focusOnSelect: true 139}); 140 141 /* main slick */ 142 /* main tab */ 143 //Vertical Tab 144 $('#parentVerticalTab').easyResponsiveTabs({ 145 type: 'vertical', //Types: default, vertical, accordion 146 width: 'auto', //auto or any width like 600px 147 fit: true, // 100% fit in a container 148 closed: 'accordion', // Start closed if in accordion view 149 tabidentify: 'hor_1', // The tab groups identifier 150 activate: function(event) { // Callback function if tab is switched 151 var $tab = $(this); 152 var $info = $('#nested-tabInfo2'); 153 var $name = $('span', $info); 154 $name.text($tab.text()); 155 $info.show(); 156 } 157 }); 158 /* main tab */ 159 //Vertical Tab 160 $('#parentVerticalTab2').easyResponsiveTabs({ 161 type: 'vertical', //Types: default, vertical, accordion 162 width: 'auto', //auto or any width like 600px 163 fit: true, // 100% fit in a container 164 closed: 'accordion', // Start closed if in accordion view 165 tabidentify: 'hor_2', // The tab groups identifier 166 activate: function(event) { // Callback function if tab is switched 167 var $tab = $(this); 168 var $info = $('#nested-tabInfo2');
169 var $name = $('span', $info); 170 $name.text($tab.text()); 171 $info.show(); 172 } 173 }); 174 /* main tab */ 175 176 }); 177 178$(document).ready(function() { 179 $( ".toggle-content__head" ).click(function(event) { 180 if (!event.detail || event.detail == 1) { 181 $(this).toggleClass('toggle-active'); 182 $(this).find('.toggle-content__btn').toggleClass('hide-btn'); 183 $(this).closest('.toggle-content').find( ".toggle-content__body" ).toggle( "slow" ); 184 } 185 }); 186}); 187/* 188$(document).ready(function() { 189 $('.toggle-content__head').click(function(event) { 190 if (!event.detail || event.detail == 1) { 191 $(this).find('.toggle-content__btn').toggleClass('hide'); 192 $(this).closest('.toggle-content').find('.toggle-content__body').first().slideToggle(); 193 } 194 }); 195});*/ 196 197 198/*g-rcaptcha*/ 199function capcha_filled() { 200 $('._input .feild_wrapper').removeClass('wrong'); 201} 202 203$(document).ready(function () { 204 205 206 $('.footer-city-show').on('click', function () { 207 208 $.fancybox({ 209 type: 'inline', 210 padding: 0, 211 href: '.city-show', 212 scrolling: 'visible' 213 }); 214 215 }); 216 217 /* sidebar reviews slider height */ 218 219 var $height = "1"; 220 $('.review-btn').on('click', function () { 221 $(this).closest('.review-item').find('.review-content-more').toggleClass('show-review'); 222 if ($(this).text() == "ÐодÑобнее") { 223 $(this).text("СкÑÑÑÑ"); 224 $height = $(this).closest('.owl-height').css("height"); 225 $(this).closest('.owl-height').css( "height", "auto" ); 226 } 227 else { 228 $(this).text("ÐодÑобнее"); 229 $(this).closest('.owl-height').css( "height", $height); 230 } 231 console.log($height); 232 //var height = $(this).closest('.owl-height').css("height") 233 //$(this).closest('.owl-height').css( "height", "auto" ); 234 }); 235 236 /**** form *****/ 237 238 $('.custom_form_submit .submit').on('click', function () { 239 if($(".SIMPLE_FORM_8 textarea").val()){ 240 $(".SIMPLE_FORM_8 textarea").empty(); 241 } 242 243 var input_url = $(location).attr('href'); 244 $('.input_url').val(input_url) 245 246 /*var $form = $(this).closest('form'); 247 var action = $form.data('target'); 248 249 var rules = Object(); 250 251 var inputs = $form.find('input[data-rules="required"]');*/ 252 253 var validate = true; 254 255 256 // if (!validate) return; 257 258 $(this).closest('form').find('.custom_form_input_js input.required').each(function () { 259 260 var input_ = $(this).val(); 261 if (!input_.length){ 262 validate = false; 263 } else { 264 //validate = true; 265 } 266 }); 267 268 console.log(validate); 269 if(validate){ 270 271 $(this).closest('form').find('.custom_form_input_js').each(function () { 272 var label = $(this).find('.ask-form_label').text(); 273 var input = $(this).find('.ask-form_input input').val(); 274 var radioValue = $(this).find(".checkbox-block input:checked").val(); 275 276 277 278 //console.log(label); 279 $(".SIMPLE_FORM_8 textarea").append(label).append('\n'); 280 if(input){ 281 282 //console.log(input); 283 $(".SIMPLE_FORM_8 textarea").append(input).append('\n'); 284 285 } 286 if(radioValue){ 287 //console.log(radioValue); 288 $(".SIMPLE_FORM_8 textarea").append(radioValue).append('\n'); 289 } 290 $(".SIMPLE_FORM_8 textarea").append('\n'); 291 292 }); 293 294 $('.custom_form').find('input.required').each(function () { 295 296 setTimeout(function(){$('input.required').val('') }, 3000); 297 }); 298 $('.SIMPLE_FORM_8 .j_go').click(); 299 300 301 302 } 303 304 305 306 }); 307 308 /**** form *****/ 309 310$('.article-faq_caption').on('click', function () { 311 $(this).toggleClass('active'); 312}) 313 314 /**/ 315 316 $(window).on('resize', function(){ 317 if($(window).width() <= 767) { 318 $('.content_info_icons .content_info_slider').addClass('slide_it'); 319 $('.content_info_icons .content_info_icons.content_info_slider').trigger('initialized.owl.carousel'); 320 } 321 else { 322 $('.content_info_icons .content_info_slider').removeClass('slide_it'); 323 $('.content_info_icons .content_info_slider').trigger('destroy.owl.carousel'); 324 } 325 }).trigger('resize'); 326 /**/ 327 /**/ 328 329 $(window).on('resize', function(){ 330 if($(window).width() <= 767) {
331 $('.photos .photos-list').addClass('slide_it'); 332 $('.photos .photos-list').trigger('initialized.owl.carousel'); 333 } 334 else { 335 $('.photos .photos-list').removeClass('slide_it'); 336 $('.photos .photos-list').trigger('destroy.owl.carousel'); 337 } 338 }).trigger('resize'); 339 /**/ 340 341 342 343 if ($(window).width > 767) { 344 var maxHeight = 0; 345 $('.services-item').each(function () { 346 if ($(this).height() > maxHeight) { 347 maxHeight = $(this).height(); 348 } 349 }); 350 } 351 352 $('.banner-title_text').on('click', function () { 353 if ($('body').width() < 470) { 354 $(this).closest('.banner-program').find('.banner-program_item').each(function () { 355 $(this).removeClass('active'); 356 }); 357 $(this).closest('.banner-program_item').addClass('active'); 358 } 359 }); 360 361 $('.price-tbl_detail').on('click', function () { 362 $(this).find('.price-tbl_name span').toggleClass('active'); 363 var container = $(this).find('.price-tbl_description'); 364 if (container.is(":hidden")) { 365 container.slideDown(300); 366 } else { 367 container.slideUp(300); 368 } 369 }); 370 $('.article-faq_caption').on('click', function () { 371 var container = $(this).next('.article-faq_content'); 372 if (container.is(":hidden")) { 373 container.slideDown(300); 374 } else { 375 container.slideUp(300); 376 } 377 }); 378 379 $(".services-item").height(maxHeight); 380 $(".fancybox").fancybox(); 381 $(window).scroll(function () { 382 if ($('body').width() <= 768) { 383 if ($(window).scrollTop() == 0) $('.menu').css('top', '79px'); 384 if ($(window).scrollTop() > 0) { 385 if (!$('.header-logo').is(':hidden')) $('.header-logo').slideUp(); 386 $('.menu').css('top', '0'); 387 $('.header').addClass('shadow') 388 389 } else $('.header-logo').slideDown(); 390 391 392 } 393 if ($('body').width() < 768) { 394 if ($(window).scrollTop() > 0) { 395 $('.header').css('height', '75px'); 396 } 397 if ($(window).scrollTop() == 0) { 398 $('.header').css('height', '100%'); 399 } 400 } 401 }); 402 403 /*$(".menu-main li.parent > a").click(function (event) { 404 if ($('body').width() < 768) { 405 event.preventDefault(); 406 var parent = $(this).closest('li'); 407 parent.toggleClass('active'); 408 } 409 });*/ 410 411 $('.page-menu .parent .item-selected').each(function () { 412 var parent = $(this).closest('.parent').find('ul'); 413 parent.addClass('active'); 414 /*console.log(parent); 415 console.log('---');*/ 416 var span = $(this).closest('.parent').find('span'); 417 var root = $(this).parents('.parent').find('.root-item'); 418 root.next('span').first().next('ul').slideDown(); 419 root.next('span').first().addClass('active'); 420 if ($(this).hasClass('parent')) { 421 parent.slideDown(); 422 span.addClass('active'); 423 } 424 }); 425 426 /* $('.page-menu .parent span').on('click', function () { 427 var content = $(this).next('ul'); 428 if (content.is(':hidden')) { 429 content.slideDown(); 430 $(this).addClass('active'); 431 } else { 432 content.slideUp(); 433 $(this).removeClass('active'); 434 } 435 });*/ 436 $('.page-services .page-menu .parent').each(function () { 437 if ($(this).find('a').hasClass('root-item-selected')) { 438 $(this).find('span').first().next('ul').slideDown(); 439 $(this).find('span').first().addClass('active'); 440 } 441 }) 442 443 $('.menu-main li.parent span').on('click', function () { 444 var content = $(this).next('ul'); 445 if (content.is(':hidden')) { 446 if ($(this).closest('li').hasClass('lvl1')) { 447 $('.menu-main li.lvl1').each(function () { 448 if (!$(this).find('ul').is(':hidden')) { 449 $(this).find('span').click(); 450 } 451 }); 452 } 453 content.slideDown(); 454 $(this).closest('li').addClass('active'); 455 $('.menu-main .parent > span').each(function () { 456 if ($(window).width() < 768) { 457 var link = $(this).siblings('a'); 458 var widthspan = $(window).width() - link.outerWidth(); 459 $(this).width(widthspan); 460 } 461 }); 462 } else { 463 content.slideUp(); 464 $(this).closest('li').removeClass('active'); 465 } 466 }); 467 468 469 $(document).on('click', '.tag-form_open', function () { 470 $.fancybox({ 471 type: 'inline', 472 padding: 0, 473 href: '.includeform', 474 scrolling: 'visible', 475 maxWidth: 500 476 }); 477 }); 478 479 $('a.btn_modal').fancybox(); 480 if ($('.navigation').height() > 0) { 481 var w = $('body').width(); 482 var n = $('.navigation .mainnav li.active').index(); 483 var i = $('.navigation .mainnav li').length; 484 485 if (w < 762 && i >= 7) { 486 var max = n + 3; 487 var min = n - 3; 488 if (min < 0) { 489 max = max + (min * -1); 490 min = 0; 491 } 492 if (max > i) { 493 var t = max - i; 494 max = i; 495 min = min - t; 496 } 497 if (max < i) $('.navigation .mainnav').append('<li class="more">...</li>'); 498 if (min > 1) $('.navigation .mainnav').prepend('<li class="more">...</li>'); 499 $('.navigation .mainnav li').slice(min, max).css("display", "inline-block"); 500 } 501 } 502 503 /* up button */ 504 505 $(window).scroll(function () { 506 if ($(this).scrollTop() > 0) { 507 $('.up-button,.header-up').fadeIn(); 508 } else { 509 $('.up-button,.header-up').fadeOut(); 510 } 511 }); 512 513 $('.up-button,.header-up').click(function () { 514 $('body,html').animate({ 515 scrollTop: 0 516 }, 400); 517 return false;
518 }); 519 520 $('table').each(function () { 521 $(this).wrap("<div class='table-scroll'><div class='table-wrap'></div></div>"); 522 $('.table-scroll').prepend('<div class="table-text-wrap"></div>'); 523 }); 524 525 if ($('.table-scroll').height() > 0) { 526 527 $(window).scroll(function () { 528 var sp = $('.table-text-wrap').offset().top - 57; 529 var end = sp + $('.table-scroll').height() - 57; 530 if ($(window).scrollTop() >= sp && $(window).scrollTop() <= end) { 531 if ($('.table-scroll').hasClass() == false) $('.table-scroll').addClass('fixed'); 532 } else $('.table-scroll').removeClass('fixed'); 533 }); 534 } 535 536 /**/ 537 538 $('.menu .mobile-open').on('click', function () { 539 var w = $('body').width(); 540 if (w < 768) { 541 var sub = $(this).closest('li').find('.menu-sub'); 542 if (sub.is(":hidden")) { 543 sub.slideDown(600); 544 $(this).addClass("active"); 545 } else { 546 sub.slideUp(600); 547 $(this).removeClass("active"); 548 } 549 } 550 }); 551 552 $('.menu .mob-open').on('click', function (e) { 553 e.stopPropagation(); 554 e.preventDefault(); 555 556 var w = $('body').width(); 557 if (w < 768) { 558 var sub = $(this).closest('li').find('.menu-page'); 559 if (sub.is(":hidden")) { 560 sub.slideDown(600); 561 $(this).addClass("active"); 562 } else { 563 sub.slideUp(600); 564 $(this).removeClass("active"); 565 } 566 } 567 }); 568 569 /* agreement */ 570 571 $(document).on('click', 'input[name=agreement]+label', function () { 572 var b = $(this).closest('form').find('.submit'); 573 var that = $(this).closest('form').find('input[name=agreement]'); 574 if (that.prop("checked")) { 575 b.addClass("disabled"); 576 b.removeClass("go"); 577 b.attr("title", "ÐÑ Ð´Ð¾Ð»Ð¶Ð½Ñ ÑоглаÑиÑÑÑÑ Ñ Ð¿Ð¾Ð»Ð¸Ñикой конÑиденÑиалÑноÑÑи"); 578 } else { 579 b.removeAttr("title"); 580 b.removeClass("disabled"); 581 b.addClass("go"); 582 } 583 }); 584 585 $(document).on('click', 'input[name=agreement2]+label', function () { 586 var b = $(this).closest('form').find('.submit'); 587 var that = $(this).closest('form').find('input[name=agreement2]'); 588 if (that.prop("checked")) { 589 b.addClass("disabled"); 590 b.removeClass("go2"); 591 b.attr("title", "ÐÑ Ð´Ð¾Ð»Ð¶Ð½Ñ ÑоглаÑиÑÑÑÑ Ñ Ð¿Ð¾Ð»Ð¸Ñикой конÑиденÑиалÑноÑÑи"); 592 } else { 593 b.removeAttr("title"); 594 b.removeClass("disabled"); 595 b.addClass("go2"); 596 } 597 }); 598 599 600 /* search */ 601 602 $('.directory-search .example a').on('click', function (e) { 603 604 e.stopPropagation(); 605 e.preventDefault(); 606 607 var text = $(this).text(); 608 $(this).closest('.directory-search').find('input[name=q]').val(text); 609 }); 610 611 $('.directory-search.ajax input[type=text]').keyup(function () { 612 var v = $(this).val(); 613 var that = $(this).closest('.directory-search').find('.ajax-search-result'); 614 615 if (v.length >= 3) { 616 $.ajax({ 617 url: '/local/ajax/search.php', 618 data: {"q": v}, 619 type: 'post', 620 dataType: 'html', 621 success: function (data) { 622 that.slideDown(0); 623 that.html(data); 624 } 625 }); 626 } 627 }); 628 629 /* search-fixed-box */ 630 631 /* $('.header-search,.search-fixed-close,.header-search-mobile').on('click', function () { 632 /!*$('.search-fixed').toggleClass("active"); 633 $('body').toggleClass("open-search");*!/ 634 var content = $('.search-fixed'); 635 if (content.is(":hidden")) { 636 content.slideDown(0); 637 } else { 638 content.slideUp(0); 639 } 640 });*/ 641 642 $('.search-fixed-close,.header-search-mobile').on('click', function () { 643 /*$('.search-fixed').toggleClass("active"); 644 $('body').toggleClass("open-search");*/ 645 var content = $('.search-fixed'); 646 if (content.is(":hidden")) { 647 content.slideDown(0); 648 } else { 649 content.slideUp(0); 650 } 651 }); 652 653 /* link-nav */ 654 655 $("body").on('click', '[href*="#"]', function (e) { 656 var fixed_offset = 100; 657 $('html,body').stop().animate({scrollTop: $(this.hash).offset().top - fixed_offset}, 500); 658 e.preventDefault(); 659 }); 660 661 /* radio */ 662 663 $(document).on('click', '.ask-doctors .owl-item', function () { 664 var i = $(this).index(); 665 666 $('.radio-list').each(function () { 667 $(this).find('input[type=radio]').eq(i).prop("checked", true); 668 }); 669 }); 670 671 /* like button */ 672 673 $('.like').each(function () { 674 var id = $(this).data('elementid'); 675 if (localStorage.getItem('like' + id) == '1') $(this).addClass('active'); 676 }); 677 678 $('.like').on('click', function () { 679 var id = $(this).data('elementid'); 680 var n = +$(this).find('span').text(); 681 var inc = 1; 682 683 if ($(this).hasClass('active')) { 684 $(this).find('span').text(n - 1); 685 localStorage.setItem('like' + id, '0'); 686 inc = 0; 687 } else { 688 $(this).find('span').text(n + 1); 689 localStorage.setItem('like' + id, '1'); 690 } 691 $(this).toggleClass('active'); 692 693 $.ajax({ 694 url: '/local/ajax/like.php', 695 data: { 696 "ELEMENT_ID": id, 697 "INC": inc 698 }, 699 type: 'post', 700 dataType: 'JSON', 701 success: function (data) { 702 703 if (data.like != "") { 704 705 } 706 }, 707 error: function () { 708 alert("script was unsuccessful"); 709 } 710 }); 711 }); 712 713 /**/ 714 if ($('.page-navigation').is() != 0) { 715 var start_heigh = $('.page-navigation').height(); 716 var start = $('.page-navigation').offset().top + start_heigh; 717 $(window).scroll(function () { 718 if ($('body').width() < 992) { 719 $('.content-menu').height(start_heigh); 720 if ($(window).scrollTop() >= start) { 721 if ($('.page-navigation').hasClass() == false) $('.page-navigation').addClass('fixed'); 722 } else $('.page-navigation').removeClass('fixed'); 723 } 724 }); 725 } 726 ; 727 728 /* if ($('.page-navigation').size() != 0){ 729 var start_heigh = $('.page-navigation').height(); 730 var start = $('.page-navigation').offset().top + start_heigh; 731 $(window).scroll(function(){ 732 if ($('body').width() > 992 && window.screen.height < 768 ){ 733 $('.content-menu').height(start_heigh); 734 if ($(window).scrollTop()>=start) { 735 if ($('.page-navigation').hasClass()==false) $('.page-navigation').addClass('fixes'); 736 } 737 else $('.page-navigation').removeClass('fixes'); 738 } 739 }); 740 };*/ 741 if ($('.switch-2').height() > 0) { 742 743 $(window).scroll(function () { 744 var sw = $('.page-services').height() + 100; 745 var sp = $('.switch-2').offset().top - 57; 746 var inf = $('.information ').offset().top - 57; 747 var pn = $('.page-navigation').height(); 748 var end = sp + $('.switch-2').height() - pn; 749 if ($(window).scrollTop() >= sp + sw + inf && $(window).scrollTop() <= end) { 750 if ($('.page-navigation').hasClass() == false) $('.page-navigation').addClass('fixer'); 751 } else $('.page-navigation').removeClass('fixer'); 752 }); 753 } 754 ; 755 /* if ($('.page-navigation').size() != 0){ 756 var start_heigh = $('.page-navigation').height(); 757 var start = $('.page-navigation').offset().top + start_heigh; 758 $(window).scroll(function(){ 759 if ($('body').width() > 992 ){ 760 $('.content-menu').height(start_heigh); 761 if ($(window).scrollTop()>=start) { 762 if ($('.page-navigation').hasClass()==false) $('.page-navigation').addClass('fixer'); 763 } 764 else $('.page-navigation').removeClass('fixer'); 765 } 766 }); 767 }; 768 */ 769 770 $('.page-navigation_title').on('click', function () { 771 $(this).toggleClass('active'); 772 }); 773 $('.page-navigation a').on('click', function () { 774 $('.page-navigation_title').removeClass('active'); 775 }); 776 777 778 if ($('.content-menu').is() != 0 && $('body').width() > 768) { 779 var main_top = $('.content').offset().top; 780 var main_height = $('.content').height(); 781 var sidebar = $('.content-menu'); 782 var tempScrollTop, currentScrollTop = 0; 783 var navbar_h = 97; 784 785 if (sidebar.outerHeight() < main_height) { 786 787 $(window).on('scroll', function (e) { 788 789 currentScrollTop = $(window).scrollTop(); 790 791 if (tempScrollTop < currentScrollTop) { // down 792 793 if (sidebar.offset().top + sidebar.height() < currentScrollTop + $(window).height()) { 794 795 s_top = currentScrollTop - main_top + navbar_h; 796 if (s_top < 0) s_top = 0; 797 //s_top = currentScrollTop + $(window).height() - sidebar.height() - main_top; 798 799 if (s_top + sidebar.height() > main_height) { 800 s_top = main_height - sidebar.height(); 801 } 802 803 sidebar.css({top: s_top}); 804 805 } 806 807 } else if (tempScrollTop > currentScrollTop) // up 808 { 809 810 if (sidebar.offset().top > currentScrollTop) { 811 s_top = currentScrollTop - main_top + navbar_h; 812 if (s_top < 0) s_top = 0; 813 sidebar.css({top: s_top}); 814 815 } 816 817 } 818 819 tempScrollTop = currentScrollTop; 820 821 }); 822 823 } 824 825 } 826 827 $('.review-button_more').on('click', function () { 828 document.location.href = "/reviews/"; 829 }); 830 831 /* fixed menu */ 832 833 var start_pos = $('.menu').not(".fixed-menu").offset().top; 834 835 $(window).scroll(function () { 836 837 if ($(window).scrollTop() >= start_pos) { 838 $('.menu.fixed-menu').addClass('fixed'); 839 if ($(window).width() > 767) { 840 $('#fixed-menu-main-top').append($('#menu-main-top').find('.menu-main')); 841 } 842 } else { 843 $('.menu.fixed-menu').removeClass('fixed'); 844 if ($(window).width() > 767) { 845 $('#menu-main-top').append($('#fixed-menu-main-top').find('.menu-main')); 846 $('#fixed-menu-main-top').empty(); 847 } 848 } 849 850 }); 851 852 if ($('.banner-menu').height() > 0) { 853 var start = $('.banner-menu').offset().top - 46; 854 855 $(window).scroll(function () { 856 857 858 if ($(window).scrollTop() >= start) { 859 if ($('.banner-menu').hasClass() == false) $('.banner-menu').addClass('fixed'); 860 } else $('.banner-menu').removeClass('fixed'); 861 862 }); 863 } 864 865 //skroll 866 867 //$.scrollSpeed(100, 800, 'easeOutCubic'); 868 869 // mask 870 871 $("input[data-phone=phone]").mask("+7 (999) 999-9999"); 872 873 /*$('input[data-phone=phone]').each(function(){ 874 875 console.log('each'); 876 $(this).keyup(function(){ 877 console.log('change'); 878 var t = $(this).val(); 879 if(t = +7) $("input[data-phone=phone]").mask("+7 (999) 999-9999"); 880 }); 881 882 });*/ 883 884 /* var listCountries = $.masksSort($.masksLoad("/local/templates/narcoblok/js/mask/data/phone-codes.json"), ['#'], /[0-9]|#/, "mask"); 885 var maskOpts = { 886 inputmask: { 887 definitions: { 888 '#': { 889 validator: "[0-9]", 890 cardinality: 1 891 } 892 }, 893 showMaskOnHover: false, 894 autoUnmask: true, 895 clearMaskOnLostFocus: false 896 }, 897 match: /[0-9]/, 898 replace: '#', 899 listKey: "mask" 900 }; 901 var maskChangeWorld = function(maskObj, determined) { 902 if (determined) { 903 var hint = maskObj.name_ru; 904 if (maskObj.desc_ru && maskObj.desc_ru != "") {
905 hint += " (" + maskObj.desc_ru + ")"; 906 } 907 } 908 } 909 $('input[data-phone=phone]').inputmasks($.extend(true, {}, maskOpts, { 910 list: listCountries, 911 onMaskChange: maskChangeWorld 912 })); */ 913 914 // carousel 915 916 917 $('.slide_it').owlCarousel({ 918 items: 1, 919 autoHeight: true, 920 navContainerClass: 'owl-nav container hidden-xs', 921 dotsClass: 'owl-dots container' 922 }); 923 /******************************************/ 924 925 $('.main-slider_js').owlCarousel({ 926 items: 1, 927 autoHeight: true, 928 navContainerClass: 'owl-nav container hidden-xs', 929 dotsClass: 'owl-dots container' 930 }); 931 932 $('.reviews-carousel_js').owlCarousel({ 933 items: 1, 934 autoHeight: true, 935 nav: true, 936 dots: false, 937 navContainerClass: 'owl-nav container hidden-xs', 938 dotsClass: 'owl-dots container' 939 }); 940 941 var $inf_doc = $('.information-doctors_js').owlCarousel({ 942 items: 1, 943 autoHeight: true, 944 dots: false 945 }); 946 var $inf_doc = $('.information-cert_js').owlCarousel({ 947 items: 2, 948 autoHeight: true, 949 dots: false 950 }); 951 $('.doctor-box_js').owlCarousel({ 952 items: 1, 953 autoHeight: true, 954 dots: false, 955 autoHeight: true, 956 responsiveClass: true, 957 responsive: { 958 0: { 959 items: 1, 960 dotsClass: 'owl-dots container' 961 }, 962 500: { 963 items: 2, 964 dotsClass: 'owl-dots container' 965 }, 966 1000: { 967 items: 3, 968 dots: false 969 } 970 } 971 }); 972 /****************************************/ 973 var $inf_doc = $('.doctors-slider .flex-row').owlCarousel({ 974 items: 3, 975 autoHeight: true, 976 nav: true, 977 margin: 15, 978 dots: false, 979 responsive: { 980 0: { 981 items: 1, 982 }, 983 500: { 984 items: 2, 985 }, 986 1000: { 987 items: 3, 988 } 989 } 990 }); 991 /*$('.doctors-slider .flex-row').owlCarousel({ 992 items: 1, 993 autoHeight: true, 994 dots: false, 995 autoHeight: true, 996 responsiveClass: true, 997 responsive: { 998 0: { 999 items: 1, 1000 dotsClass: 'owl-dots container' 1001 }, 1002 670: { 1003 items: 2, 1004 dotsClass: 'owl-dots container' 1005 }, 1006 1000: { 1007 items: 3, 1008 dots: false 1009 } 1010 } 1011 });*/ 1012 /****************************************/ 1013 1014 var $smal_car = $('.small-carousel').owlCarousel({ 1015 items: 1, 1016 nav: false, 1017 navText: '', 1018 autoHeight: true 1019 }); 1020 1021 $('.ask-doctors').owlCarousel({ 1022 items: 3, 1023 nav: false, 1024 navText: '', 1025 loop: false, 1026 autoHeight: true, 1027 responsiveClass: true, 1028 responsive: { 1029 0: { 1030 items: 1, 1031 dotsClass: 'owl-dots container' 1032 }, 1033 500: { 1034 items: 2, 1035 dotsClass: 'owl-dots container' 1036 }, 1037 1000: { 1038 items: 3, 1039 dots: false 1040 } 1041 } 1042 }); 1043 1044 /* fix update images */ 1045 1046 if ($('.small-carousel')) { 1047 $('.small-carousel img').load(function () { 1048 $inf_doc.trigger('refresh.owl.carousel'); 1049 $smal_car.trigger('refresh.owl.carousel'); 1050 }); 1051 } 1052 1053 // end carousel 1054 // tabs 1055 1056 $('.tabs-js').on('click', 'li:not(.active)', function () { 1057 $(this) 1058 .addClass('active').siblings().removeClass('active') 1059 .closest('div.tabs-js').find('div.tabs__content').removeClass('active').eq($(this).index()).addClass('active'); 1060 }); 1061 1062 // end tabs 1063 1064 // show content 1065 1066 $('.services-item_mob').on('click', function (e) { 1067 $(this).closest('.services-item').find('.show-content').click(); 1068 }); 1069 $('.show-content').on('click', function (e) { 1070 1071 e.stopPropagation(); 1072 e.preventDefault(); 1073 1074 var text = $(this).find('span').text(); 1075 var span = $(this).find('span'); 1076 var that = $(this); 1077 var content = $(this).closest('.services-item.dark-grey').find('.hidden-content'); 1078 1079 1080 if (content.is(":hidden")) { 1081 span.data('text', text); 1082 content.show("slow"); 1083 $(this).closest('.services-item.dark-grey').addClass("show-active"); 1084 if ($(this).hasClass("show-main")){ 1085 span.text('СкÑÑÑÑ'); 1086 } else { 1087 span.text('СкÑÑÑÑ Ð¸Ð½ÑоÑмаÑиÑ'); 1088 } 1089 that.addClass('active'); 1090 } else { 1091 content.hide("slow"); 1092 $(this).closest('.services-item.dark-grey').removeClass("show-active"); 1093 if ($(this).hasClass("show-main")){ 1094 span.text('РаÑкÑÑÑÑ'); 1095 } else { 1096 span.text('РаÑкÑÑÑÑ Ð¿Ð¾Ð´Ñобнее'); 1097 } 1098 that.removeClass('active'); 1099 $('html, body').stop().animate({ 1100 scrollTop: content.offset().top - 100 1101 }, 600); 1102 } 1103 }); 1104 1105 1106 $('.information-more_box a').on('click', function (e) { 1107 1108 e.stopPropagation(); 1109 e.preventDefault(); 1110 1111 var text = $(this).find('span').text(); 1112 var span = $(this).find('span'); 1113 var that = $(this); 1114 var content = $(this).closest('.container').find('.hidden-content'); 1115 1116 if (content.is(":hidden")) { 1117 content.show("slow"); 1118 span.text('ÑкÑÑÑÑ Ð¸Ð½ÑоÑмаÑиÑ'); 1119 that.addClass('active'); 1120 } else { 1121 content.hide("slow"); 1122 span.text("ÐодÑобнее о клинике"); 1123 that.removeClass('active'); 1124 $('html, body').stop().animate({ 1125 scrollTop: content.offset().top - 100 1126 }, 600); 1127 } 1128 }); 1129 1130 $('.support-dsc_inf').on('click', function (e) { 1131 1132 e.stopPropagation(); 1133 e.preventDefault(); 1134 1135 if ($(this).next().is(":hidden")) { 1136 $(this).next().show("slow"); 1137 } else { 1138 $(this).next().hide("slow"); 1139 } 1140 }); 1141 1142 // end show content 1143 // menu 1144 1145 $('.open-menu').on('click', function () { 1146 $('.menu').addClass('js_display_block'); 1147 setTimeout(function () { 1148 $('.menu,.open-menu,body,.button-fixed').toggleClass('active'); 1149 $('.menu-main .parent > span').each(function () { 1150 if ($(window).width() < 768) { 1151 var link = $(this).siblings('a'); 1152 var widthspan = $(window).width() - link.outerWidth(); 1153 $(this).width(widthspan); 1154 } 1155 }); 1156 }, 10); 1157 }); 1158 1159 /*$('.menu-open').on('click',function(){ 1160 $('.menu-open').addClass('active'); 1161 $(this).closest('ul').find('.menu-open').each(function(){ 1162 $(this).removeClass('active'); 1163 }); 1164 }); 1165 1166 /* 1167 $('.menu .parent').on('click',function(e){ 1168 e.stopPropagation(); 1169 e.preventDefault(); 1170 if ($(this).find('.menu-sub').is(":hidden")) { 1171 $(this).find('.menu-sub').show("slow"); 1172 } else { 1173 $(this).find('.menu-sub').hide("slow"); 1174 } 1175 });*/ 1176 1177 // modal 1178 1179 $('.recall,.consultation_js').on('click', function () { 1180 1181 var name = $(this).text();
1182 //$('.recall-modal .modal-title').text(name); 1183 1184 $.fancybox({ 1185 type: 'inline', 1186 padding: 0, 1187 href: '.recall-modal', 1188 scrolling: 'visible' 1189 }); 1190 1191 }); 1192 1193 $('.price-tbl_button').on('click', function (e) { 1194 e.stopPropagation(); 1195 e.preventDefault(); 1196 1197 var title = $(this).data('title'); 1198 $('.services-modal .modal-dsc').text(title); 1199 $('.services-modal input[name=form_text_36]').val(title); 1200 1201 $.fancybox({ 1202 type: 'inline', 1203 padding: 0, 1204 href: '.services-modal', 1205 scrolling: 'visible' 1206 }); 1207 1208 }); 1209 1210 $('.information-enroll').on('click', function () { 1211 1212 var id = $(this).data('id'); 1213 var doctor = $(this).closest('.information-doctors_wrap').find('.owl-item.active .information-name').text(); 1214 var name = $(this).text(); 1215 1216 $('.doctors-modal .modal-title').text(name); 1217 $('.doctors-modal .select span').text($.trim(doctor)); 1218 $('.doctors-modal input.spec_doctor').val($.trim(doctor)); 1219 1220 $.fancybox({ 1221 type: 'inline', 1222 padding: 0, 1223 href: '.doctors-modal', 1224 scrolling: 'visible' 1225 }); 1226 1227 }); 1228 $('.check-bottom_button').on('click', function () { 1229 1230 var doctor = $('.check-bottom_name').text(); 1231 $('.ask-doctor_form input[type=radio]:checked').val(doctor); 1232 1233 $.fancybox({ 1234 type: 'inline', 1235 padding: 0, 1236 href: '.ask-doctor_form', 1237 scrolling: 'visible' 1238 }); 1239 1240 }); 1241 $('.dropdown').click(function () { 1242 $(this).attr('tabindex', 1).focus(); 1243 $(this).toggleClass('active'); 1244 $(this).find('.dropdown-menu').slideToggle(300); 1245 }); 1246 $('.dropdown').focusout(function () { 1247 $(this).removeClass('active'); 1248 $(this).find('.dropdown-menu').slideUp(300); 1249 }); 1250 $('.dropdown .dropdown-menu li').click(function () { 1251 $(this).parents('.dropdown').find('span').text($(this).text()); 1252 $(this).parents('.dropdown').find('input').attr('value', $(this).attr('id')); 1253 }); 1254 /* 1255 $('.consultation_js').on('click', function () { 1256 if ($(this).closest('.about-consultation-wrap').is() > 0) { 1257 var services = $(this).closest('.about-consultation-wrap') 1258 .find('input:radio:checked') 1259 .next('label').text(); 1260 1261 $('.consultation-modal .modal-dsc').text(services); 1262 } 1263 1264 $.fancybox({ 1265 type: 'inline', 1266 padding: 0, 1267 href: '.consultation-modal', 1268 scrolling: 'visible' 1269 }); 1270 1271 }); 1272 */ 1273 $('.lazy').lazy({ 1274 delay: 500, 1275 enableThrottle: true, 1276 throttle: 250 1277 }); 1278 $(':contains("#FORM#")').each(function () { 1279 1280 1281 $('.content_').html($('.content_').html().replace("#FORM#", '<div class="tag-form"> <div class="tag-form_open">ÐÑÑавиÑÑ Ð·Ð°ÑвкÑ</div> </div>')); 1282 }) 1283}); 1284 1285/* form */ 1286 1287(function ($) { 1288 $(function () { 1289 $(document).on('click', '.go', function (e) { 1290//console.log('data'); 1291 e.stopPropagation(); 1292 e.preventDefault(); 1293 1294 var $form = $(this).closest('form'); 1295 var action = $form.data('target'); 1296 1297 var rules = Object(); 1298 1299 var inputs = $form.find('input').add('textarea', $form.get(0)); 1300 1301 var validate = true; 1302 1303 inputs.each(function () { 1304 1305 var r = $(this).data('rules'); 1306 1307 if (r && r.length != 0) { 1308 1309 rules[$(this).attr('name')] = r; 1310 1311 r = r.split(','); 1312 1313 for (i = 0; i < r.length; i++) { 1314 var rule = r[i]; 1315 if (validator[rule]) { 1316 if (!validator[rule]($(this))) { 1317 validate = false; 1318 } 1319 } 1320 } 1321 } 1322 }); 1323 1324 if (!validate) return; 1325 if($(this).hasClass('new_form')){ return;} 1326 1327 var formData = new FormData($form[0]); 1328 1329 /* var btn = $(this).addClass('btn-desabled').removeClass('go');*/ 1330 1331 $.fancybox({ 1332 type: 'inline', 1333 padding: 0, 1334 href: '.success-modal', 1335 scrolling: 'visible' 1336 }); 1337 1338 $.ajax({ 1339 url: action, 1340 data: formData, 1341 processData: false, 1342 contentType: false, 1343 type: 'post', 1344 dataType: 'HTML', 1345 success: function (data) { 1346 /*btn.addClass('go').removeClass('btn-desabled');*/ 1347 $('.form input[type=text]').each(function () { 1348 $(this).val(""); 1349 }); 1350 $('.form input[type=tel]').each(function () { 1351 $(this).val(""); 1352 }); 1353 } 1354 }); 1355 $form[0].reset(); 1356 grecaptcha.reset(); 1357 return false;
1358 }); 1359 1360 $('input').add('textarea').on('focus', function () { 1361 $(this).parent() 1362 .removeClass('wrong'); 1363 }).each(function () { 1364 1365 if ($(this).data('rules') && !$(this).parent().hasClass('feild_wrapper')) { 1366 $(this).wrap('<div class="feild_wrapper"></div>'); 1367 $(this).parent().append('<span class="error_label"></span>'); 1368 } 1369 1370 }); 1371 1372 $('.capcha-1').text(getRandomInRange(10, 20)); 1373 $('.capcha-2').text(getRandomInRange(1, 9)); 1374 }); 1375 1376 1377 /* validator */ 1378 1379 var validator = { 1380 required: function ($i) { 1381 if ($i.val() == '' || $i.val() == $i.attr('placeholder')) { 1382 fieldError.call($i, lang.requiredError); 1383 1384 return false; 1385 } 1386 return true; 1387 }, 1388 email: function ($i) { 1389 1390 if ($i.val() == '') return true; 1391 1392 var r = new RegExp(".+@.+\..+", "i"); 1393 if (!r.test($i.val())) { 1394 fieldError.call($i, lang.emailError); 1395 return false; 1396 } 1397 return true; 1398 }, 1399 capcha: function ($i) { 1400 var capcha1 = Number.parseInt($i.closest('form').find('.capcha-1').text()); 1401 var capcha2 = Number.parseInt($i.closest('form').find('.capcha-2').text()); 1402 var capcha = capcha1 + capcha2; 1403 if (capcha != Number.parseInt($i.val())) { 1404 fieldError.call($i, lang.capcha); 1405 return false; 1406 } 1407 return true; 1408 }, 1409 grc: function ($i) { 1410 var captcha = grecaptcha.getResponse(); 1411 //var captcha = true; 1412 if (!captcha.length) { 1413 // ÐÑводим ÑообÑение об оÑибке 1414 //$('#recaptchaError').text('* ÐÑ Ð½Ðµ пÑоÑли пÑовеÑÐºÑ "Я не ÑобоÑ"'); 1415 fieldError.call($i, lang.grecaptcha); 1416 return false; 1417 } 1418 return true; 1419 }, 1420 phone: function ($i) { 1421 if (!$i.val().length > 10) { 1422 fieldError.call($i, lang.phoneError); 1423 return false; 1424 } 1425 return true; 1426 } 1427 } 1428 1429 var fieldError = function (message) { 1430 1431 if (!$(this).parent().hasClass('feild_wrapper')) { 1432 1433 $(this).wrap('<div class="feild_wrapper"></div>'); 1434 $(this).parent().append('<span class="error_label"></span>'); 1435 1436 } 1437 1438 $(this).parent().addClass('wrong'); 1439 $(this).siblings('.error_label').text(message); 1440 1441 return false; 1442 } 1443 1444 var lang = { 1445 success: 'ÐаÑа заÑвка ÑÑпеÑно оÑпÑавлена', 1446 error: 'ÐÑоизоÑла оÑибка, попÑобÑйÑе еÑе Ñаз', 1447 name: 'ÐмÑ', 1448 phone: 'ТелеÑон', 1449 email: 'Email', 1450 capcha: 'СÑмма ÑиÑел введена не веÑно', 1451 grecaptcha: 'ÐÑ Ð½Ðµ пÑоÑли пÑовеÑÐºÑ "Я не ÑобоÑ"', 1452 programs: 'ÐÑогÑаммÑ', 1453 requiredError: 'ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿ÑÑÑÑм', 1454 emailError: 'Ðоле Email должно ÑодеÑжаÑÑ ÐºÐ¾ÑÑекÑнÑй адÑеÑ', 1455 phoneError: 'УкажиÑе коÑÑекÑнÑй Ð½Ð¾Ð¼ÐµÑ ÑелеÑона' 1456 }; 1457})(jQuery); 1458 1459// libs 1460function getRandomInRange(min, max) { 1461 return Math.floor(Math.random() * (max - min + 1)) + min; 1462} 1463 1464window.mobilecheck = function () { 1465 var check = false; 1466 (function (a) { 1467 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1467sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true 1468 })(navigator.userAgent || navigator.vendor || window.opera); 1469 return check; 1470}; 1471 1472(function (e) { 1473 function t() { 1474 var e = document.createElement("input"), t = "onpaste"; 1475 return e.setAttribute(t, ""), "function" == typeof e[t] ? "paste" : "input" 1476 } 1477 1478 var n, a = t() + ".mask", r = navigator.userAgent, i = /iphone/i.test(r), o = /android/i.test(r); 1479 e.mask = { 1480 definitions: {9: "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]"}, 1481 dataName: "rawMaskFn", 1482 placeholder: "_" 1483 }, e.fn.extend({ 1484 caret: function (e, t) { 1485 var n; 1486 if (0 !== this.length && !this.is(":hidden")) return "number" == typeof e ? (t = "number" == typeof t ? t : e, this.each(function () { 1487 this.setSelectionRange ? this.setSelectionRange(e, t) : this.createTextRange && (n = this.createTextRange(), n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", e), n.select()) 1488 })) : (this[0].setSelectionRange ? (e = this[0].selectionStart, t = this[0].selectionEnd) : document.selection && document.selection.createRange && (n = document.selection.createRange(), e = 0 - n.duplicate().moveStart("character", -1e5), t = e + n.text.length), { 1489 begin: e, 1490 end: t 1491 }) 1492 }, unmask: function () { 1493 return this.trigger("unmask") 1494 }, mask: function (t, r) { 1495 var c, l, s, u, f, h; 1496 return !t && this.length > 0 ? (c = e(this[0]), c.data(e.mask.dataName)()) : (r = e.extend({ 1497 placeholder: e.mask.placeholder, 1498 completed: null 1499 }, r), l = e.mask.definitions, s = [], u = h = t.length, f = null, e.each(t.split(""), function (e, t) { 1500 "?" == t ? (h--, u = e) : l[t] ? (s.push(RegExp(l[t])), null === f && (f = s.length - 1)) : s.push(null) 1501 }), this.trigger("unmask").each(function () { 1502 function c(e) { 1503 for (; h > ++e && !s[e];) ; 1504 return e 1505 } 1506 1507 function d(e) { 1508 for (; --e >= 0 && !s[e];) ; 1509 return e 1510 } 1511 1512 function m(e, t) { 1513 var n, a; 1514 if (!(0 > e)) { 1515 for (n = e, a = c(t); h > n; n++) if (s[n]) { 1516 if (!(h > a && s[n].test(R[a]))) break; 1517 R[n] = R[a], R[a] = r.placeholder, a = c(a) 1518 } 1519 b(), x.caret(Math.max(f, e)) 1520 } 1521 } 1522 1523 function p(e) { 1524 var t, n, a, i; 1525 for (t = e, n = r.placeholder; h > t; t++) if (s[t]) { 1526 if (a = c(t), i = R[t], R[t] = n, !(h > a && s[a].test(i))) break; 1527 n = i 1528 } 1529 } 1530 1531 function g(e) { 1532 var t, n, a, r = e.which; 1533 8 === r || 46 === r || i && 127 === r ? (t = x.caret(), n = t.begin, a = t.end, 0 === a - n && (n = 46 !== r ? d(n) : a = c(n - 1), a = 46 === r ? c(a) : a), k(n, a), m(n, a - 1), e.preventDefault()) : 27 == r && (x.val(S), x.caret(0, y()), e.preventDefault()) 1534 } 1535 1536 function v(t) { 1537 var n, a, i, l = t.which, u = x.caret(); 1538 t.ctrlKey || t.altKey || t.metaKey || 32 > l || l && (0 !== u.end - u.begin && (k(u.begin, u.end), m(u.begin, u.end - 1)), n = c(u.begin - 1), h > n && (a = String.fromCharCode(l), s[n].test(a) && (p(n), R[n] = a, b(), i = c(n), o ? setTimeout(e.proxy(e.fn.caret, x, i), 0) : x.caret(i), r.completed && i >= h && r.completed.call(x))), t.preventDefault()) 1539 } 1540 1541 function k(e, t) { 1542 var n; 1543 for (n = e; t > n && h > n; n++) s[n] && (R[n] = r.placeholder) 1544 } 1545 1546 function b() { 1547 x.val(R.join("")) 1548 } 1549 1550 function y(e) { 1551 var t, n, a = x.val(), i = -1; 1552 for (t = 0, pos = 0; h > t; t++) if (s[t]) { 1553 for (R[t] = r.placeholder; pos++ < a.length;) if (n = a.charAt(pos - 1), s[t].test(n)) { 1554 R[t] = n, i = t; 1555 break 1556 } 1557 if (pos > a.length) break 1558 } else R[t] === a.charAt(pos) && t !== u && (pos++, i = t); 1559 return e ? b() : u > i + 1 ? (x.val(""), k(0, h)) : (b(), x.val(x.val().substring(0, i + 1))), u ? t : f 1560 } 1561 1562 var x = e(this), R = e.map(t.split(""), function (e) { 1563 return "?" != e ? l[e] ? r.placeholder : e : void 0 1564 }), S = x.val(); 1565 x.data(e.mask.dataName, function () { 1566 return e.map(R, function (e, t) { 1567 return s[t] && e != r.placeholder ? e : null 1568 }).join("") 1569 }), x.attr("readonly") || x.one("unmask", function () { 1570 x.unbind(".mask").removeData(e.mask.dataName) 1571 }).bind("focus.mask", function () { 1572 clearTimeout(n); 1573 var e; 1574 S = x.val(), e = y(), n = setTimeout(function () { 1575 b(), e == t.length ? x.caret(0, e) : x.caret(e) 1576 }, 10) 1577 }).bind("blur.mask", function () { 1578 y(), x.val() != S && x.change() 1579 }).bind("keydown.mask", g).bind("keypress.mask", v).bind(a, function () { 1580 setTimeout(function () { 1581 var e = y(!0); 1582 x.caret(e), r.completed && e == x.val().length && r.completed.call(x) 1583 }, 0) 1584 }), y() 1585 })) 1586 } 1587 }) 1588})(jQuery);
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.