1 2 3 4 5 6 7 8 9 10 11 12 13 14function getBrowser() { 15 var ua = navigator.userAgent; 16 var bName = function () { 17 if (ua.search(/Edge/) > -1) return "edge"; 18 if (ua.search(/MSIE/) > -1) return "ie"; 19 if (ua.search(/Trident/) > -1) return "ie11"; 20 if (ua.search(/Firefox/) > -1) return "firefox"; 21 if (ua.search(/Opera/) > -1) return "opera"; 22 if (ua.search(/OPR/) > -1) return "operaWebkit"; 23 if (ua.search(/YaBrowser/) > -1) return "yabrowser"; 24 if (ua.search(/Chrome/) > -1) return "chrome"; 25 if (ua.search(/Safari/) > -1) return "safari"; 26 if (ua.search(/maxHhon/) > -1) return "maxHhon"; 27 }(); 28 29 var version; 30 switch (bName) { 31 case "edge": 32 version = (ua.split("Edge")[1]).split("/")[1]; 33 break; 34 case "ie": 35 version = (ua.split("MSIE ")[1]).split(";")[0]; 36 break; 37 case "ie11": 38 bName = "ie"; 39 version = (ua.split("; rv:")[1]).split(")")[0]; 40 break; 41 case "firefox": 42 version = ua.split("Firefox/")[1]; 43 break; 44 case "opera": 45 version = ua.split("Version/")[1]; 46 break; 47 case "operaWebkit": 48 bName = "opera"; 49 version = ua.split("OPR/")[1]; 50 break; 51 case "yabrowser": 52 version = (ua.split("YaBrowser/")[1]).split(" ")[0]; 53 break; 54 case "chrome": 55 version = (ua.split("Chrome/")[1]).split(" ")[0]; 56 break; 57 case "safari": 58 //version = (ua.split("Version/")[1]).split(" ")[0]; 59 break; 60 case "maxHhon": 61 version = ua.split("maxHhon/")[1]; 62 break; 63 } 64 var platform = 'desktop'; 65 if (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())) platform = 'mobile'; 66 var browsrObj; 67 try { 68 browsrObj = { 69 platform: platform, 70 browser: bName, 71 versionFull: version, 72 versionShort: version.split(".")[0] 73 }; 74 } catch (err) { 75 browsrObj = { 76 platform: platform, 77 browser: 'unknown', 78 versionFull: 'unknown', 79 versionShort: 'unknown' 80 }; 81 } 82 return browsrObj; 83}; 84var browserYou = getBrowser(); 85if (browserYou.platform == 'mobile') { 86 isMobile = true; 87} 88if ((browserYou.browser == 'ie' && browserYou.versionShort < '10') || ((browserYou.browser == 'opera' || browserYou.browser == 'operaWebkit') && browserYou.versionShort < +'18') || (browserYou.browser == 'firefox' && browserYou.versionShort < +'30')) { 89 alert('ÐбновиÑе бÑаÑзеÑ', '') 90}; 91 92 93 94 95 96$(document).ready(function() { 97 $('.fancybox').fancybox(); 98 // modal 99 100 $(".modal").on("show.bs.modal", function() { 101 102 var $bodyWidth = $("body").width(); 103 104 $("body").css({ 'overflow-y': "hidden" }) 105 106 var padRight = $("body").width() - $bodyWidth; 107 108 $("body").css({ 'padding-right': padRight }); 109 110 $(".sticky").css({ 'padding-right': padRight }); 111 112 }); 113 114 $(".modal").on("hidden.bs.modal", function() { 115 116 $("body").css({ 'padding-right': "0", 'overflow-y': "auto" }); 117 118 $('.sticky').css('padding-right', "0"); 119 120 }); 121 122 // modal 123 124 $('.submit-fancy').live('click', function() { 125 126 $('a.fancybox-close').trigger('click'); 127 128 window.setTimeout(function() { $('.printBlock').trigger('click') }, 1000); 129 130 }); 131 var Mobile = false; 132 if (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())) Mobile = true; 133 if(Mobile == false) { 134 $('.js_scroll').jScrollPane(); 135 } 136 137 138 139 140 141//initialize swiper when document ready 142 143 var mySwiper = new Swiper('.slider-rev', { 144 145 // Optional parameters 146 147 // direction: 'vertical', 148 149 loop: true, 150 151 autoplay: 15000, 152 153 slidesPerView: 1, 154 autoHeight: true, 155 156 spaceBetween: 30, 157 158 speed: 700, 159 160 nextButton: '.swiper-button-next', 161 162 prevButton: '.swiper-button-prev', 163 164 }) 165 166 167 168 var mySwiper2 = new Swiper('.slider-min', { 169 170 // Optional parameters 171 172 // direction: 'vertical', 173 174 loop: false, 175 176 slidesPerView: 5, 177 178 speed: 700, 179 180 nextButton: '.swiper-button-next', 181 182 prevButton: '.swiper-button-prev', 183 184 // Responsive breakpoints 185 186 breakpoints: { 187 188 610: { 189 190 slidesPerView: 3, 191 192 } 193 194 } 195 196 }) 197 198 199 200 $(window).scroll(function() { 201 202 if($(window).scrollTop() + $(window).height() >
202 $(document).height() - $('#footer').height() - 65) { 203 204 $('.reviews-fixed').addClass('free'); 205 206 $('.block-reviews').addClass('active') 207 208 } 209 210 else { 211 212 $('.reviews-fixed').removeClass('free'); 213 214 $('.block-reviews').removeClass('active') 215 216 } 217 218 }); 219 220 221 222 //ÐеÑаÑÑ ÐºÐ°ÑÑÑ 223 224 $('.printBlock').click(function() { 225 226 /*$('body').addClass('printSelected'); //добавлÑем клаÑÑ 227 228 debugger 229 230 var a = $('.block_map a').attr('href'); 231 232 var b = $('.block_map img').attr('src'); 233 234 $('body').append("<div class='printSelection'></div>"); //Ñоздаем "пÑизÑаÑнÑй" блок Ð´Ð»Ñ Ð¿ÐµÑаÑи 235 236 $('.printSelection').html('<img src="'+$('div.logo img').attr('src')+'" > <span style="margin-left: 200px;font-style: normal;display: block;float: right;margin-top:40px;line-height: 24px;"> г. ХаÑÑков, Ñл. ШаÑилова даÑа 4, оÑ. 612 <br> Ñел.: (057) 751-85-90 </span><br>'+ $('.block_map img').attr('src',a)[0].outerHTML);//.attr('src',b)); // в Ñаблон пеÑаÑи добавлÑем ÑвеÑÑ Ñ Ð»Ð¾Ð³Ð¾Ñип компании 237 238 */ 239 240 //.clone().appendTo('.printSelection'); // вÑÑавлÑем в блок Ñо, ÑÑо нÑжно вÑвеÑÑи на пеÑаÑÑ (в данном ÑлÑÑае лиÑÑ ÐºÐ°ÑÑинкÑ) 241 242 //$('.block_map img').attr('src',b); 243 244 //$('.printSelection img') 245 246 247 248 249 250 251 252 // $('body').addClass('printSelected'); //добавлÑем клаÑÑ 253 254 // $('body').append("<div class='printSelection'></div>"); //Ñоздаем "пÑизÑаÑнÑй" блок Ð´Ð»Ñ Ð¿ÐµÑаÑи 255 256 // $('.block_map img').clone().appendTo('.printSelection'); // вÑÑавлÑем в блок Ñо, ÑÑо нÑжно вÑвеÑÑи на пеÑаÑÑ (в данном ÑлÑÑае лиÑÑ ÐºÐ°ÑÑинкÑ) 257 258 // $('.printSelection img').attr('src', $('.block_map a').attr('href')); 259 260 // $('.printSelection img').before('<img src="' + $('div.logo img').attr('src') + '" > <span style="margin-left: 200px;font-style: normal;display: block;float: right;margin-top:40px;line-height: 24px;">' + $(".js_print").text() + '<br>' + $(".js_print_phone").text() + '<span>'); // в Ñаблон пеÑаÑи добавлÑем ÑвеÑÑ Ñ Ð»Ð¾Ð³Ð¾Ñип компании 261 262 // window.setTimeout(function() { window.print(); }, 800); 263 264 // //; // вÑводи на пеÑаÑÑ 265 266 // window.setTimeout(function() { pageCleaner(); }, 1000);
266 // заÑиÑаем ÑÐ»ÐµÐ´Ñ 267 268 269 270 $('body').addClass('printSelected'); //добавлÑем клаÑÑ 271 272 $('body').append("<div class='printSelection'></div>"); //Ñоздаем "пÑизÑаÑнÑй" блок Ð´Ð»Ñ Ð¿ÐµÑаÑи 273 274 $('.block_map img').clone().appendTo('.printSelection'); // вÑÑавлÑем в блок Ñо, ÑÑо нÑжно вÑвеÑÑи на пеÑаÑÑ (в данном ÑлÑÑае лиÑÑ ÐºÐ°ÑÑинкÑ) 275 276 $('.printSelection img').attr('src', $('.block_map a').attr('href')); 277 278 $('.printSelection img').before('<img src="' + $('div.logo img').attr('src') + '" > <span style="margin-left: 200px;font-style: normal;display: block;float: right;margin-top:40px;line-height: 24px;">' + $(".js_print").text() + '<br>' + $(".js_print_phone").text() + '<span>'); // в Ñаблон пеÑаÑи добавлÑем ÑвеÑÑ Ñ Ð»Ð¾Ð³Ð¾Ñип компании 279 280 window.setTimeout(function() { window.print(); }, 800); 281 282 //; // вÑводи на пеÑаÑÑ 283 284 window.setTimeout(function() { pageCleaner(); }, 1000);
284 // заÑиÑаем ÑÐ»ÐµÐ´Ñ 285 286 287 288 }); 289 290 291 292 function pageCleaner() { 293 294 $('body').removeClass('printSelected'); 295 296 $('.printSelection').remove(); 297 298 } 299 300 //----------------------- 301 302 //start-gallery оÑÑеÑÑ Ð½Ð° главной 303 304 var owl = $(".slider_index"); 305 306 owl.owlCarousel({ 307 308 itemsCustom: [ 309 310 [0, 1], 311 312 [768, 2], 313 314 [992, 3], 315 316 [1169, 4], 317 318 ], 319 320 margin: 24, 321 322 navigation: true, 323 324 pagination: false 325 326 }); 327 328 //end-gallery оÑÑеÑÑ Ð½Ð° главной 329 330 //start-slider клиенÑÑ Ð½Ð° главной 331 332 $('.js_slider_client').owlCarousel({ 333 334 items: 5, 335 336 slideBy: 5, 337 338 itemsCustom: [ 339 340 [0, 1], 341 342 [600, 2], 343 344 [768, 3], 345 346 [991, 4], 347 348 [1199, 5], 349 350 ], 351 352 navigation: true, 353 354 pagination: false, 355 356 autoPlay: true, 357 358 autoplayTimeout: 3000 359 360 }); 361 362 //end-slider клиенÑÑ Ð½Ð° главной 363 364 $('.slider-people').owlCarousel({ 365 366 itemsCustom: [ 367 368 [0, 1], 369 370 [600, 2], 371 372 [768, 3], 373 374 [991, 4], 375 376 [1199, 5], 377 378 ], 379 380 navigation: false, 381 382 pagination: false, 383 384 autoPlay: true, 385 386 autoplayTimeout: 3000 387 388 }); 389 390 $('a[href=#modal_seminar]').click(function() { 391 392 document.seminar = $(this).prev().prev().text(); 393 394 $(".js_registration").attr("data-id", $(this).data("id")); 395 396 }); 397 398 399 400 //name="get_order[title]" 401 402 $('[data-ord-title]').on('click', function() { 403 404 var _ttl = $(this).attr('data-ord-title'); 405 406 $('[name="get_order[title]"]').val(_ttl); 407 408 }); 409 410 411 $("a[href='#modal_application']").click(function(){ga('send', 'event', 'Akcii', 'AkciiZayavka_enter', 'Akcia_zayavka_enter1');}) 412 413 414 //validation 415 416 $('.js_validate input[type="submit"]').bind("click", function() { 417 418 if (validate($(this).parents(".js_validate")) == true) { 419 420 var a = $(this).parents("form").serialize(); 421 422 var b = $(this).parents("div.main_modal").attr("id"); 423 // РегиÑÑÑаÑÐ¸Ñ Ð½Ð° ÑÐµÐ¼Ð¸Ð½Ð°Ñ 424 425 if($(this).parents("form").attr("data-id")){ 426 427 a += "&get_seminar[id]=" + $(this).parents("form").attr("data-id"); 428 429 } 430 431 //ÐÐ»Ñ Ð¾ÑÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¾Ñ ÑеминаÑов 432 433 if ($('div.heading_inside.heading_inside_m span').text() != '') { 434 435 a += "&info[page_name]=" + encodeURIComponent($('div.heading_inside.heading_inside_m span').text()); 436 437 } else { 438 439 a += "&info[page_name]=" + encodeURIComponent(document.seminar); 440 441 } 442 443 444 $.ajax({ 445 type: "POST", 446 data: a, 447 dataType: 'json', 448 success: function(resulr) { 449 ga('send', 'event', 'Akcii', 'AkciiZayavka', 'Akcia_zayavka_ok'); 450 //yaCounter29600305.reachGoal('knopka_otpravka_zayavki'); 451 fbq ('track', 'Lead'); 452 $(".js_registration").attr("data-id", ""); 453 $('.pass').removeClass("pass"); 454 if (resulr) { 455 if (resulr=="ÐонÑакÑÑ") { 456 dataLayer.push({'event': 'contact'}); 457 } 458 if (resulr.status == false && b == 'modal_write'){ 459 $('#modal_thanks_director span').html(''); 460 $('#modal_thanks_director span').html(resulr.message); 461 $('#modal_thanks_director').modal('show'); 462 } else if (resulr.status == true && b == 'modal_write') { 463 464 $('#footer, .text').val(''); 465 $('#modal_thanks_director span').html(''); 466 $('#modal_thanks_director span').html('ÐЯÐУÐÐÐ'); 467 $('#modal_thanks_director').modal('show'); 468 dataLayer.push({'event': 'write_leader'}); 469 } 470 if (resulr.status == false && b == 'some_form'){ 471 $('#modal_thanks span').html(''); 472 $('#modal_thanks span').html(resulr.message); 473 $('#modal_thanks').modal('show'); 474 return; 475 } else if (resulr.status == true && b == 'some_form') { 476 $('#modal_thanks span').html(''); 477 $('#modal_thanks span').html('ÐЯÐУÐÐÐ! ÐÐÐÐÐÐÐЧÐРЧÐСÐÐ Ð ÐÐÐÐ ÐÐ\'ЯÐÐТЬСЯ ÐÐÐÐÐÐÐÐ .'); 478 $('#modal_thanks').modal('show'); 479 dataLayer.push({'event': 'write_leader'}); 480 }} 481 482 } 483 484 }); 485 if (b=="modal_get_news") dataLayer.push({'event': 'subscribe_news'}); 486 if (b=="order-modal") dataLayer.push({'event': 'order_zayavka'}); 487 $(".form-sale, .subscribe").trigger("reset"); 488 if ($(this).parents("form").hasClass("form-sale")) dataLayer.push({'event': 'contact'}); 489 $('button.close').click(); 490 $('[name="get_order[title]"]').val(''); 491 492 if (b == "modal_application" || b == 'some_form' || b == 'modal_seminar' || b == 'order-modal') 493 $('#modal_thanks').modal('show'); 494 else if (b == 'modal_write'){ 495 // $('#modal_thanks_director').modal('show'); 496 } 497 else $('#modal_thanks_news').modal('show'); 498 } 499 500 501 return false 502 }); 503 504 //validation 505 506 // voice 507 508 $('.click_voice').bind("click", function() { 509 510 var a = $(this); 511 512 $.ajax({ 513 514 type: "POST", 515 516 dataType: 'json', 517 518 data: { voice: $(this).attr('id') }, 519 520 success: function(result) { 521 522 523 524 // console.log(111); 525 526 // console.log(result.status) 527 528 529 530 if (result.status != 'false') { 531 532 533 location.reload(); 534 a.parents('.wrap').find('span').text(result.mess); 535 536 $('.click_voice').remove(); 537 538 $("form").trigger("reset"); 539 540 $('.pass').removeClass("pass"); 541 542 543 544 a.parents('.wrap').find('span').text(result.mess); 545 546 $('.click_voice').remove(); 547 548 } 549 550 } 551 552 }); 553 554 }); 555 556 //placeholder 557 558 $('input, textarea').placeholder(); 559 560 //placeholder 561 562 //star fancy в блоке ÑÑаÑÑники на новоÑÑи одной 563 564 $('.fancy_img, .fancy_reviews').fancybox(); 565 566 567 $(".fancy_full_img").fancybox({ 568 569 prevEffect : 'none', 570 nextEffect : 'none', 571 padding : 0, 572 autoCenter : false, 573 574 afterLoad : function () { 575 $('body').addClass('fancy_img_item'); 576 }, 577 578 afterClose : function() { 579 $('body').removeClass('fancy_img_item'); 580 } 581 }); 582 583 $('.fancy_img_map').fancybox({ 584 585 beforeShow: function() { 586 587 $('.fancybox-wrap').prepend('<div class="submit-fancy">РаÑпеÑаÑаÑÑ</div>'); 588 589 }, 590 591 }); 592 593 594 595 //end fancy в блоке ÑÑаÑÑники на новоÑÑи одной 596 597 //star fancy видео на одном оÑÑеÑе 598 599 $(".js_fancy_video").fancybox({ 600 601 beforeShow: function() { 602 603 var title_2 = $(this.element).find('img').attr('alt'); 604 605 $('.fancybox-wrap').prepend('<b>' + title_2 + '</b>'); 606 607 }, 608 609 helpers: { 610 611 title: { 612 613 type: 'outside' 614 615 }, 616 617 overlay: { 618 619 speedOut: 0 620 621 } 622 623 } 624 625 }); 626 627 //end fancy видео на одном оÑÑеÑе 628 629 //start загÑÑзка Ñайлов 630 631 $('input[type="file"]').on('change', function() { 632 633 var filename = $('.file').val().split('\\').pop(); 634 635 $(this).parents('form').find('.js_place_file').text(filename); 636 637 638 639 var formData = new FormData(); 640 641 formData.append('rezume', $(this).prop('files')[0]); 642 643 formData.append('rezumeadd[name]', $(this).parents('form').find('input[type=hidden]').val()); 644 645 $.ajax({ 646 647 processData: false, 648 649 contentType: false, 650 651 type: "POST", 652 653 data: formData, 654 655 success: function(result) {} 656 657 }) 658 659 $('#modal_thanks_rezume').modal('show'); 660 661 //return false; 662 663 }); 664 665 //end загÑÑзка Ñайлов 666 667 //start - анимаÑÐ¸Ñ Ð¿Ð¾ ÑайÑÑ 668 669 $('.animated').appear(function() { 670 671 var elem = $(this); 672 673 var animation = elem.data('animation'); 674 675 if (!elem.hasClass('visible')) { 676 677 var animationDelay = elem.data('animation-delay'); 678 679 if (animationDelay) { 680 681 setTimeout(function() { 682 683 elem.addClass(animation + " visible"); 684 685 }, animationDelay); 686 687 } else { 688 689 elem.addClass(animation + " visible"); 690 691 } 692 693 } 694 695 }); 696 697 //end - анимаÑÐ¸Ñ Ð¿Ð¾ ÑайÑÑ 698 699 //start sticky header 700 701 var $menu = $('.center'), 702 703 menuHeight = $('.center').height(); 704 705 $(window).scroll(function() { 706 707 if ($(this).scrollTop() > 70) { 708 709 $menu.addClass("sticky"); 710 711 $('.page_wrapper').css('paddingTop', menuHeight); 712 713 } else if ($(this).scrollTop() <= 70 && $menu.hasClass("sticky")) { 714 715 $menu.removeClass("sticky"); 716 717 $('.page_wrapper').css('paddingTop', '0'); 718 719 } 720 721 }); 722 723 //end sticky header 724 725 //start btn_go top 726 727 $('.js_btn_top').on('click', function() { 728 729 $('html, body').animate({ scrollTop: 0 }, 600); 730 731 }); 732 733 //end btn_go top 734 735 $('.js_popup_txt td:not(.link)').on('click', function() { 736 737 var text = $(this).parents('tr').find('td.table_content').html(); 738 739 $('#modal_info .modal-body').html(text); 740 741 $('#modal_info').modal('show'); 742 743 }); 744 745 //start-ÑкоÑÑ 746 747 var h = $('#header').outerHeight(); 748 749 //console.log(h) 750 751 function scrollTo(ele) { 752 753 var h = $('#header').outerHeight(); 754 755 //console.log(h) 756 757 $('.anchor_list li a[href^="#"]').parent('li').removeClass('active'); 758 759 $(this).parent('li').addClass('active'); 760 761 $('html, body').animate({ scrollTop: $(ele).offset().top - h }, 1200); 762 763 window.location.hash = ele; 764 765 } 766 767 $('.anchor_list li a[href^="#"]').on('click', function(e) { 768 769 var target = $(this).attr("href"); 770 771 setTimeout(function() { 772 773 scrollTo(target); 774 775 776 777 }, 200); 778 779 e.preventDefault(); 780 781 782 783 }); 784 785 setTimeout(function() { 786 787 $(window).scroll(function() { 788 789 var h = $('#header').outerHeight(); 790 791 //console.log(h) 792 793 }); 794 795 }, 200); 796 797 //end-ÑкоÑÑ 798 799 800 801 802 803 804 805 var page_url = window.location.href.split('?scroll='); 806 807 if (typeof page_url[1] !== "undefined") { 808 809 if (typeof(parseFloat(page_url[1])) == 'number') { 810 811 page_url = page_url[1]; // Так поÑÐ¾Ð¼Ñ ÑÑо не ÑабоÑÐ°ÐµÑ Ð¿Ñи подÑÑановке page_url[1] 812 813 var a = 'a[href="#tab' + page_url + '"]'; 814 815 $(a).trigger('click'); 816 817 } 818 819 } 820 821 822 823 824 825 $('[data-copy="false"]').on('contextmenu', function(e) { 826 827 return false;
828 829 }); 830 831 832 833}); 834 835$(window).load(function() { 836 837 var $container = $('.packery').packery({ 838 839 itemSelector: ".item" 840 841 }); 842 843}); 844 845/*================================start-validation==========================*/ // 846 847function validate(form) { 848 849 var error_class = "has-error"; 850 851 var norma_class = "pass"; 852 853 var item = form.find("[required]"); 854 855 var e = 0; 856 857 var reg = undefined; 858 859 var pass = form.find('.password').val(); 860 861 var pass_1 = form.find('.password_1').val(); 862 863 864 865 function mark(object, expression) { 866 867 if (expression) { 868 869 object.parent('div').addClass(error_class).find('.text_error').css('display', 'block'); 870 871 e++; 872 873 } else 874 875 object.parent('div').addClass(norma_class).removeClass(error_class).find('.text_error').css('display', 'none'); 876 877 } 878 879 item.each(function() { 880 881 switch ($(this).attr("data-validate")) { 882 883 case undefined: 884 885 mark($(this), $.trim($(this).val()).length == 0); 886 887 break; 888 889 case "email": 890 891 reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 892 893 mark($(this), !reg.test($.trim($(this).val()))); 894 895 break; 896 897 case "phone": 898 899 reg = /[0-9 -()+]{5}$/; 900 901 mark($(this), !reg.test($.trim($(this).val()))); 902 903 break; 904 905 case "pass": 906 907 reg = /^[a-zA-Z0-9_-]+$/; 908 909 mark($(this), !reg.test($.trim($(this).val()))); 910 911 break; 912 913 case "pass1": 914 915 mark($(this), pass_1 != pass); 916 917 break; 918 919 default: 920 921 reg = new RegExp($(this).attr("data-validate"), "g"); 922 923 mark($(this), !reg.test($.trim($(this).val()))); 924 925 break 926 927 } 928 929 }) 930 931 if (form.find('.js_valid_check').length) { 932 933 if ($('.js_valid_check:checked').length == 0) { 934 935 $('.js_valid_check').parents('.row_checked').addClass(error_class).find('.text_error').css('display', 'block'); 936 937 e == 1; 938 939 } else { 940 941 $('.js_valid_check').parents('.row_checked').addClass(norma_class).removeClass(error_class).find('.text_error').css('display', 'none'); 942 943 } 944 945 } 946 947 if (e == 0) { 948 949 return true; 950 951 } else { 952 953 form.find("." + error_class + " input:first").focus(); 954 955 return false; 956 957 } 958 959} 960 961/*================================end-validation==========================*/ 962 963/*================================start-placeholder==========================*/ 964 965/*! http://mths.be/placeholder v2.0.7 by @mathias */ 966 967; 968 969(function(window, document, $) { 970 971 // Opera Mini v7 doesn t support placeholder although its DOM seems to indicate so 972 973 var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]'; 974 975 var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini; 976 977 var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini; 978 979 var prototype = $.fn; 980 981 var valHooks = $.valHooks; 982 983 var propHooks = $.propHooks; 984 985 var hooks; 986 987 var placeholder; 988 989 if (isInputSupported && isTextareaSupported) { 990 991 placeholder = prototype.placeholder = function() { 992 993 return this; 994 995 }; 996 997 placeholder.input = placeholder.textarea = true; 998 999 } else { 1000 1001 placeholder = prototype.placeholder = function() { 1002 1003 var $this = this; 1004 1005 $this 1006 1007 .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') 1008 1009 .not('.placeholder') 1010 1011 .bind({ 1012 1013 'focus.placeholder': clearPlaceholder, 1014 1015 'blur.placeholder': setPlaceholder 1016 1017 }) 1018 1019 .data('placeholder-enabled', true) 1020 1021 .trigger('blur.placeholder'); 1022 1023 return $this; 1024 1025 }; 1026 1027 placeholder.input = isInputSupported; 1028 1029 placeholder.textarea = isTextareaSupported; 1030 1031 hooks = { 1032 1033 'get': function(element) { 1034 1035 var $element = $(element); 1036 1037 var $passwordInput = $element.data('placeholder-password'); 1038 1039 if ($passwordInput) { 1040 1041 return $passwordInput[0].value; 1042 1043 } 1044 1045 return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value; 1046 1047 }, 1048 1049 'set': function(element, value) { 1050 1051 var $element = $(element); 1052 1053 var $passwordInput = $element.data('placeholder-password'); 1054 1055 if ($passwordInput) { 1056 1057 return $passwordInput[0].value = value; 1058 1059 } 1060 1061 if (!$element.data('placeholder-enabled')) { 1062 1063 return element.value = value; 1064 1065 } 1066 1067 if (value == '') { 1068 1069 element.value = value; 1070 1071 // Issue #56: Setting the placeholder causes problems if the element continues to have focus. 1072 1073 if (element != safeActiveElement()) { 1074 1075 // We can't use `triggerHandler` here because of dummy text/password inputs :( 1076 1077 setPlaceholder.call(element); 1078 1079 } 1080 1081 } else if ($element.hasClass('placeholder')) { 1082 1083 clearPlaceholder.call(element, true, value) || (element.value = value); 1084 1085 } else { 1086 1087 element.value = value; 1088 1089 } 1090 1091 // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363 1092 1093 return $element; 1094 1095 } 1096 1097 }; 1098 1099 if (!isInputSupported) { 1100 1101 valHooks.input = hooks; 1102 1103 propHooks.value = hooks; 1104 1105 } 1106 1107 if (!isTextareaSupported) { 1108 1109 valHooks.textarea = hooks; 1110 1111 propHooks.value = hooks; 1112 1113 } 1114 1115 $(function() { 1116 1117 // Look for forms 1118 1119 $(document).delegate('form', 'submit.placeholder', function() { 1120 1121 // Clear the placeholder values so they don't get submitted 1122
1123 var $inputs = $('.placeholder', this).each(clearPlaceholder); 1124 1125 setTimeout(function() { 1126 1127 $inputs.each(setPlaceholder); 1128 1129 }, 10); 1130 1131 }); 1132 1133 }); 1134 1135 // Clear placeholder values upon page reload 1136 1137 $(window).bind('beforeunload.placeholder', function() { 1138 1139 $('.placeholder').each(function() { 1140 1141 this.value = ''; 1142 1143 }); 1144 1145 }); 1146 1147 } 1148 1149 1150 1151 function args(elem) { 1152 1153 // Return an object of element attributes 1154 1155 var newAttrs = {}; 1156 1157 var rinlinejQuery = /^jQuery\d+$/; 1158 1159 $.each(elem.attributes, function(i, attr) { 1160 1161 if (attr.specified && !rinlinejQuery.test(attr.name)) { 1162 1163 newAttrs[attr.name] = attr.value; 1164 1165 } 1166 1167 }); 1168 1169 return newAttrs; 1170 1171 } 1172 1173 1174 1175 function clearPlaceholder(event, value) { 1176 1177 var input = this; 1178 1179 var $input = $(input); 1180 1181 if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { 1182 1183 if ($input.data('placeholder-password')) { 1184 1185 $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); 1186 1187 // If `clearPlaceholder` was called from `$.valHooks.input.set` 1188 1189 if (event === true) { 1190 1191 return $input[0].value = value; 1192 1193 } 1194 1195 $input.focus(); 1196 1197 } else { 1198 1199 input.value = ''; 1200 1201 $input.removeClass('placeholder'); 1202 1203 input == safeActiveElement() && input.select(); 1204 1205 } 1206 1207 } 1208 1209 } 1210 1211 1212 1213 function setPlaceholder() { 1214 1215 var $replacement; 1216 1217 var input = this; 1218 1219 var $input = $(input); 1220 1221 var id = this.id; 1222 1223 if (input.value == '') { 1224 1225 if (input.type == 'password') { 1226 1227 if (!$input.data('placeholder-textinput')) { 1228 1229 try { 1230 1231 $replacement = $input.clone().attr({ 'type': 'text' }); 1232 1233 } catch (e) { 1234 1235 $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' })); 1236 1237 } 1238 1239 $replacement 1240 1241 .removeAttr('name') 1242 1243 .data({ 1244 1245 'placeholder-password': $input, 1246 1247 'placeholder-id': id 1248 1249 }) 1250 1251 .bind('focus.placeholder', clearPlaceholder); 1252 1253 $input 1254 1255 .data({ 1256 1257 'placeholder-textinput': $replacement, 1258 1259 'placeholder-id': id 1260 1261 }) 1262 1263 .before($replacement); 1264 1265 } 1266 1267 $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); 1268 1269 // Note: `$input[0] != input` now! 1270 1271 } 1272 1273 $input.addClass('placeholder'); 1274 1275 $input[0].value = $input.attr('placeholder'); 1276 1277 } else { 1278 1279 $input.removeClass('placeholder'); 1280 1281 } 1282 1283 } 1284 1285 1286 1287 function safeActiveElement() { 1288 1289 // Avoid IE9 `document.activeElement` of death 1290 1291 // https://github.com/mathiasbynens/jquery-placeholder/pull/99 1292 1293 try { 1294 1295 return document.activeElement; 1296 1297 } catch (err) {} 1298 1299 } 1300 1301}(this, document, jQuery)); 1302 1303/*================================end-placeholder==========================*/ 1304 1305 1306 1307/* --------------------------callback -------------------------*/ 1308 1309var $post = $(".call-us"); 1310 1311setInterval(function() { 1312 1313 $post.toggleClass("call-us--text"); 1314 1315}, 8000); 1316 1317 1318 1319$(".call-us").click(function() { 1320 1321 $('.call-bottom').addClass('disabled'); 1322 1323}); 1324 1325 1326 1327/*$("#phone").mask("+389 99 999 99 99", { 1328 1329 autoclear: false 1330 1331}); 1332 1333// mask 1334 1335$('[data-validate="phone"]').mask("+389 99 999 99 99", { 1336 1337 autoclear: false 1338 1339}); 1340 1341$('[placeholder="ТелеÑон"]').mask("+389 99 999 99 99", { 1342 1343 autoclear: false 1344 1345}); 1346 1347// mask 1348 1349$("#phone-1").mask("+38 999 999 99 99", { 1350 1351 autoclear: false 1352 1353});
1354*/ 1355 1356 1357$("#ergpou").mask("99999999?99", { 1358 1359 autoclear: false 1360 1361}); 1362 1363 1364 1365$("#ergpou-1").mask("99999999?99", { 1366 1367 autoclear: false 1368 1369}); 1370 1371/* -------------------------- start substitution phone country code -------------------------*/ 1372 1373$(document).ready(function(){ 1374 $("#country").change(function(){ 1375 $('#phone-1').val($('#country').val()); 1376 }); 1377}); 1378 1379/* -------------------------- end substitution phone country code -------------------------*/ 1380 1381 1382/* -------------------------- start input validation -------------------------*/ 1383 1384$('input[data-validate="phone"]').on('keypress', function(event) { 1385 1386 return event.charCode >= 48 && event.charCode <= 57 || event.charCode == 8 || event.charCode == 46 || event.charCode == 43 1387 1388}); 1389 1390/* -------------------------- end input validation -------------------------*/ 1391 1392$(document).ready(function() { 1393 1394 $('.js_validate button[type="submit"]').on("click", function() { 1395 1396 var v = validate($(this).parents(".js_validate")); 1397 1398 if(v == true) { 1399 1400 if($(this).parents("form").attr("id") == 'phone-form') { 1401 1402 var _this = $(this).parents('form'); 1403 1404 var postData = _this.serialize(); 1405 1406 var formURL = _this.attr("action"); 1407 $("#msgErrorCallback").text(""); 1408 $.ajax({ 1409 1410 url: formURL, 1411 1412 type: "POST", 1413 1414 dataType: 'json', 1415 1416 data: postData+"&id="+$(this).attr("id"), 1417 1418 success: function(json) { 1419 if (json.status) { 1420 $("#call-modal").modal('hide'); 1421 1422 $('#call-timer').modal('show'); 1423 fbq ('track', 'Lead'); 1424 dataLayer.push({'event': 'callback'}); 1425 } else { 1426 grecaptcha.reset(); 1427 $("#msgErrorCallback").text(json.message) 1428 } 1429 } 1430 1431 }); 1432 1433 return false; 1434 1435 1436 1437 } 1438 1439 } 1440 1441 return v; 1442 1443 }); 1444 1445 1446 1447}); 1448 1449setTimeout(function() { 1450 1451 $('.call-bottom').fadeIn('fast') 1452 1453}, 120000); 1454 1455$('#bottom-close').click(function() { 1456 1457 $('.call-bottom').fadeOut('fast'); 1458 1459}); 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469/*-------------timer------------------*/ 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481$('#call-timer').on('show.bs.modal', function(event) { 1482 1483 1484 1485 var remain_bv = 30; 1486 1487 1488 1489 function parseTime_bv(timestamp) { 1490 1491 if (timestamp < 0) timestamp = 0; 1492 1493 1494 1495 var day = Math.floor((timestamp / 60 / 60) / 24); 1496 1497 var hour = Math.floor(timestamp / 60 / 60); 1498 1499 var mins = Math.floor((timestamp - hour * 60 * 60) / 60); 1500 1501 var secs = Math.floor(timestamp - hour * 60 * 60 - mins * 60); 1502 1503 1504 1505 1506 1507 if (String(mins).length > 1) 1508 1509 $('span.afss_mins_bv').text(mins); 1510 1511 else 1512 1513 $('span.afss_mins_bv').text("0" + mins); 1514 1515 if (String(secs).length > 1) 1516 1517 $('span.afss_secs_bv').text(secs); 1518 1519 else 1520 1521 $('span.afss_secs_bv').text("0" + secs); 1522 1523 1524 1525 } 1526 1527 1528 1529 function testTimer() { 1530 1531 remain_bv = remain_bv - 1; 1532 1533 parseTime_bv(remain_bv); 1534 1535 $('#call-timer').on('hidden.bs.modal', function(e) { 1536 1537 clearInterval(myTimer); 1538 1539 remain_bv = 30; 1540 1541 parseTime_bv(remain_bv); 1542 1543 }); 1544 1545 } 1546 1547 var myTimer = setInterval(testTimer, 1000); 1548 1549}); 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559/*function timer(){ 1560 1561 var obj=document.querySelector('.afss_secs_bv'); 1562 1563 obj.innerHTML--; 1564 1565 if(obj.innerHTML==0){ 1566 1567 $('#call-timer').modal('hide'); 1568 1569 setTimeout(function(){},1000); 1570 1571} 1572 1573 else{setTimeout(timer,1000);} 1574 1575} 1576 1577 1578 1579*/ 1580 1581/*$('#call-timer').on('shown.bs.modal', function(e) { 1582 1583 setInterval(function(){ 1584 1585 remain_bv = remain_bv - 1; 1586 1587 parseTime_bv(remain_bv); 1588 1589 if(remain_bv <= 0){ 1590 1591 alert('Hello'); 1592 1593 } 1594 1595 }, 1000); 1596 1597});*/ 1598 1599 1600 1601 1602 1603 1604 1605$("#phone-form").on('submit', function() { 1606 1607 var postData = $(this).serializeArray(); 1608 1609 var formURL = $(this).attr("action"); 1610 1611 $.ajax({ 1612 1613 url: formURL, 1614 1615 type: "POST", 1616 1617 dataType: 'json', 1618 1619 data: postData, 1620 1621 success: function(json) { 1622 1623 $("#call-modal").modal('hide'); 1624 1625 $('#call-timer').modal('show'); 1626 fbq ('track', 'Lead'); 1627 //console.log(5); 1628 1629 } 1630 1631 }); 1632 1633 /*$.ajax({ 1634 1635 url: formURL, 1636 1637 type: "POST", 1638 1639 dataType: 'json', 1640 1641 data: postData, 1642 1643 }).always(function(data, textStatus, jqXHR) { 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 });*/ 1654 1655 return false;
1656 1657 //event.preventDefault(); 1658 1659}); 1660 1661 1662 1663 1664 1665/*$('.js_timer').click(function() { 1666 1667 var remain_bv = 30; 1668 1669 1670 1671 function parseTime_bv(timestamp) { 1672 1673 if (timestamp < 0) timestamp = 0; 1674 1675 1676 1677 var day = Math.floor((timestamp / 60 / 60) / 24); 1678 1679 var hour = Math.floor(timestamp / 60 / 60); 1680 1681 var mins = Math.floor((timestamp - hour * 60 * 60) / 60); 1682 1683 var secs = Math.floor(timestamp - hour * 60 * 60 - mins * 60); 1684 1685 1686 1687 1688 1689 if (String(mins).length > 1) 1690 1691 $('span.afss_mins_b-1').text(mins); 1692 1693 else 1694 1695 $('span.afss_mins_bv-1').text("0" + mins); 1696 1697 if (String(secs).length > 1) 1698 1699 $('span.afss_secs_bv-1').text(secs); 1700 1701 else 1702 1703 $('span.afss_secs_bv-1').text("0" + secs); 1704 1705 1706 1707 } 1708 1709 1710 1711 $(document).ready(function() { 1712 1713 var myTimer = setInterval(function() { 1714 1715 remain_bv = remain_bv - 1; 1716 1717 parseTime_bv(remain_bv); 1718 1719 1720 1721 }, 1000); 1722 1723 $('#call-timer').on('hidden.bs.modal', function(e) { 1724 1725 clearInterval(myTimer); 1726 1727 remain_bv = 30; 1728 1729 parseTime_bv(remain_bv); 1730 1731 }) 1732 1733 }); 1734 1735});*/ 1736 1737 1738 1739$("#phone-form-1").submit(function(event) { 1740 1741 var postData = $(this).serializeArray(); 1742 1743 var formURL = $(this).attr("action"); 1744 1745 $.ajax({ 1746 1747 url: formURL, 1748 1749 type: "POST", 1750 1751 data: postData, 1752 1753 1754 1755 }).always(function(data, textStatus, jqXHR) { 1756 1757 $('.bottom-first').fadeOut(); 1758 1759 $('.bottom-second').fadeIn(); 1760 fbq ('track', 'Lead'); 1761 1762 }) 1763 1764 e.preventDefault(); 1765 1766}); 1767 1768$('.close').click(function() { 1769 1770 $('body').addClass('no-padding'); 1771 1772}); 1773 1774 1775 1776 1777 1778/* ================================= promocodes ============================ */ 1779 1780$(document).on('submit', ".js_promocode", function() { 1781 1782 $(".js_promo_error").hide('slow'); 1783 1784 var _form = $(this).serialize(); 1785 1786 $.ajax({ 1787 1788 url: "/", 1789 1790 type: "POST", 1791 1792 dataType: "json", 1793 1794 data: _form, 1795 1796 success: function(response) { 1797 1798 if (response.status == false) { 1799 1800 $(".js_promo_error").text(response.message).show('slow'); 1801 1802 } 1803 1804 if (response.status == true) { 1805 1806 $(".modal").modal("hide"); 1807 1808 $("#promocode-modal").modal('show'); 1809 1810 } 1811 1812 } 1813 1814 }) 1815 1816 return false; 1817 1818}); 1819 1820 1821 1822 1823 1824/* ------------ maskinput new popap-----------------*/ 1825 1826$(document).ready(function() { 1827 1828 $("#phone-modal").mask("999 9999", { 1829 1830 autoclear: false 1831 1832 }); 1833 1834 $("#country-code").mask("+380 (99)", { 1835 1836 autoclear: false 1837 1838 }); 1839 1840 /*$('#country-code').addEventListener('keyup(function(){ 1841 1842 var count = $("#country-code").val(); 1843 1844 var str = count.indexOf("_"); 1845 1846 console.log(str); 1847 1848 if(str == -1){ 1849 1850 console.log(1); 1851 1852 $("#phone").focus(); 1853 1854 1855 1856 } 1857 1858 });*/ 1859 1860 1861 1862 var a = document.getElementById('country-code'); 1863 1864 var b = document.getElementById('phone-modal'); 1865 1866 if(a != undefined) { 1867 1868 a.addEventListener('keyup', function() { 1869 1870 if (a.value.indexOf('_') == -1) { 1871 1872 //console.log(b); 1873 1874 b.focus(); 1875 1876 } 1877 1878 }); 1879 1880 } 1881 1882}); 1883 1884// focus 1885 1886function setSelectionRange(input, selectionStart, selectionEnd) { 1887 1888 if (input.setSelectionRange) { 1889 1890 input.focus(); 1891 1892 input.setSelectionRange(selectionStart, selectionEnd); 1893 1894 } else if (input.createTextRange) { 1895 1896 var range = input.createTextRange(); 1897 1898 range.collapse(true); 1899 1900 range.moveEnd('character', selectionEnd); 1901 1902 range.moveStart('character', selectionStart); 1903 1904 range.select(); 1905 1906 } 1907 1908} 1909 1910 1911 1912function setCaretToPos(input, pos) { 1913 1914 setSelectionRange(input, pos, pos); 1915 1916 // console.log('312') 1917 1918} 1919 1920/* 1921document.getElementById("phone-1").onclick = function() { 1922 1923 setCaretToPos(document.getElementById("phone-1"), 4); 1924 1925} 1926 1927document.getElementById("phone").onclick = function() { 1928 1929 setCaretToPos(document.getElementById("phone-1"), 4); 1930 1931} 1932 1933$(document).on('click', '[data-validate="phone"]', function() { 1934 1935 setCaretToPos(this, 4); 1936 1937}); 1938 1939*/ 1940 1941$(document).on('click', '[id="ergpou"]', function() { 1942 1943 setCaretToPos(this, 0); 1944 1945}
1945); 1946 1947 1948 1949$(document).on('click', '[id="ergpou-1"]', function() { 1950 1951 setCaretToPos(this, 0); 1952 1953}); 1954 1955 1956 1957$(document).on('click', '[placeholder="ТелеÑон"]', function() { 1958 1959 setCaretToPos(this, 4); 1960 1961}); 1962 1963// focus 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973$('input[data-validate="email"]').on('keypress', function() { 1974 1975 var that = this; 1976 1977 setTimeout(function() { 1978 1979 var res = /[^a-z @ -_]/g.exec(that.value); 1980 1981 that.value = that.value.replace(res, ''); 1982 1983 }, 0); 1984 1985}); 1986 1987$("#rus").click(function(){ 1988 if (location.href.indexOf("/ru/")==-1) { 1989 location.href = location.href.replace("https://lopan.com.ua/","https://lopan.com.ua/ru/"); 1990 } 1991}); 1992$("#ukr").click(function(){ 1993 if (location.href.indexOf("/ru/")) { 1994 location.href = location.href.replace("https://lopan.com.ua/ru/","https://lopan.com.ua/"); 1995 } 1996}); 1997 1998 1999 document.querySelectorAll('.trigger-image-video').forEach(function(image) { 2000 image.addEventListener('click', function() { 2001 const videoSrc = image.getAttribute('data-video'); 2002 const overlay = document.getElementById('videoOverlay'); 2003 const video = document.getElementById('popupVideo'); 2004 2005 video.src = videoSrc; 2006 overlay.style.display = 'flex'; 2007 video.play(); 2008 }); 2009 }); 2010 2011 document.getElementById('closeBtn').addEventListener('click', function() { 2012 const overlay = document.getElementById('videoOverlay'); 2013 const video = document.getElementById('popupVideo'); 2014 2015 overlay.style.display = 'none'; 2016 video.pause(); 2017 video.currentTime = 0; 2018 }); 2019 2020 document.getElementById('videoOverlay').addEventListener('click', function(event) { 2021 if (event.target === this) { 2022 this.style.display = 'none'; 2023 const video = document.getElementById('popupVideo'); 2024 video.pause(); 2025 video.currentTime = 0; 2026 } 2027 });
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.