1var site_id = ""; 2var cur_pos = 0; 3var btn_type = ""; 4var sect = ""; 5var ib = ""; 6var customEvent = false; 7 8 9var lazyController = false, 10 parentContainerSlide = {}, 11 parent = {}, 12 flagSlider = 0, 13 arImagesLazyload = {}; 14 15var paramsLazy = { 16 scrollDirection: 'vertical', 17 threshold: 500, 18 visibleOnly: true, 19 effect: 'fadeIn', 20}; 21 22 23function addGoal(action){ 24 25 if(typeof globalGoalsHam !== "undefined") 26 { 27 if(globalGoalsHam[action]) 28 $('body').append(globalGoalsHam[action]); 29 } 30} 31function showProcessLoad() 32{ 33 $('.google-spin-wrapper').addClass('active'); 34} 35function closeProcessLoad() 36{ 37 $('.google-spin-wrapper').removeClass('active'); 38} 39 40function startBlurWrapperContainer() 41{ 42 $('body').addClass('modal-open'); 43 $('.wrapper').addClass('blur'); 44} 45function stopBlurWrapperContainer() 46{ 47 $('body').removeClass('modal-open'); 48 $('.wrapper').removeClass('blur'); 49} 50 51function generateMaps(container){ 52 var mapBlock = $(".iframe-map-area", container); 53 54 if(mapBlock.length>0) 55 { 56 mapBlock.each( 57 function(index, element) 58 { 59 $(element).after($(element).attr("data-src")); 60 $(element).remove(); 61 } 62 ); 63 } 64} 65function generateVideos(container){ 66 67 var videoBlock = $(".iframe-video-area", container); 68 69 if(videoBlock.length>0) 70 { 71 videoBlock.each( 72 function(index, element) 73 { 74 $(element).after($(element).attr("data-src")); 75 $(element).remove(); 76 } 77 ); 78 } 79} 80 81function updateLazyLoad(){ 82 $('.lazyload').Lazy( 83 { 84 scrollDirection: 'vertical', 85 threshold: 500, 86 visibleOnly: true, 87 effect: 'fadeIn', 88 afterLoad: function(element) 89 { 90 91 parent = $(element).parent(); 92 parentContainerSlide = parent.find('.parent-slider-item-js'); 93 94 if($(element).hasClass("slider-start")) 95 { 96 97 if(typeof arImagesLazyload["id"+$(element).attr("data-id")] === "undefined") 98 arImagesLazyload["id"+$(element).attr("data-id")] = {"s": 0, "f": 0, "type": null}; 99 100 arImagesLazyload["id"+$(element).attr("data-id")].s = 1; 101 102 103 arImagesLazyload["id"+$(element).attr("data-id")].type = parentContainerSlide; 104 105 } 106 107 108 if($(element).hasClass('slider-finish')) 109 { 110 111 if(typeof arImagesLazyload["id"+$(element).attr("data-id")] === "undefined") 112 arImagesLazyload["id"+$(element).attr("data-id")] = {"s": 0, "f": 0, "type": null}; 113 114 arImagesLazyload["id"+$(element).attr("data-id")].f = 1; 115 arImagesLazyload["id"+$(element).attr("data-id")].type = parentContainerSlide; 116 117 } 118 119 if($(element).hasClass('slider-finish') || $(element).hasClass("slider-start")) 120 { 121 for (key in arImagesLazyload){ 122 123 if(arImagesLazyload[key].s == 1 && arImagesLazyload[key].f == 1) 124 { 125 /*if( arImagesLazyload[key].type.hasClass('first-slider') && !arImagesLazyload[key].type.hasClass('slider-init')) 126 initFSlider(arImagesLazyload[key].type);*/ 127 128 controllerSliders(arImagesLazyload[key].type); 129 130 delete arImagesLazyload[key]; 131 } 132 } 133 } 134 135 136 137 if($(element).parents(".parent-video-bg").find(".videoBG").length>0) 138 correctSizeVideoBg($(element).parents(".parent-video-bg").find(".videoBG")); 139 140 if($(element).hasClass('map-start')) 141 generateMaps($(element).parents("div.block")); 142 143 if($(element).hasClass('video-start')) 144 generateVideos($(element).parents("div.block")); 145 146 if($(element).hasClass('videoBG-start')) 147 generateVideoBG($(element).parents("div.block")); 148 149 if($(element).hasClass('videoBG-start-fb')) 150 generateVideoBG($(element).parents("div.first-block")); 151 } 152 } 153 ); 154} 155 156function scrollToBlock(dist){ 157 var moreDist = 30; 158 159 160 if ($('header').hasClass("slide")) 161 moreDist = 70; 162 163 164 165 var destinationhref = parseInt($(dist).offset().top - moreDist); 166 167 $("html:not(:animated),body:not(:animated)").animate({ 168 scrollTop: destinationhref 169 }, 1000, "linear", function() { 170 171 setTimeout( 172 function(){ 173 174 if( 100 < Math.abs(parseInt($(dist).offset().top - moreDist) - destinationhref) ) 175 { 176 $("html:not(:animated),body:not(:animated)").animate({ 177 scrollTop: parseInt($(dist).offset().top) 178 }, 300, "linear"); 179 } 180 }, 300 181 ); 182 } 183 ); 184 185} 186 187 188function parseCount(newVal, step, minVal){ 189 190 191 var ost = newVal % step; 192 var step_ = step - ost; 193 194 newVal = newVal - minVal; 195 newVal -= (newVal % step); 196 197 if(step_ >= ost) 198 { 199 newVal += minVal; 200 } 201 202 else 203 { 204 newVal += minVal + step; 205 } 206 207 208 if (newVal <= minVal || isNaN(newVal)) 209 newVal = minVal; 210 211 return newVal; 212} 213
214function formatNum(val){ 215 val = String(val).replace(/(\d)(?=(\d{3})+([^\d]|$))/g, '$1 '); 216 return val; 217} 218 219function openBox(from_mod_cat){ 220 221 if (from_mod_cat != "Y"){ 222 $('body').addClass('modal-open'); 223 $('.wrapper').addClass('blur'); 224 } 225 226 if (from_mod_cat == "Y") 227 $(".wrap-modal.open").addClass('blur'); 228 229 $('.no-click-block').addClass('double'); 230 $('div.box-parent').addClass('open'); 231 232 var cartOut = setTimeout( 233 function(){ 234 $('div.box-parent').addClass('on'); 235 clearTimeout(cartOut); 236 }, 200 237 ); 238 239 $('.lazyload', 'div.box-parent').each( 240 function(index, element) 241 { 242 $(element).attr("src", $(element).attr("data-src")); 243 $(element).removeAttr('data-src'); 244 } 245 ); 246} 247 248function updateBox(button, countBox, idboxEl, action, other_complect, redirect){ 249 250 var from_mod_cat = "N"; 251 252 site_id = $("input.site_id").val(); 253 sect = $("input.sect").val(); 254 255 256 if ($(".wrap-modal").hasClass('open')) 257 from_mod_cat = "Y"; 258 259 $.ajax({ 260 method: 'POST', 261 url: '/bitrix/templates/concept_hameleon/ajax/cart/cart.php', 262 dataType: 'json', 263 data:{ 264 idboxEl: idboxEl, 265 countBox: countBox, 266 sect: sect, 267 site_id: site_id, 268 action: action, 269 other_complect: other_complect 270 }, 271 success: function(json){ 272 273 callToBox("products", "N", action, button); 274 callToBox("info_table", "N", action, button); 275 callToBox("mini_cart", from_mod_cat, action); 276 callToBox("mini_cart_mob", "N", action); 277 278 279 if (action == "add"){ 280 281 if (button.hasClass('added') || button.parents(".catalog-block").hasClass('first-click-box')){ 282 283 var addOut = setTimeout( 284 function(){ 285 286 openBox(from_mod_cat); 287 288 if (button.parents(".catalog-block").hasClass('first-click-box')) 289 $(".catalog-block").removeClass('first-click-box'); 290 291 clearTimeout(addOut); 292 293 }, 350); 294 } 295 296 $(".click_box[data-box-id=" + idboxEl + "]").addClass('added'); 297 298 } 299 300 301 if (action == "delete") 302 $(".click_box.added[data-box-id='" + button.attr("data-box-id") + "']").removeClass('added'); 303 304 if (action == "clear") 305 { 306 $(".click_box.added").removeClass('added'); 307 if(device.ios()){ 308 $("body").removeClass("modal-ios"); 309 window.scrollTo(0, cur_pos); 310 } 311 } 312 313 314 if (json.EMPTY == "Y"){ 315 316 if (!$(".wrap-modal.open").hasClass('blur')){ 317 $('body').removeClass('modal-open'); 318 $('.wrapper').removeClass('blur'); 319 } 320 321 if ($(".wrap-modal.open").hasClass('blur')) 322 $(".wrap-modal.open").removeClass('blur'); 323 324 $('div.box-parent').removeClass('on'); 325 $('.no-click-block').removeClass('double'); 326 $('.first-click-box-on').addClass('first-click-box'); 327 328 var addOut2 = setTimeout( 329 function(){ 330 $('div.box-parent').removeClass('open'); 331 clearTimeout(addOut2); 332 }, 700 333 ); 334 335 } 336 337 if(redirect.length > 0) 338 { 339 location.href = redirect; 340 } 341 342 343 } 344 }); 345 346 347} 348 349function callToBox(templ, modal_mode, action, button){ 350 351 var preload = false; 352 site_id = $("input.site_id").val(); 353 sect = $("input.sect").val(); 354 355 if (typeof(button) != "undefined" && typeof(action) != "undefined" && (action == "update" || action == "delete")) 356 { 357 $(".total-parent-preload-circleG").addClass('active'); 358 preload = true; 359 360 if(action == "update") 361 button.parents(".parent-preload-circleG-wrap").find(".parent-preload-circleG").addClass('active'); 362 } 363 364 $.post('/bitrix/components/concept/hameleon_cart/ajax.php',{ 365 templ: templ, 366 sect: sect, 367 site_id: site_id, 368 modal_mode: modal_mode, 369 link_empty_box: link_empty_box 370 }, 371 372 function(html){ 373 374 if(preload) 375 { 376 var ctbOut = setTimeout( 377 function(){ 378 $(".area_for_" + templ).html(html); 379 $('.lazyload').Lazy(paramsLazy); 380 clearTimeout(ctbOut); 381 }, 800); 382 } 383 else 384 { 385 $(".area_for_" + templ).html(html); 386 $('.lazyload').Lazy(paramsLazy); 387 } 388 } 389 ); 390 391 392} 393 394function getChar(evt){ 395 396 evt = (evt) ? evt : window.event;
397 var charCode = (evt.which) ? evt.which : evt.keyCode; 398 if (charCode > 31 && (charCode < 46 || charCode > 57)) { 399 return null; 400 } 401 return true; 402} 403 404function timerCookie(form){ 405 var timeout = true; 406 var timer = form.find('input.timerVal').val(); 407 var forCookieTime = parseFloat(form.find('input.forCookieTime').val()); 408 var totalTime = 0; 409 var mainTime = new Date().getTime(); 410 var idElem = form.find('input#element').val(); 411 var idSect = form.find('input.idSect').val(); 412 var firstEnter = BX.getCookie('_hamelFirstEnter' + idSect + idElem); 413 var firstEnterVal = BX.getCookie('_hamelFirstEnterVal' + idSect + idElem); 414 415 var cookieOut = setTimeout( 416 function(){ 417 form.css('min-height', form.outerHeight()); 418 clearTimeout(cookieOut); 419 }, 100); 420 421 form.find('.hameltimer').addClass('active'); 422 423 if(forCookieTime <= 0) 424 forCookieTime = 1; 425 426 427 if (typeof(firstEnter) == "undefined" || firstEnterVal != timer){ 428 BX.setCookie('_hamelFirstEnter' + idSect + idElem, mainTime,{ 429 expires: forCookieTime * 60 * 60 430 }); 431 BX.setCookie('_hamelFirstEnterVal' + idSect + idElem, timer,{ 432 expires: forCookieTime * 60 * 60 433 }); 434 firstEnter = BX.getCookie('_hamelFirstEnter' + idSect + idElem); 435 firstEnterVal = BX.getCookie('_hamelFirstEnterVal' + idSect + idElem); 436 } 437 438 totalTime = ((mainTime - firstEnter) / 1000).toFixed(); 439 440 if (totalTime < timer * 60) 441 timer = timer * 60 - totalTime; 442 443 else{ 444 timeout = false; 445 } 446 447 448 449 if (timeout) 450 form.find('.hameltimer').countdown({ 451 until: timer, 452 format: 'HMS', 453 onExpiry: liftOff, 454 layout: form.find('.hameltimer').html() 455 }, $.countdown.regionalOptions['ru']); 456 457 else{ 458 form.find('.questions').removeClass('active'); 459 form.find('.timeout_text').addClass('active'); 460 } 461 462 463 function liftOff(){ 464 form.find('.questions').removeClass('active'); 465 form.find('.timeout_text').addClass('active'); 466 } 467 468 469} 470 471 472Share = { 473 vkontakte: function(purl, ptitle, pimg, text){ 474 url = 'http://vkontakte.ru/share.php?'; 475 url += 'url=' + encodeURIComponent(purl); 476 url += '&title=' + encodeURIComponent(ptitle); 477 url += '&description=' + encodeURIComponent(text); 478 url += '&image=' + encodeURIComponent(pimg); 479 url += '&noparse=false'; 480 Share.popup(url); 481 }, 482 facebook: function(purl, ptitle, pimg, text){ 483 url = 'https://www.facebook.com/sharer/sharer.php?'; 484 url += '&title=' + encodeURIComponent(ptitle); 485 url += '&description=' + encodeURIComponent(text); 486 url += '&u=' + encodeURIComponent(purl); 487 url += '&picture=' + encodeURIComponent(pimg); 488 Share.popup(url); 489 }, 490 twitter: function(purl, ptitle){ 491 url = 'http://twitter.com/share?'; 492 url += 'text=' + encodeURIComponent(ptitle); 493 url += '&url=' + encodeURIComponent(purl); 494 url += '&counturl=' + encodeURIComponent(purl); 495 Share.popup(url); 496 }, 497 498 499 popup: function(url){ 500 window.open(url, '', 'toolbar=0,status=0,width=626,height=436'); 501 } 502}; 503 504 505 506var link_empty_box = $("input.link_empty_box").val(); 507 508 509 510function controllerSliders(obj) 511{ 512 if(obj) 513 { 514 if(!obj.hasClass('slider-init')) 515 { 516 if( obj.hasClass('advantages-big-slide')) 517 initAdvantagesBigSlider(obj); 518 519 if( obj.hasClass('advantages-small-slide')) 520 initAdvantagesSmallSlider(obj); 521 522 if( obj.hasClass('slider-gallery')) 523 initGallerySlider(obj); 524 525 if( obj.hasClass('slider-services')) 526 initServiceSlider(obj); 527 528 if( obj.hasClass('opinion-slider')) 529 initOpSlider(obj); 530 531 if( obj.hasClass('tariff-flat')) 532 initTariffsElements(obj); 533 } 534 } 535} 536 537function setChangerBlocks() { 538 $("div.changer-blocks").each( 539 function() 540 { 541 var block = $(this); 542 543 $("div.changer-link-js", block).each( 544 function(index, value) 545 { 546 var arIds = $(this).attr("data-id").split(","); 547 548 if(arIds) 549 { 550 for (var i = 0; i < arIds.length; i++) { 551 552 if($(this).hasClass("active")) 553 { 554 $("div#block"+arIds[i]).removeClass("hidden"); 555 $('.lazyload').Lazy(paramsLazy); 556 557 var obj = $("div#block"+arIds[i]).find(".parent-slider-item-js"); 558 559 controllerSliders(obj); 560 } 561 562 } 563 } 564 565 } 566 ); 567 } 568 ); 569 570 571 $("div.changer-link-js").click( 572 function() 573 { 574 var block = $(this).parents("div.changer-blocks"); 575 576 $("div.changer-link-js", block).removeClass("active"); 577 $(this).addClass("active"); 578 579 $("div.changer-link-js", block).each( 580 function(index, value) 581 { 582 var arIds = $(this).attr("data-id").split(","); 583 584 if(arIds) 585 { 586 for (var i = 0; i < arIds.length; i++) { 587 $("div#block"+arIds[i]).addClass("hidden"); 588 } 589 } 590 591 } 592 ); 593 594 var arIds = $(this).attr("data-id").split(","); 595 596 if(arIds) 597 { 598 for (var i = 0; i < arIds.length; i++) { 599 $("div#block"+arIds[i]).removeClass("hidden"); 600 $('.lazyload').Lazy(paramsLazy); 601 var obj = $("div#block"+arIds[i]).find(".parent-slider-item-js"); 602 controllerSliders(obj); 603 } 604 } 605 606 607 608 609 } 610 ); 611} 612 613$(document).ready( 614 function(){ 615 616 if ( $(window).width() >= 991 ) 617 $(".slide-hidden-lg").remove(); 618 619 else 620 { 621 $(".slide-hidden-xs").remove(); 622 } 623 624 /*if ( $(window).width() >= 768) 625 $('div.wrap-first-slider.visible-xs').remove(); 626 627 628 if ( $(window).width() < 768) 629 $('div.wrap-first-slider.hidden-xs').remove();*/ 630 631 632 633 if(device.ios()) 634 $('div.block.parallax-attachment').removeClass('parallax-attachment'); 635 636 637 638 link_empty_box = $("input.link_empty_box").val(); 639 cur_pos = $(document).scrollTop(); 640 641 if ($(window).width() < 767) 642 { 643 var anim_callmob_in = setTimeout( 644 function(){ 645 $(".callphone-desc").show().addClass('active'); 646 clearTimeout(anim_callmob_in); 647 }, 5000); 648 649 var anim_callmob_out = setTimeout( 650 function(){ 651 $(".callphone-desc").removeClass('active'); 652 653 clearTimeout(anim_callmob_out); 654 }, 12000); 655 656 var anim_callmob_out2 = setTimeout( 657 function(){ 658 $(".callphone-desc").hide(); 659 660 clearTimeout(anim_callmob_out2); 661 }, 12500); 662 } 663 664 if ($(window).width() > 767){ 665 new WOW().init(); 666 $(window).enllax(); 667 668 var wow = new WOW({ 669 boxClass: 'parent-animate', 670 animateClass: 'animated', 671 offset: 0, 672 mobile: true, 673 live: true, 674 callback: function(box){ 675 var sec = 0; 676 677 $("div.child-animate", box).each( 678 function(){ 679 var elem = $(this); 680 681 var wowOut = setTimeout( 682 function(){ 683 elem.removeClass("opacity-zero").addClass("animated fadeIn"); 684 clearTimeout(wowOut); 685 686 }, sec); 687 688 sec += 500; 689 690 } 691 ); 692 }, 693 scrollContainer: null 694 }); 695 wow.init(); 696 } 697 698 $('[data-toggle="tooltip"]').tooltip({ 699 html:true, 700 container: "body" 701 }); 702 703 if ($(window).width() > 767){ 704 var scrllOut = setTimeout( 705 function(){ 706 $('div.down-scroll').addClass('active'); 707 clearTimeout(scrllOut); 708 }, 2500); 709 } 710 711 712 713 updateLazyLoad(); 714 715 716 $('.slider-news').slick({ 717 slidesToShow: 3, 718 slidesToScroll: 1, 719 dots: false, 720 infinite: false, 721 centerPadding: 0, 722 centerMode: false, 723 adaptiveHeight: false, 724 focusOnSelect: false, 725 responsive: [{ 726 727 breakpoint: 1200, 728 settings:{ 729 slidesToShow: 3, 730 infinite: true, 731 } 732 733 },{ 734 735 breakpoint: 991, 736 settings:{ 737 slidesToShow: 2 738 } 739 740 }, 741 { 742 743 breakpoint: 767, 744 settings:{ 745 slidesToShow: 1 746 747 } 748 749 }, 750 { 751 752 breakpoint: 0, 753 settings: "unslick" 754 755 }] 756 }); 757 758 759 if ($(window).width() > 1200){ 760 761 $('.elem-hover').hover( 762 763 function(){ 764 var total = parseInt($(this).find('.elem-hover-height-more').css('margin-bottom')) + $(this).find('.elem-hover-height').outerHeight(true); 765 $(this).css({ 766 'height': total + 'px' 767 }); 768 $(this).find('div.elem-hover-show').slideDown(150); 769 }, 770 771 function(){
772 $(this).find('div.elem-hover-show').slideUp(100); 773 } 774 775 ); 776 777 } 778 779 $("form.timer_form").each( 780 function(){ 781 timerCookie($(this)); 782 } 783 ); 784 /* open contacts on hover*/ 785 if ($(window).width() >= 1200){ 786 $('header .main-phone div.element.phone').hover( 787 function(){ 788 var itThis = $(this); 789 790 $.data(this, 'timer', setTimeout($.proxy(function(){ 791 792 $(itThis).parents(".main-phone").find('.list-contacts').stop(true, true).addClass('open'); 793 794 }, this), 300)); 795 796 797 }, 798 function(){ 799 clearTimeout($.data(this, 'timer')); 800 }); 801 802 803 $('header .main-phone div.ic-open-list-contact.open-list-contact').hover( 804 function(){ 805 806 var itThis = $(this); 807 808 $.data(this, 'timer', setTimeout($.proxy(function(){ 809 810 $(itThis).parents(".main-phone").find('.list-contacts').stop(true, true).addClass('open'); 811 812 }, this), 300)); 813 814 815 }, 816 function(){ 817 818 clearTimeout($.data(this, 'timer')); 819 820 }); 821 822 823 $('header .list-contacts').hover( 824 function(){}, 825 function(){ 826 $(this).removeClass('open'); 827 }); 828 829 } 830 else{ 831 832 $('header .main-phone div.element.phone').click( 833 function(){ 834 var itThis = $(this); 835 $(itThis).parents(".main-phone").find('.list-contacts').stop(true, true).addClass('open'); 836 } 837 ); 838 839 840 $('header .main-phone div.ic-open-list-contact.open-list-contact').hover( 841 function(){ 842 var itThis = $(this); 843 $(itThis).parents(".main-phone").find('.list-contacts').stop(true, true).addClass('open'); 844 845 } 846 ); 847 848 849 $(document).mouseup( 850 function(e){ 851 var div = $("header .list-contacts"); 852 853 if (!div.is(e.target) && div.has(e.target).length === 0 && div.hasClass("open")){ 854 div.removeClass('open'); 855 856 } 857 } 858 ); 859 860 } 861 862 863 if ($(window).width() > 1024){ 864 865 866 $('.services').find('.service-item').hover( 867 868 function(){ 869 var element_height = $(this).find('.service-element').height(); 870 var element_bot_height = $(this).find('.bot-wrap').height(); 871 var need_height = element_height - element_bot_height; 872 $(this).css({ 873 'height': need_height + 'px' 874 }); 875 }, 876 877 function(){ 878 $(this).css({ 879 'height': 'auto' 880 }); 881 } 882 883 ); 884 885 } 886 else{ 887 $('.services').find('.service-item').hover( 888 function(){ 889 $(this).css({ 890 'height': 'auto' 891 }); 892 } 893 ); 894 } 895 896 897 /* slider*/ 898 899 if($("div").is(".slider-services")) 900 { 901 902 function slide_animation_out(slider){ 903 904 var animOut = setTimeout(function(){ 905 slider.find('.slick-current .image-wrap img').addClass('animated zoomOutRight'); 906 clearTimeout(animOut); 907 }, 500); 908 909 var animOut2 = setTimeout(function(){ 910 slider.find('.image-wrap img').removeClass('show-on'); 911 slider.find('.image-wrap img').removeClass('animated zoomOutRight'); 912 clearTimeout(animOut2); 913 }, 1500); 914 915 var animOut3 = setTimeout(function(){ 916 slider.find('.images-animate .slick-current img').addClass('animated fadeOutLeft'); 917 clearTimeout(animOut3); 918 }, 500); 919 920 var animOut4 = setTimeout(function(){ 921 slider.find('.images-animate img').removeClass('show-on'); 922 slider.find('.images-animate img').removeClass('animated fadeOutLeft'); 923 clearTimeout(animOut4); 924 }, 1500); 925 926 927 slider.find('.slick-current .text-wrap').addClass('animated fadeOut'); 928 929 930 var animOut5 = setTimeout(function(){ 931 slider.find('.text-wrap').removeClass('show-on'); 932 slider.find('.text-wrap').removeClass('animated fadeOut'); 933 clearTimeout(animOut5); 934 }, 1500); 935 } 936 937 function slide_animation_in(slider){ 938 939 slider.find('.slick-current .image-wrap img').addClass('animated fadeInLeft'); 940 slider.find('.slick-current .image-wrap img').addClass('show-on'); 941 942 var animIn = setTimeout(function(){ 943 slider.find('.image-wrap img').removeClass('animated fadeInLeft'); 944 clearTimeout(animIn); 945 946 }, 1000); 947 948 slider.find('.images-animate .slick-current img').addClass('animated fadeInRight'); 949 slider.find('.images-animate .slick-current img').addClass('show-on'); 950 951 var animIn1 = setTimeout(function(){ 952 slider.find('.images-animate img').removeClass('animated fadeInRight'); 953 clearTimeout(animIn1); 954 }, 1000); 955 956 957 slider.find('.text-wrap').removeClass('animated fadeIn'); 958 959 var animIn2 = setTimeout(function(){ 960 slider.find('.slick-current .text-wrap').addClass('show-on'); 961 slider.find('.slick-current .text-wrap').addClass('animated fadeIn'); 962 clearTimeout(animIn2); 963 }, 1000); 964 } 965 966 $('.slider-services-wrap button.slick-prev').click( 967 968 function() 969 { 970 var slider = $(this).closest('.block'); 971 972 if ($(window).width() > 767){ 973 slide_animation_out(slider); 974 975 var servOut = setTimeout(function(){ 976 slider.find('.slider-services').slick("slickPrev"); 977 slider.find('.slider-services-images').slick("slickPrev"); 978 979 slide_animation_in(slider); 980 981 clearTimeout(servOut); 982 983 }, 1500); 984 } 985 986 else{ 987 slider.find('.slider-services').slick("slickPrev"); 988 989 } 990 991 992 993 994 } 995 996 ); 997 998 $('.slider-services-wrap button.slick-next').click( 999 function() 1000 1001 { 1002 var slider = $(this).closest('.block'); 1003 1004 if ($(window).width() > 767){ 1005 1006 slide_animation_out(slider); 1007 1008 var servOut = setTimeout(function(){ 1009 slider.find('.slider-services').slick("slickNext"); 1010 slider.find('.slider-services-images').slick("slickNext"); 1011 1012 slide_animation_in(slider); 1013 1014 clearTimeout(servOut); 1015 1016 }, 1500); 1017 1018 } 1019 1020 else{ 1021 slider.find('.slider-services').slick("slickNext"); 1022 1023 } 1024 1025 1026 } 1027 1028 ); 1029 } 1030 /* ^slider*/ 1031 1032 1033 /* expired*/ 1034 $("div.expired-page").height($(document).height()); 1035 $("div.error-404").height($(document).height()); 1036 /*expired*/ 1037 1038 1039 1040 1041 1042 } 1043 1044); 1045 1046$(document).ready(function() 1047{ 1048 if($('div.first-slider.slider-lg').length>0) 1049 initFSlider($('div.first-slider.slider-lg'), "lg"); 1050 1051 if($('div.first-slider.slider-xs').length>0) 1052 initFSlider($('div.first-slider.slider-xs'), "xs"); 1053 1054 1055 setChangerBlocks(); 1056}); 1057 1058function initFSlider(obj, size){ 1059 var adaptiveMob = ($(window).width() < 768 && $(".wrap-first-slider").attr("data-mobile-height") == "Y") ? false : true, 1060 sizeSlides = $('div.first-slider div.first-block').length, 1061 params = {}; 1062 1063 1064 if(size == "lg") 1065 { 1066 params = { 1067 dots: false, 1068 infinite: true, 1069 adaptiveHeight: false, 1070 speed: 500, 1071 pauseOnFocus: false, 1072 pauseOnHover: false 1073 }; 1074 } 1075 else if(size == "xs") 1076 { 1077 params = { 1078 dots: false, 1079 infinite: true, 1080 adaptiveHeight: false, 1081 speed: 500, 1082 pauseOnFocus: false, 1083 pauseOnHover: false, 1084 responsive: [ 1085 { 1086 1087 breakpoint: 767, 1088 settings:{ 1089 adaptiveHeight: adaptiveMob, 1090 1091 } 1092 1093 }, 1094 { 1095 1096 breakpoint: 0, 1097 settings: "unslick" 1098 1099 }] 1100 }; 1101 } 1102 1103 obj.on('init', function(event, slick){ 1104 obj.find(".first-block").removeClass('noactive-slide-lazyload'); 1105 obj.addClass("slider-init"); 1106 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1107 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1108 } 1109 }); 1110 1111 obj.on('beforeChange', function(event, slick, currentSlide, nextSlide) 1112 { 1113 $(".lazyload").Lazy(); 1114 } 1115 ); 1116 1117 if($(".wrap-first-slider").attr("data-autoslide") == "Y") 1118 { 1119 params["autoplaySpeed"] = $(".wrap-first-slider").attr("data-autoslide-time"); 1120 params["autoplay"] = true; 1121 } 1122 1123 obj.slick(params); 1124 1125 1126 1127 if ( $(window).width() >= 768 || ($(window).width() < 768 && $(".wrap-first-slider").attr("data-mobile-height") == "Y")) 1128 { 1129 1130 var height1 = 0; 1131 var height2 = 0; 1132 1133 1134 $('div.first-slider div.first-block').each( 1135 function(index){ 1136 1137 1138 if ($(this).outerHeight() > height2){ 1139 height1 = $(this).height(); 1140 height2 = $(this).outerHeight(); 1141 } 1142 1143 1144 if(sizeSlides == index+1) 1145 { 1146 1147 $('div.first-slider div.first-block-container').css("height", height1); 1148 1149 if ( $(".wrap-first-slider").attr("data-desktop-height") == "Y") 1150 { 1151 if ($(window).height() > $(".wrap-first-slider").height()) 1152 $(".wrap-first-slider").find(".slick-track").css("height", $(window).height() + 1153 "px"); 1154 } 1155 1156 if ( ($(window).width() < 768 && $(".wrap-first-slider").attr("data-mobile-height") == "Y") ) 1157 { 1158 if ($(window).height() > $(".wrap-first-slider").height()) 1159 $(".wrap-first-slider").find(".slick-track").css("height", $(window).height() + 1160 "px"); 1161 } 1162 1163 if(obj.find(".videoBG").length>0) 1164 { 1165 $(obj.find(".videoBG")).each( 1166 function(index) 1167 { 1168 correctSizeVideoBg($(this)); 1169 } 1170 ); 1171 } 1172 1173 } 1174 1175 } 1176 ); 1177 1178 1179 } 1180 1181 1182 if( $(window).width() < 768 ) 1183 { 1184 if ( $(".wrap-first-slider").attr("data-mobile-height") == "Y") 1185 { 1186 if ($(window).height() > $(".wrap-first-slider").height()) 1187 $(".wrap-first-slider").find(".slick-track").css("height", $(window).height() + 1188 "px"); 1189 1190 console.log(); 1191 } 1192 } 1193 1194} 1195 1196function initAdvantagesBigSlider(obj){ 1197 obj.on('init', function(event, slick){ 1198 obj.find(".slick-slide").removeClass('noactive-slide-lazyload'); 1199 obj.addClass("slider-init"); 1200 1201 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1202 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1203 } 1204 }); 1205 1206 1207 obj.slick({ 1208 dots: true, 1209 adaptiveHeight: false 1210 }); 1211} 1212 1213function initAdvantagesSmallSlider(obj){ 1214 obj.on('init', function(event, slick){ 1215 obj.find(".slick-slide").removeClass('noactive-slide-lazyload'); 1216 obj.addClass("slider-init"); 1217 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1218 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1219 } 1220 }); 1221 1222 1223 1224 obj.slick({ 1225 dots: true, 1226 slidesToShow: 2, 1227 adaptiveHeight: false, 1228 slidesToScroll: 2, 1229 responsive: [{ 1230 breakpoint: 767, 1231 settings: { 1232 slidesToShow: 1, 1233 slidesToScroll: 1 1234 } 1235 }, { 1236 breakpoint: 0, 1237 settings: "unslick" 1238 }] 1239 }); 1240} 1241 1242function initGallerySlider(obj){
1243 var count = parseInt(obj.attr("data-slide-visible")); 1244 obj.on('init', function(event, slick){ 1245 obj.find(".slick-slide").removeClass('noactive-slide-lazyload'); 1246 obj.addClass("slider-init"); 1247 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1248 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1249 } 1250 }); 1251 1252 1253 obj.slick({ 1254 dots: true, 1255 adaptiveHeight: true, 1256 slidesToScroll: count, 1257 slidesToShow: count, 1258 responsive: [{ 1259 breakpoint: 767, 1260 settings: { 1261 slidesToShow: 1, 1262 slidesToScroll: 1, 1263 } 1264 }, { 1265 breakpoint: 0, 1266 settings: "unslick" 1267 }] 1268 }); 1269} 1270 1271 1272function tariffsHeightRound (obj) 1273{ 1274 1275 var cols = 0; 1276 var cur_row = 1; 1277 1278 var heights = new Array(); 1279 1280 if($(window).width() >= 1200) 1281 cols = obj.attr("data-col-lg"); 1282 1283 if($(window).width() >= 992 && $(window).width() <= 1199) 1284 cols = obj.attr("data-col-md"); 1285 1286 if($(window).width() >= 768 && $(window).width() <= 991) 1287 cols = obj.attr("data-col-sm"); 1288 1289 var quantity = obj.find(".tarif-element-inner").length; 1290 var max_height = 0; 1291 1292 obj.find(".tarif-element-inner").each( 1293 function(index){ 1294 var cur_element = index + 1; 1295 1296 1297 if(max_height < $(this).height()) 1298 max_height = $(this).height(); 1299 1300 1301 if(cur_element % cols == 0 || cur_element == quantity) 1302 { 1303 1304 heights[cur_row] = max_height; 1305 cur_row++; 1306 max_height = 0; 1307 } 1308 1309 } 1310 ); 1311 1312 cur_row = 1; 1313 1314 obj.find(".tarif-element-inner").each( 1315 function(index){ 1316 var cur_element = index + 1; 1317 var top_height = $(this).find(".trff-top-part").height(); 1318 1319 $(this).height(heights[cur_row]); 1320 $(this).find(".trff-top-part").height(top_height + (heights[cur_row] - $(this).find(".trff-top-part").height() - $(this).find(".trff-bot-part").height())); 1321 1322 if(cur_element % cols == 0) 1323 cur_row++; 1324 } 1325 ); 1326} 1327 1328function initTariffsElements(obj){ 1329 if ($(window).width() > 767) 1330 { 1331 if(obj.attr("data-round-height") == "Y") 1332 { 1333 if(typeof($('.lazyload', obj))!="undefined") 1334 { 1335 if($('.lazyload', obj).length > 0) 1336 { 1337 var countItems = $('.lazyload', obj).length; 1338 $('.lazyload', obj).each( 1339 function(index, element) 1340 { 1341 $(element).attr("src", $(element).attr("data-src")); 1342 $(element).removeAttr('data-src'); 1343 1344 $(element).load(function() 1345 { 1346 if(index == countItems-1) 1347 { 1348 tariffsHeightRound (obj); 1349 } 1350 }); 1351 } 1352 1353 ); 1354 1355 } 1356 1357 else 1358 { 1359 tariffsHeightRound (obj); 1360 } 1361 1362 } 1363 1364 1365 1366 } 1367 1368 1369 } 1370 1371} 1372 1373function initOpSlider(obj){ 1374 obj.on('init', function(event, slick){ 1375 obj.find(".slick-slide").removeClass('noactive-slide-lazyload'); 1376 obj.addClass("slider-init"); 1377 1378 1379 $('.lazyload', obj).each( 1380 function(index, element) 1381 { 1382 $(element).attr("src", $(element).attr("data-src")); 1383 $(element).removeAttr('data-src'); 1384 } 1385 1386 ); 1387 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1388 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1389 } 1390 }); 1391 1392 obj.on('beforeChange', function(event, slick, currentSlide, nextSlide){ 1393 $('.lazyload', obj).each( 1394 function(index, element) 1395 { 1396 $(element).attr("src", $(element).attr("data-src")); 1397 $(element).removeAttr('data-src'); 1398 } 1399 1400 ); 1401 }); 1402 1403 var count = obj.attr('data-count'); 1404 1405 if (count == 1) 1406 { 1407 $('.slider-for', obj).slick({ 1408 slidesToShow: 1,
1409 arrows: false, 1410 asNavFor: obj.find('.slider-nav'), 1411 appendArrows: obj.find('.slider-nav-wrap') 1412 }); 1413 $('.slider-nav', obj).slick({ 1414 slidesToShow: 1, 1415 asNavFor: obj.find('.slider-for'), 1416 centerPadding: 0, 1417 dots: false, 1418 centerMode: true, 1419 focusOnSelect: true, 1420 }); 1421 obj.addClass("one-slide"); 1422 } 1423 else if (count == 2) 1424 { 1425 $('.slider-for', obj).slick({ 1426 slidesToShow: 1, 1427 slidesToScroll: 1, 1428 speed: 300, 1429 fade: true, 1430 adaptiveHeight: true, 1431 arrows: false, 1432 asNavFor: obj.find('.slider-nav'), 1433 appendArrows: obj.find('.slider-nav-wrap') 1434 }); 1435 $('.slider-nav', obj).slick({ 1436 slidesToShow: 2, 1437 slidesToScroll: 1, 1438 speed: 300, 1439 asNavFor: obj.find('.slider-for'), 1440 centerPadding: 0, 1441 dots: false, 1442 centerMode: true, 1443 focusOnSelect: true, 1444 responsive: [{ 1445 breakpoint: 1200, 1446 settings: { 1447 slidesToShow: 2, 1448 infinite: true, 1449 } 1450 }, { 1451 breakpoint: 991, 1452 settings: { 1453 slidesToShow: 1 1454 } 1455 }, { 1456 breakpoint: 0, 1457 settings: "unslick" 1458 }] 1459 }); 1460 } 1461 else 1462 { 1463 $('.slider-for', obj).slick({ 1464 slidesToShow: 1, 1465 slidesToScroll: 1, 1466 speed: 300, 1467 fade: true, 1468 adaptiveHeight: true, 1469 arrows: false, 1470 asNavFor: obj.find('.slider-nav'), 1471 appendArrows: obj.find('.slider-nav-wrap') 1472 }); 1473 $('.slider-nav', obj).slick({ 1474 slidesToShow: 3, 1475 slidesToScroll: 1, 1476 speed: 300, 1477 asNavFor: obj.find('.slider-for'), 1478 centerPadding: 0, 1479 dots: false, 1480 centerMode: true, 1481 focusOnSelect: true, 1482 responsive: [{ 1483 breakpoint: 1200, 1484 settings: { 1485 slidesToShow: 3, 1486 infinite: true, 1487 } 1488 }, { 1489 breakpoint: 991, 1490 settings: { 1491 slidesToShow: 1 1492 } 1493 }, { 1494 breakpoint: 0, 1495 settings: "unslick" 1496 }] 1497 }); 1498 } 1499 1500} 1501 1502function initServiceSlider(obj){ 1503 1504 obj.on('init', function(event, slick){ 1505 1506 var sliderHeightMax = 0; 1507 1508 obj.find(".element-table").each( 1509 function(){ 1510 if ($(this).height() > sliderHeightMax){ 1511 sliderHeightMax = $(this).height(); 1512 } 1513 1514 } 1515 ); 1516 1517 obj.find(".element-table").height(sliderHeightMax); 1518 obj.find(".slick-slide").removeClass('noactive-slide-lazyload'); 1519 obj.addClass("slider-init"); 1520 if(obj.parents(".parent-video-bg").find(".videoBG").length>0){ 1521 correctSizeVideoBg(obj.parents(".parent-video-bg").find(".videoBG")); 1522 } 1523 }); 1524 1525 1526 obj.parents("div.block").find('.slider-services-images').on('init', function(event, slick){ 1527 obj.parents("div.block").find('.slider-services-images').find(".slick-slide").removeClass('noactive-slide-lazyload'); 1528 }); 1529 1530 1531 1532 obj.slick({ 1533 slidesToShow: 1, 1534 slidesToScroll: 1, 1535 speed: 0, 1536 fade: true, 1537 adaptiveHeight: false, 1538 arrows: false, 1539 swipe: false, 1540 touchMove: false, 1541 asNavFor: obj.parents("div.block").find('.slider-services-images') 1542 }); 1543 1544 obj.parents("div.block").find('.slider-services-images').slick({ 1545 slidesToShow: 1, 1546 slidesToScroll: 1, 1547 asNavFor: obj.parents("div.block").find('.slider-services'), 1548 centerPadding: 0, 1549 arrows: false, 1550 speed: 0, 1551 fade: true, 1552 dots: false, 1553 centerMode: true, 1554 focusOnSelect: true 1555 }); 1556} 1557 1558$(window).load( 1559 function() 1560 { 1561 var url = location.href; 1562 url = url.split("#"); 1563 1564 if (typeof(url[1]) != "undefined"){ 1565 1566 if(url[1].length<20) 1567 { 1568 if($("#"+url[1]).length>0) 1569 scrollToBlock("#" + url[1], false); 1570 } 1571 } 1572 } 1573); 1574 1575 1576 1577$(window).load( 1578 function() 1579 { 1580 if(customEvent) 1581 updateLazyLoad(); 1582 } 1583); 1584 1585function buildMenu() 1586{ 1587 if($(".menu-type2").hasClass("active") || $(".menu-type3").hasClass("active")){ 1588 var menu = $('.menu-type2').find('.main-menu-nav'); 1589 var totalWidth = menu.parents('div.nav-wrap').width() - menu.parents('div.nav-wrap').find("div.burger").width(); 1590 1591 menu.parents('div.nav-wrap').find("div.burger").addClass("noactive"); 1592 1593 if ($(document).width() > 767){ 1594 var visible = 0; 1595 1596 1597 var size = menu.find('li.lvl1').length; 1598 menu.find('li.lvl1').each( 1599 function(index){ 1600 1601 if (visible == 3){ 1602 $(this).parent().addClass("full-area"); 1603 } 1604 if (totalWidth > ($(this).width())){ 1605 totalWidth = totalWidth - $(this).width(); 1606 $(this).addClass('visible'); 1607 visible++; 1608 1609 if(size == (index+1)) 1610 $(".menu-type2").addClass('ready'); 1611 } 1612 else{ 1613 1614 menu.parents('div.nav-wrap').find("div.burger").addClass("active").removeClass("noactive"); 1615 $(".menu-type2").addClass('ready'); 1616 return false;
1617 } 1618 1619 } 1620 ); 1621 } 1622 } 1623} 1624 1625$(document).ready(function() { 1626 buildMenu(); 1627}); 1628 1629 1630$(window).load( 1631 function(){ 1632 1633 1634 if($(window).width()>767 && $("header").hasClass('menu-scroll-open')) 1635 { 1636 1637 var menuSlide = $('.menu-slide').find('.main-menu-nav-slide'); 1638 var totalWidthSlide = menuSlide.parents("div.wrapper-main-menu").width() - menuSlide.parents("div.menu-slide-wrap").find("div.burger-slide").width(); 1639 var visibleSlide=0; 1640 1641 menuSlide.parents("div.menu-slide-wrap").find("div.burger-slide").addClass("noactive"); 1642 1643 1644 1645 menuSlide.find('li.lvl1').each( 1646 function(index) 1647 { 1648 1649 if(totalWidthSlide > ($(this).width())) 1650 { 1651 totalWidthSlide = totalWidthSlide - $(this).width(); 1652 $(this).addClass('visible'); 1653 visibleSlide++; 1654 1655 } 1656 else 1657 { 1658 menuSlide.parents("div.menu-slide-wrap").find("div.burger-slide").addClass("active").removeClass("noactive"); 1659 return false; 1660 } 1661 1662 1663 1664 } 1665 1666 ); 1667 } 1668 1669 $("div.box-body-height").css("top", $("div.box-head-height").outerHeight()+"px"); 1670 1671 } 1672); 1673 1674function correctSizeVideoBg(obj) 1675{ 1676 var height = obj.parents('.parent-video-bg').outerHeight(); 1677 var videoThis = obj.find(".video-bg-display"); 1678 1679 var width = $(window).width(); 1680 1681 var video_w = 0; 1682 var video_h = 0; 1683 1684 var add = 4; 1685 1686 if (width / height < 16 / 9){ 1687 video_w = height * 16 / 9 + add; 1688 video_h = height + add; 1689 } 1690 1691 else{ 1692 video_w = width + add; 1693 video_h = width * 9 / 16 + add; 1694 } 1695 1696 videoThis.width(video_w).height(video_h); 1697 videoThis.addClass('active'); 1698} 1699 1700 1701function generateVideoBG(container) 1702{ 1703 if($(window).width() >= 1200 || ($(window).width() >= 768 && $(window).width() < 1200 && !device.android() && !device.ios()) ) 1704 { 1705 var videoBG = $(".videoBG", container), 1706 iframeType = videoBG.attr("data-type"), 1707 srcMP4 = videoBG.attr("data-srcMP4"), 1708 srcWEBM = videoBG.attr("data-srcWEBM"), 1709 srcOGG = videoBG.attr("data-srcOGG"), 1710 srcYB = videoBG.attr("data-srcYB"), 1711 html = ""; 1712 1713 1714 1715 if(iframeType == "file") 1716 { 1717 if(videoBG.children('video').length <= 0) 1718 { 1719 if( srcMP4 ) 1720 html += '<source src="'+srcMP4+'" type="video/mp4">'; 1721 1722 if( srcWEBM ) 1723 html += '<source src="'+srcWEBM+'" type="video/webm">'; 1724 1725 if( srcOGG ) 1726 html += '<source src="'+srcOGG+'" type="video/ogg">'; 1727 1728 1729 html = '<video class="video-bg-display" autoplay="autoplay" loop="loop" preload="auto" muted="muted">'+html+'</video>'; 1730 } 1731 } 1732 1733 else if(iframeType == "iframe") 1734 { 1735 1736 if(videoBG.children('iframe').length <= 0) 1737 { 1738 if( srcYB ) 1739 html += '<iframe src="'+srcYB+'" class="video-bg-display" allowfullscreen="" frameborder="0" height="100%" width="100%"></iframe>'; 1740 } 1741 } 1742 1743 if( html ) 1744 videoBG.prepend(html); 1745 1746 correctSizeVideoBg(videoBG); 1747 1748 } 1749} 1750 1751/*click-scroll*/ 1752$(document).on("click", "a.scroll", 1753 function(){ 1754 var elementClick = $(this).attr("href"); 1755 1756 if ($(this).hasClass('close-from-menu')){ 1757 1758 $('.slide-menu').removeClass('on'); 1759 var mnuOut = setTimeout( 1760 function(){ 1761 $('.slide-menu').removeClass('open'); 1762 clearTimeout(mnuOut); 1763 1764 }, 1000); 1765 $('body').removeClass('menu-open'); 1766 $('.wrapper').removeClass('blur-menu'); 1767 $('a.menu-slide-close').addClass('hidden').removeClass('on'); 1768 $('div.no-click-block').removeClass('on'); 1769 } 1770 1771 if ($(this).hasClass('from-tariff')){ 1772 $('body').removeClass('modal-open'); 1773 $('.wrapper').removeClass('blur'); 1774 $('div.no-click-block').removeClass('on'); 1775 $(this).parents(".wrap-modal").removeClass("open"); 1776 } 1777 1778 1779 1780 1781 1782 scrollToBlock(elementClick); 1783 1784 return false;
1785 1786 1787 } 1788); 1789 1790 1791/*catalog-modal tabs in detail cart*/ 1792$(document).on('click', 'ul.tab-child li:not(.active)', 1793 function(){ 1794 $(this).addClass('active').siblings().removeClass('active').closest('div.tab-parent').find('div.tab-content').removeClass('active').eq($(this).index()).addClass('active'); 1795 1796 } 1797); 1798 1799 1800/*catalog-modal-tabs-images in detail cart*/ 1801$(document).on('click', 'div.image-dots div.image-wrap-dot:not(.active)', 1802 function(){ 1803 $(this).addClass('active').siblings().removeClass('active').closest('div.images-content').find('div.image-child').removeClass('active').eq($(this).index()).addClass('active'); 1804 1805 } 1806); 1807 1808 1809/*for catalog completcs view radiobutton*/ 1810$(document).on('click', 'div.catalog-body div.price-radio label:not(.active)', 1811 function(){ 1812 $(this).addClass('active').siblings().removeClass('active'); 1813 1814 } 1815); 1816 1817 1818$(document).on('click', 'ul.switcher-tab li:not(.active)', 1819 function(){ 1820 $(this).addClass('active').siblings().removeClass('active').closest('div.switcher').find('div.switcher-wrap').removeClass('active').eq($(this).index()).addClass('active'); 1821 1822 } 1823); 1824 1825$(document).on('click', 'a[data-button="wind-modal"]', 1826 function(){ 1827 $('div.wrapper').addClass('blur'); 1828 $("div.click-for-reset").addClass("on"); 1829 1830 } 1831); 1832 1833 1834$(document).on('click', 'a[data-button="wind-in-modal"]', 1835 function(){ 1836 $('div.wrapper').addClass('blur'); 1837 $(this).closest('.wrap-modal.open').addClass('blur'); 1838 $("div.click-for-reset").addClass("on"); 1839 1840 } 1841); 1842 1843 1844$(document).on('click', 'a.map-show', 1845 function(){ 1846 $(this).parent().hide(); 1847 $(this).parents('div.map-block').find(".map-height").show(); 1848 1849 } 1850); 1851 1852/*for descriptive tabs*/ 1853$(document).on("click", "ul.tabs li:not(.active)", 1854 function(){ 1855 $(this).addClass('active').siblings().removeClass('active').closest('div.descriptive-tabs-wrap').find('div.image-content').removeClass('active').eq($(this).index()).addClass('active'); 1856 $('.lazyload').Lazy(paramsLazy); 1857 } 1858); 1859 1860 1861/*for descriptive show mob-tab*/ 1862$(document).on("click", "div.mob-tab", 1863 function(){ 1864 var block = $(this).parent("div.image-content"); 1865 1866 if (!$(this).hasClass("active")){ 1867 1868 if ($("img", block).attr("data-src")) 1869 { 1870 var _this = $(this); 1871 1872 $("img", block).Lazy({ 1873 afterLoad: function (element) { 1874 $("img", block).removeAttr('style'); 1875 1876 _this.addClass("active"); 1877 1878 $("div.mob-content", block).slideDown(200, function() { 1879 $(this).removeClass("active"); 1880 }); 1881 } 1882 }); 1883 } 1884 else 1885 { 1886 $(this).addClass("active"); 1887 $("div.mob-content", block).slideDown(200, function() { 1888 $(this).removeClass("active"); 1889 }); 1890 } 1891 1892 } 1893 1894 else{ 1895 $(this).removeClass("active"); 1896 1897 1898 $("div.mob-content", block).slideUp(200, 1899 function(){ 1900 $(this).removeClass("active"); 1901 } 1902 ); 1903 } 1904 1905 1906 } 1907); 1908 1909 1910 1911 1912/*open slide-menu*/ 1913$(document).on("click", "a.click-op-menu", 1914 function(){ 1915 var button = $(this); 1916 $('.menu-slide-close').removeClass('hidden'); 1917 $('.slide-menu').addClass('open'); 1918 1919 size_slide_menu(); 1920 1921 var mnuOut = setTimeout( 1922 function(){ 1923 $('.slide-menu').addClass('on'); 1924 clearTimeout(mnuOut); 1925 }, 100); 1926 1927 $('body').addClass('menu-open'); 1928 $('.wrapper').addClass('blur-menu'); 1929 $('div.no-click-block').addClass('on'); 1930 1931 var mnuOut2 = setTimeout( 1932 function(){ 1933 $('.menu-slide-close').addClass('on'); 1934 clearTimeout(mnuOut2); 1935 }, 800); 1936 1937 $('.lazyload').Lazy(paramsLazy); 1938 1939 1940 } 1941); 1942 1943 1944$(document).on("click", "a.click-cl-menu", 1945 function(){ 1946 var button = $(this); 1947 1948 $('.slide-menu').removeClass('on'); 1949 var mnuOut = setTimeout( 1950 function(){ 1951 $('.slide-menu').removeClass('on'); 1952 clearTimeout(mnuOut); 1953 1954 }, 1000); 1955 $('body').removeClass('menu-open'); 1956 $('.wrapper').removeClass('blur-menu'); 1957 button.addClass('hidden').removeClass('on'); 1958 $('div.no-click-block').removeClass('on'); 1959 1960 } 1961); 1962 1963 1964/*key only numbers*/ 1965$(document).on("keypress", "form.form div.count input", 1966 function(e){ 1967 e = e || event; 1968 1969 if (e.ctrlKey || e.altKey || e.metaKey) return; 1970 1971 var chr = getChar(e); 1972 1973 if (chr == null) return false;
1974 1975 } 1976); 1977 1978 1979$(document).on("keyup", "form.form div.count input", 1980 function(e){ 1981 var value = $(this).val().toString(); 1982 1983 var newVal = ""; 1984 1985 for (var i = 0; i < value.length; i++){ 1986 if (value[i] == "0" || value[i] == "1" || value[i] == "2" || value[i] == "3" || value[i] == "4" || value[i] == "5" || value[i] == "6" || value[i] == "7" || value[i] == "8" || value[i] == "9") 1987 newVal += value[i]; 1988 } 1989 1990 if (newVal == 0) 1991 newVal = 1; 1992 1993 $(this).val(newVal); 1994 1995 if ($(this).val() == "") 1996 $(this).parent().addClass('in-focus'); 1997 1998 1999 2000 } 2001); 2002 2003$(document).on("click", "form.form div.count span.plus", 2004 function(){ 2005 var input = $(this).parent("div.count").find("input"); 2006 2007 input.parent().removeClass("has-error"); 2008 2009 var value = parseFloat(input.val()); 2010 2011 if (isNaN(value)) 2012 value = 0; 2013 2014 value += 1; 2015 2016 input.val(value); 2017 2018 if ($(this).val() == "") 2019 $(this).parent().addClass('in-focus'); 2020 2021 2022 2023 } 2024); 2025 2026$(document).on("click", "form.form div.count span.minus", 2027 function(){ 2028 var input = $(this).parent("div.count").find("input"); 2029 input.parent().removeClass("has-error"); 2030 2031 var value = parseFloat(input.val()); 2032 2033 if (isNaN(value)) 2034 value = 0; 2035 2036 value -= 1; 2037 2038 if (value < 0) 2039 value = ''; 2040 if (value == 0) 2041 value = 1; 2042 2043 input.val(value); 2044 2045 2046 2047 } 2048); 2049/*key only numbers end*/ 2050 2051$(document).on("click", "div.down-scroll", 2052 function(){ 2053 var s_b = $(this).parents('div.parent-scroll-down').next(), 2054 heightOut = 0; 2055 2056 if ($('header').hasClass('slide')) 2057 heightOut = 70; 2058 else{ 2059 heightOut = 0; 2060 } 2061 2062 while (s_b.hasClass('hidden-lg')) { 2063 s_b = s_b.next(); 2064 } 2065 2066 var destination = $(s_b).offset().top - heightOut; 2067 jQuery("html:not(:animated),body:not(:animated)").animate({ 2068 scrollTop: destination 2069 }, 700); 2070 2071 2072 2073 } 2074); 2075 2076 2077/*scroll menu-header*/ 2078var HeaderHeight = 500; 2079$(window).scroll(function(){ 2080 2081 2082 if($(window).width() <= 767) 2083 HeaderHeight = 300; 2084 2085 if ($(document).scrollTop() >= HeaderHeight){ 2086 $('header').addClass('top'); 2087 2088 var upOut = setTimeout( 2089 function(){ 2090 $('header').addClass('fixed'); 2091 clearTimeout(upOut); 2092 }, 100); 2093 2094 $('a.up').addClass('on'); 2095 2096 } 2097 else{ 2098 $("header").removeClass('fixed'); 2099 2100 var upOut = setTimeout( 2101 function(){ 2102 $('header').removeClass('fixed'); 2103 clearTimeout(upOut); 2104 }, 100); 2105 2106 $('header').removeClass('top'); 2107 2108 $('a.up').removeClass('on'); 2109 2110 } 2111 2112 2113}); 2114 2115 2116 2117 2118 2119 2120/*catalog-tabs-new*/ 2121$(document).on('click', 'div.tab-menu', 2122 function(){ 2123 $(this).parents('.tab-control').find('.tab-menu').removeClass('active'); 2124 $(this).parents('.tab-control').find('.tabb-content').removeClass('active'); 2125 2126 $(this).addClass('active'); 2127 $('.tabb-content[data-tab="' + $(this).attr("data-tab") + '"]').addClass('active'); 2128 2129 2130 } 2131); 2132$(document).on('click', '.show-hidden', 2133 function(){ 2134 2135 $(this).parents('.show-hidden-parent').find('.hidden').removeClass('hidden'); 2136 $(this).parent().addClass('off'); 2137 2138 } 2139); 2140 2141 2142$(document).on("click", ".click-slide-show", 2143 function(){ 2144 2145 var block = $(this).parent(".parent-slide-show"); 2146 2147 if (!$(this).hasClass("active")){ 2148 $(this).addClass("active"); 2149 $(".content-slide-show", block).slideDown(200, 2150 function(){ 2151 $(this).addClass("active"); 2152 } 2153 ); 2154 2155 } 2156 2157 else{ 2158 $(this).removeClass("active"); 2159 $(".content-slide-show", block).slideUp(200, 2160 function(){ 2161 $(this).removeClass("active"); 2162 } 2163 ); 2164 } 2165 2166 2167 } 2168); 2169 2170 2171/* box*/ 2172 2173$(document).on("click", ".box-show", 2174 function(){ 2175 if ($(this).hasClass('box-empty')) 2176 return false;
2177 2178 var from_mod_cat = "N"; 2179 2180 if ($(this).parents(".area_for_mini_box").hasClass('mod_cat_opened')) 2181 from_mod_cat = "Y"; 2182 2183 openBox(from_mod_cat); 2184}); 2185 2186 2187 2188$(document).on("click", ".box-close", 2189 function(){ 2190 2191 if (!$(".wrap-modal.open").hasClass('blur')){ 2192 $('.wrapper').removeClass('blur'); 2193 $('body').removeClass('modal-open'); 2194 } 2195 2196 if ($(".wrap-modal.open").hasClass('blur')) 2197 $(".wrap-modal.open").removeClass('blur'); 2198 2199 2200 $('div.box-parent').removeClass('on'); 2201 $('.no-click-block').removeClass('double'); 2202 2203 var closeCartOut = setTimeout( 2204 function(){ 2205 $('div.box-parent').removeClass('open'); 2206 clearTimeout(closeCartOut); 2207 }, 700 2208 ); 2209 2210 } 2211); 2212 2213 2214 2215$(document).on("keypress", "input.count-val", 2216 function(e){ 2217 2218 e = e || event; 2219 2220 if (e.ctrlKey || e.altKey || e.metaKey) return; 2221 2222 var chr = getChar(e); 2223 2224 if (chr == null) return false; 2225 } 2226); 2227 2228 2229$(document).on("blur", "input.count-val", 2230 function(e){ 2231 2232 e = e || event; 2233 2234 if (e.ctrlKey || e.altKey || e.metaKey) return; 2235 2236 var chr = getChar(e); 2237 2238 if (chr == null) return false; 2239 2240 var newVal = $(this).val(); 2241 2242 var step = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-step"); 2243 var minVal = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-min"); 2244 var idboxEl = parseFloat($(this).attr("data-box-id")); 2245 var action = $(this).attr("data-box-action"); 2246 var button = $(this); 2247 2248 var other_complect = $(this).parents(".parent-calcbox").find("input.other_complect_box").val(); 2249 2250 step = +step; 2251 minVal = +minVal; 2252 2253 if (isNaN(minVal)) 2254 minVal = 1; 2255 2256 if (isNaN(step)) 2257 step = 1; 2258 2259 newVal = +newVal; 2260 newVal = parseCount(newVal, step, minVal); 2261 2262 $(this).val(newVal); 2263 2264 updateBox(button, newVal, idboxEl, action, other_complect, ""); 2265 2266 2267 2268 } 2269); 2270 2271 2272function parseMinVal(value, step, minVal) 2273{ 2274 var tmpMin = step; 2275 2276 if(step < minVal) 2277 tmpMin = minVal; 2278 2279 if (value <= tmpMin || isNaN(value)) 2280 value = minVal; 2281 2282 return value; 2283} 2284 2285$(document).on("click", ".count-plus", 2286 function(){ 2287 var input = $(this).parents(".parent-calcbox").find("input.count-val"); 2288 2289 var value = +input.val(); 2290 var step = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-step"); 2291 var minVal = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-min"); 2292 2293 step = +step; 2294 minVal = +minVal; 2295 2296 if (isNaN(minVal)) 2297 minVal = 1; 2298 2299 if (isNaN(step)) 2300 step = 1; 2301 2302 if (isNaN(value)) 2303 value = 0; 2304 2305 value += step; 2306 value = parseMinVal(value, step, minVal); 2307 2308 input.val(value); 2309 2310 2311 } 2312); 2313 2314$(document).on("click", ".count-minus", 2315 function(){ 2316 var input = $(this).parents(".parent-calcbox").find("input.count-val"); 2317 var value = parseFloat(input.val()); 2318 var step = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-step"); 2319 var minVal = $(this).parents(".parent-calcbox").find("input.count-val").attr("data-box-min"); 2320 2321 step = +step; 2322 minVal = +minVal; 2323 2324 if (isNaN(minVal)) 2325 minVal = 1; 2326 2327 if (isNaN(step)) 2328 step = 1; 2329 2330 if (isNaN(value)) 2331 value = 0; 2332 2333 value -= step; 2334 value = parseMinVal(value, step, minVal); 2335 2336 input.val(value); 2337 2338 2339 } 2340); 2341 2342 2343 2344 2345$(document).on("click", ".click_box", 2346 function(){ 2347 2348 var countBox = parseFloat($(this).parents(".parent-calcbox").find("input.count-val").val()); 2349 var idboxEl = parseFloat($(this).attr("data-box-id")); 2350 var action = $(this).attr("data-box-action"); 2351 var button = $(this); 2352 2353 if(device.ios()){ 2354 cur_pos = $(document).scrollTop(); 2355 } 2356 2357 if ($(this).attr("data-box-action") == "add" && !$(this).hasClass('added') && !$(this).hasClass('from_modal_cat')){ 2358 var obj_img = $("img[data-box-id-img = '" + idboxEl + "']"); 2359 var mini_box = $(".open-box"); 2360 2361 if($(window).width() < 767) 2362 mini_box = $(".open-box-mob"); 2363 2364 var width_parent_img = $(this).parents(".element").find("td.parent_anim_img_area").width() / 2; 2365 var height_parent_img = $(this).parents(".element").find("td.parent_anim_img_area").height() / 2; 2366 2367 obj_img.clone() 2368 2369 .css({ 2370 'width': 70 + 'px', 2371 'height': 70 + 'px', 2372 'position': 'absolute', 2373 'z-index': '9999', 2374 'borderRadius': 50 + '%', 2375 top: obj_img.offset().top + height_parent_img, 2376 left: obj_img.offset().left + width_parent_img 2377 }) 2378 2379 .appendTo("body") 2380 .animate({ 2381 opacity: 0.05, 2382 left: mini_box.offset()['left'], 2383 top: mini_box.offset()['top'], 2384 width: 20, 2385 height: 20 2386 }, 700, function(){ 2387 $(this).remove(); 2388 }); 2389 2390 2391 2392 addGoal('ADD2BASKET'); 2393 2394 2395 } 2396 2397 2398 2399 if (isNaN(countBox)) 2400 countBox = parseFloat($(this).attr("data-box-step")); 2401 2402 2403 var other_complect = ""; 2404 2405 if ($(this).hasClass('from_modal_cat')) 2406 other_complect = $(this).parents(".tabs-content").find("input[name='other_complect']:checked").val(); 2407 2408 2409 if (typeof(other_complect) != "undefined") 2410 { 2411 if (other_complect.length <= 0) 2412 other_complect = $(this).parents(".parent-calcbox").find("input.other_complect_box").val(); 2413 } 2414 2415 2416 if (typeof(other_complect) == "undefined") 2417 other_complect = ""; 2418 2419 2420 clearTimeout($.data(this, 'box_count')); 2421 2422 $.data(this, 'box_count', setTimeout($.proxy(function(){ 2423 2424 updateBox(button, countBox, idboxEl, action, other_complect, ""); 2425 2426 2427 2428 }, this), 700)); 2429 2430 2431 /* if(button.hasClass('added')) 2432 return false;*/ 2433 2434 2435 } 2436); 2437 2438 2439/*alert*/ 2440$(document).on("click", ".hameleon-alert-btn", 2441 function() 2442 { 2443 $("div.alert-block div.hameleon-alert-btn").addClass("on"); 2444 $("div.alert-block div.alert-block-content").addClass("on"); 2445 2446 } 2447); 2448 2449$(document).on("click", "a.alert-close", 2450 function() 2451 { 2452 $("div.alert-block div.hameleon-alert-btn").removeClass("on"); 2453 $("div.alert-block div.alert-block-content").removeClass("on"); 2454 2455 } 2456); 2457 2458$(document).on("click", "div.faq-block div.question", 2459 function() 2460 { 2461 var block = $(this).parents("div.faq-element"); 2462 2463 if (!block.hasClass("active")){ 2464 $("div.text", block).slideDown(200, 2465 function(){ 2466 block.addClass("active"); 2467 } 2468 ); 2469 } 2470 2471 else{ 2472 $("div.text", block).slideUp(200, 2473 function(){ 2474 block.removeClass("active"); 2475 } 2476 ); 2477 } 2478 2479 2480 2481 } 2482); 2483 2484$(document).on("click", "div.switcher-wrap div.switcher-title", 2485 function() 2486 { 2487 var block = $(this).parents("div.switcher-wrap"); 2488 2489 if (!block.hasClass("active")){ 2490 $("div.switcher-content", block).slideDown(200, 2491 function(){ 2492 2493 block.addClass("active"); 2494 } 2495 ); 2496 } 2497 2498 else{ 2499 $("div.switcher-content", block).slideUp(200, 2500 function(){ 2501 block.removeClass("active"); 2502 } 2503 ); 2504 } 2505 } 2506); 2507 2508 2509$(window).on("load", function() 2510{ 2511 2512 if($(".hide-adv").length>0) 2513 { 2514 setTimeout(function() 2515 { 2516 var sessid = ""; 2517 if(typeof BX !== "undefined" && typeof BX.bitrix_sessid === "function") 2518 sessid = BX.bitrix_sessid(); 2519 if(!sessid.length) 2520 { 2521 var sessidInput = $("input[name='sessid']").first(); 2522 if(sessidInput.length > 0) 2523 sessid = sessidInput.val(); 2524 } 2525 2526 $.post( 2527 "/bitrix/templates/concept_hameleon/ajax/hide_adv.php", 2528 { 2529 "check": "Y", 2530 "USER_ID": $(".hide-adv").attr("data-user"), 2531 "sessid": sessid 2532 }, 2533 function(data){ 2534 if(data.OK == "Y") 2535 { 2536 $("body").append('<script type="text/javascript">
vendor: 287 bytes, line 2536
2536 (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(
253654591493
vendor: 76 bytes, line 2536
2536, "init", { clickmap:false, trackLinks:false, accurateTrackBounce:false });
2536</script> <noscript><div><img src="https://mc.yandex.ru/watch/54591493" style="position:absolute; left:-9999px;" alt="" /></div></noscript><script>ym(54591493, \'reachGoal\', \'hide_hameleon\');</script>'); 2537 } 2538 }, 2539 "json" 2540 ); 2541 2542 }, 13000); 2543 } 2544});
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.