1(function ($) { 2 $.simpleSlider = function(options){ 3 var gal = options.gal, 4 items = gal.find(options.itemWrap), 5 itemLength = items.children(options.item).length, 6 frame = items.width() + parseInt(items.children().eq(0).css('margin-right')), 7 step = 0, 8 pag = options.pag; 9 10 for(var i=0; i<itemLength; i++) { 11 pag.append('<span></span>') 12 } 13 pag.children().eq(step).addClass('active'); 14 $(document).on('click', options.handlers, function(){ 15 var dirNext = $(this).is('.next'); 16 17 if(dirNext && step < itemLength - 1) { 18 step += 1; 19 } else if (!dirNext && step > 0) { 20 step -= 1; 21 } else { 22 return false; 23 } 24 25 items.children().eq(0).animate({'margin-left': -1*frame*step}, 400); 26 pag.children().eq(step).addClass('active').siblings().removeClass('active') 27 }); 28 pag.on('click', 'span:not(.active)', function(){ 29 $(this).addClass('active').siblings().removeClass('active'); 30 step = $(this).index(); 31 items.children().eq(0).animate({'margin-left': -1*frame*step}, 400); 32 }); 33 $(window).on('resize', function(){ 34 frame = items.width() + parseInt(items.children().eq(0).css('margin-right')) 35 }) 36 }; 37 38 $.scrollFix = function(elem){ 39 // Variables to track inputs 40 var startY, startTopScroll; 41 42 elem = document.querySelector(elem); 43 44 // If there is no element, then do nothing 45 if(!elem) 46 return; 47 48 // Handle the start of interactions 49 elem.addEventListener('touchstart', function(event){ 50 startY = event.touches[0].pageY; 51 startTopScroll = elem.scrollTop; 52 53 if(startTopScroll <= 0) 54 elem.scrollTop = 1; 55 56 if(startTopScroll + elem.offsetHeight >= elem.scrollHeight) 57 elem.scrollTop = elem.scrollHeight - elem.offsetHeight - 1; 58 }, false); 59 } 60 61 jQuery.fn.extend({ 62 pSelect: function(options){ 63 64 this.each(function(){ 65 var select = $(this); 66 var pSelect = { 67 stateOpened: false, 68 select: select, 69 list: select.children('.b-select-list'), 70 listItem: select.find(options.listItem), 71 current: select.children('.b-select--current'), 72 linkBehavior: select.hasClass('link--behavior'), 73 open: function(){ 74 this.select.addClass('opened'); 75 this.list.show(); 76 this.stateOpened = true; 77 78 $('.b-select.opened').not(select).each(function(){ 79 $(this).removeClass('opened').find('.b-select-list').hide(); 80 }); 81 }, 82 close: function(){ 83 this.select.removeClass('opened'); 84 this.list.hide(); 85 this.stateOpened = false; 86 }, 87 selectItem: function(item){ 88 this.listItem.filter(item).addClass('current').siblings().removeClass('current'); 89 this.current.children('span').text(item.text()).data('id', item.data('id')); 90 this.select.children('input').val(item.data('id')).data('val', item.text()).trigger('change') 91 this.close(); 92 }, 93 setEvents: function(){ 94 var _this = this; 95 this.select.on('click', '.b-select--current', function(){ 96 _this.stateOpened ? _this.close() : _this.open(); 97 }).on('click', options.listItem, function(){ 98 if(_this.linkBehavior) { 99 _this.close(); 100 return; 101 } 102 _this.selectItem($(this)) 103 }).on('select:get', function(e, reciever){ 104 reciever.instance = _this; 105 }); 106 }, 107 animateScroll: function () { 108 $(".b-select-list-scroll").find("a") 109 .on("click", function() { 110 var toScrollId = $(this).attr("href").substring(1, 2); 111 $('html, body').animate({ 112 scrollTop: $('[name = ' + toScrollId + ']').offset().top - 30 113 }, 1000); 114 }) 115 } 116 117 }; 118 pSelect.setEvents(); 119 pSelect.animateScroll(); 120 }) 121 return this; 122 } 123 }) 124 125 $.anchorHash = function(){ 126 var el = $(window.location.hash), 127 tabContent = el.closest('.b-tabs-wrap'); 128 129 if(el.length) { 130 if(tabContent.length) { 131 tabContent.find('.b-tabs-item').eq(el.closest('.b-tabs-content-item').index()).click(); 132 } 133 if(el.is('.b-accordeon')) { 134 el.find('.b-accordeon--show').click(); 135 } 136 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: el.offset().top}, 600); 137 } 138 } 139}(jQuery)); 140 141$(function(){ 142 var wGet = window.location.search; 143 if (!!(wGet.indexOf('callback_btn') + 1)) { 144 $('#callbackBtn').css('display', 'inline-block').prev('a').hide(); 145 $.cookie('callback_btn', '1', { expires: 1, path: '/' }); 146 } 147 $('.b-select').pSelect({listItem: '.b-select-list li, .b-select-list span, .b-select-list a'}); 148 149 $(document).on('click.closeSelects', function(e){ 150 var target = $(e.target); 151 152 if(target.closest('.b-select.opened').length) return; 153 $('.b-select.opened').each(function(){ 154 var obj = {}; 155 $(this).trigger('select:get', [obj]); 156 obj.instance.close() 157 }) 158 }); 159 160 $('input[placeholder], textarea[placeholder]').each(function () { 161 inputPlaceholder(this, '#aaa'); 162 }); 163 164 165 $('#kvSlider').each(function() { 166 var slider = $(this).children('.swiper-container'), 167 swiperNext = $(this).find('.swiper-button-next'), 168 swiperPrev = $(this).find('.swiper-button-prev'); 169 170 var swiper = slider.swiper({ 171 pagination: '.swiper-pagination', 172 noSwipingClass: 'swiper-no-swiping', 173 paginationClickable: true, 174 simulateTouch: false, 175 centeredSlides: false, 176 initialSlide: 0, 177 slidesPerView: 1, 178 loop: true, 179 speed: 600,
180 autoplay: 5000, 181 }); 182 183 swiperNext.bind('click', function() { 184 swiper.swipeNext(); 185 }); 186 swiperPrev.bind('click', function() { 187 swiper.swipePrev(); 188 }) 189 }); 190 191 $.fn.select2.defaults.searchInputPlaceholder = 'ÐÐÐСРÐРСÐÐТУ'; 192 $.fn.select2.locales['ru'] = { 193 formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, 194 formatNoMatches: function () { return "ÐÐµÑ Ñакого Ñегиона"; }, 195 formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "ÐагÑÑзка не ÑдалаÑÑ"; }, 196 formatInputTooShort: function (input, min) { var n = min - input.length; return "ÐведиÑе " + n + " или более Ñимволов" + (n == 1 ? "" : "s"); }, 197 formatInputTooLong: function (input, max) { var n = input.length - max; return "УдалиÑе " + n + " Ñимвол" + (n == 1 ? "" : "ов"); }, 198 formatSelectionTooBig: function (limit) { return "ÐÑ Ð¼Ð¾Ð¶ÐµÑе вÑбÑаÑÑ ÑолÑко " + limit + " наименовани" + (limit == 1 ? "е" : "й"); }, 199 formatLoadMore: function (pageNumber) { return "ÐагÑÑзкаâ¦"; }, 200 formatSearching: function () { return "ÐоиÑкâ¦"; } 201 }; 202 $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']); 203 $('#headerCitySelect').select2({ 204 placeholder: 'ÐÐÐСРÐРСÐÐТУ' 205 }); 206 207 $('#rootFeatureSlider').each(function() { 208 var swiperEl = $(this).children('.swiper-container'), 209 swiper, 210 swiperPrev = $(this).find('.prev'), 211 swiperNext = $(this).find('.next'); 212 213 swiper = swiperEl.swiper({ 214 pagination: '.pag', 215 noSwipingClass: 'swiper-no-swiping', 216 simulateTouch: true, 217 centeredSlides: false, 218 initialSlide: 0, 219 slidesPerView: 1, 220 //loop: true, 221 speed: 3000, 222 onInit: function() { 223 if(!swiperEl.hasClass('inited')) { 224 swiperEl.addClass('inited'); 225 swiper.resizeFix(); 226 $(swiper.paginationButtons[0]).addClass('swiper-active-switch'); 227 } 228 } 229 }); 230 231 swiperNext.bind('click', function() { 232 swiper.swipeNext(); 233 }); 234 swiperPrev.bind('click', function() { 235 swiper.swipePrev(); 236 }) 237 }) ; 238 239 $('#kvSlider').each(function() { 240 $(this).scrollfire({ 241 offset: 0, 242 topOffset: 0, 243 bottomOffset: 100, 244 245 onTopIn: function( elm, distance_scrolled ) { 246 $('#rspTopBar').removeClass('services--shown'); 247 }, 248 onTopHidden: function( elm, distance_scrolled ) { 249 $('#rspTopBar').addClass('services--shown'); 250 } 251 }) 252 }); 253 254 $('#deliverySlider').each(function() { 255 var SLIDES_PER_VIEW = 3, 256 swiperEl = $(this).children('.swiper-container'), 257 swiper, 258 swiperPrev = $(this).find('.prev'), 259 swiperNext = $(this).find('.next'), 260 popup = $('#deliverySlider').find('.b-delivery-slider-popup'), 261 slideWidth = swiperEl.find('.swiper-slide').width(), 262 wraperEl = swiperEl.find('.swiper-wrapper'), 263 slideLength = swiperEl.find('.swiper-slide').length; 264 265 swiper = swiperEl.swiper({ 266 pagination: false, 267 noSwipingClass: 'swiper-no-swiping', 268 simulateTouch: false, 269 centeredSlides: false, 270 initialSlide: 0, 271 slidesPerView: SLIDES_PER_VIEW, 272 speed: 3000, 273 274 onInit: function() { 275 if(SLIDES_PER_VIEW == slideLength) { 276 $('#deliverySlider').find('.b-delivery-slider-conrols').hide(); 277 } 278 }, 279 280 onSlideChangeStart: function() { 281 swiper.activeIndex >= slideLength - SLIDES_PER_VIEW ? swiperNext.hide() : swiperNext.show(); 282 swiper.activeIndex <= 0 ? swiperPrev.hide() : swiperPrev.show(); 283 }, 284 285 onSlideClick : function() { 286 var slideIndx = swiper.clickedSlideIndex; 287 288 slideWidth = swiperEl.find('.swiper-slide').width(); 289 if (slideIndx == slideLength - 1) { 290 wraperEl.animate({'margin-left': slideLength === 2 ? -1*slideWidth : -2*slideWidth}, 400, function(){ 291 showDelPopup(slideIndx); 292 changeContainerHeight(swiper, showDelPopup.currentPopup); 293 }) 294 } else if (slideIndx == slideLength - 2) { 295 swiper.swipeTo(slideIndx); 296 wraperEl.animate({'margin-left': slideLength === 2 ? 0 : -1*slideWidth}, 400, function(){ 297 showDelPopup(slideIndx); 298 changeContainerHeight(swiper, showDelPopup.currentPopup); 299 }) 300 } else { 301 swiper.swipeTo(slideIndx); 302 showDelPopup(slideIndx); 303 changeContainerHeight(swiper, showDelPopup.currentPopup); 304 } 305 }, 306 }); 307 308 $(document).on('click', '.b-delivery-slider-popup--close', function() { 309 var idx = $(this).parent().index(); 310 closeDelPopup(idx); 311 }); 312 313 swiperNext.bind('click', function() { 314 swiper.swipeNext(true); 315 }); 316 swiperPrev.bind('click', function() { 317 swiper.swipePrev(true); 318 }); 319 320 function showDelPopup(idx) { 321 popup.eq(idx).fadeIn(300); 322 showDelPopup.currentPopup = popup.eq(idx); 323 swiperPrev.add(swiperNext).hide(); 324 } 325 function closeDelPopup(idx) { 326 popup.eq(idx).fadeOut(300, function() { 327 wraperEl.animate({'margin-left': 9}, 400); 328 swiperPrev.add(swiperNext).show(); 329 }); 330 $(swiper.container).animate({'height': $(swiper.clickedSlide).outerHeight()}, 400); 331 } 332 function getElementHeight(popup) { 333 getElementHeight.height = $(popup).outerHeight(); 334 } 335 function changeContainerHeight(swiper, popup) { 336 getElementHeight(popup); 337 $(swiper.container).animate({'height': getElementHeight.height}, 400); 338 } 339 }) ; 340 $('#deliveryResponsiveSlider').each(function() { 341 var SLIDES_PER_VIEW = 3, 342 swiperEl = $(this).children('.swiper-container'), 343 swiper, 344 swiperPrev = $(this).find('.prev'), 345 swiperNext = $(this).find('.next'), 346 popup = $('#deliverySlider').find('.b-delivery-slider-popup'), 347 slideWidth = swiperEl.find('.swiper-slide').width(), 348 wraperEl = swiperEl.find('.swiper-wrapper'), 349 slideLength = swiperEl.find('.swiper-slide').length; 350 351 swiper = swiperEl.swiper({ 352 pagination: '#deliveryResponsiveSlider .swiper-pagination', 353 paginationClickable: true, 354 noSwipingClass: 'swiper-no-swiping', 355 simulateTouch: false, 356 centeredSlides: false, 357 initialSlide: 0, 358 slidesPerView: 1, 359 speed: 3000, 360 onInit: function () { 361 getSliderTitleHeight(swiper); 362 movePaginationBlock(swiper); 363 }, 364 onTouchEnd: function() { 365 getSliderTitleHeight(swiper); 366 movePaginationBlock(swiper); 367 }, 368 onSlideChangeStart: function() { 369 getSliderTitleHeight(swiper); 370 movePaginationBlock(swiper); 371 } 372 }); 373 374 }); 375 376 function getSliderTitleHeight(swiper) { 377 if (!swiper) return; 378 379 var slide = swiper.activeSlide(); 380 var title = $(slide).find("p")[0]; 381 var titleHeight = $(title).height(); 382 383 if (!getSliderTitleHeight.height) { 384 getSliderTitleHeight.height = titleHeight; 385 } 386 387 getSliderTitleHeight.titleHeight = titleHeight; 388 } 389 390 function movePaginationBlock (swiper) { 391 if (!swiper) return; 392 393 if (!movePaginationBlock.topPos) { 394 movePaginationBlock.topPos = parseInt($(swiper.paginationContainer).css("top")); 395 } 396 397 if (getSliderTitleHeight.titleHeight === getSliderTitleHeight.height) { 398 $(swiper.paginationContainer).animate({"top": movePaginationBlock.topPos + (getSliderTitleHeight.titleHeight / 2) + "px"}, 400); 399 return; 400 } else { 401 $(swiper.paginationContainer).animate({"top": movePaginationBlock.topPos + "px"}, 400); 402 return 403 } 404 } 405 406 $('[name="jsTabs"]').each(function(){ 407 var $this = $(this), 408 cItem = $this.find('.b-tabs-content-item'); 409 410 $this.on('click', '.b-tabs-item', function(e){ 411 var idx = $(this).index(); 412 413 e.preventDefault(); 414 $(this).addClass('active').siblings().removeClass('active'); 415 cItem.eq(idx).addClass('active').siblings().removeClass('active'); 416 417 }) 418 }) 419 420 $('.b-aside').each(function(){ 421 var $this = $(this), 422 content = $this.siblings('.b-content-area'), 423 wW = $(window).width(); 424 425 checkHeight(); 426 $(window).on('resize', function(){ 427 checkHeight (); 428 }); 429 430 setTimeout(function(){$(window).trigger('resize')}, 200) 431 432 function checkHeight (){ 433 content.css('min-height', $this.height() > content.height() ? $this.outerHeight() : 500) 434 } 435 }) 436 437 var scrollTopPopup; 438 439 //if(Modernizr.touch) $.scrollFix('.b-header-nav-container'); 440 441 $('.js-search-toggle').on('click', function (e) { 442 e.preventDefault(); 443 $(this).parent().addClass('_search-opened'); 444 $(this).hide(); 445 }); 446 447 $('.js-search-close').on('click', function (e) { 448 e.preventDefault(); 449 $(this).parent().parent().removeClass('_search-opened'); 450 451 setTimeout(function () { 452 $('.js-search-toggle').show(); 453 }, 200) 454 }); 455 456 $(document).on('mouseenter', '.b-header-nav-wrap-list li:not(.sub--opened)', function(e){ 457 if($(window).width() <= 1024) return false;
458 var $this = $(this); 459 460 $this.addClass('sub--opened'); 461 462 if($this.siblings('.sub--opened').length){ 463 $this.siblings('.sub--opened').removeClass('sub--opened').find('.b-header-nav-sub').hide(); 464 $this.find('.b-header-nav-sub').show(); 465 } else { 466 $this.find('.b-header-nav-sub').finish().slideDown(400) 467 } 468 return false; 469 }) 470 .on('mouseleave', '.b-header-nav', function(){ 471 if($(window).width() <= 1024) return false; 472 var $this = $(this); 473 474 $this.find('.sub--opened').find('.b-header-nav-sub').finish().slideUp(300, function(){ 475 $this.find('.sub--opened').removeClass('sub--opened'); 476 }) 477 }) 478 .on('click', '.b-header-nav-wrap-list > li > a', function(e){ 479 if($(window).width() <= 1024) { 480 var $this = $(this), 481 acc = $this.parent(); 482 483 acc.toggleClass('sub--opened'); 484 if(acc.hasClass('sub--opened')) { 485 if(acc.siblings('.sub--opened').length){ 486 acc.siblings('.sub--opened').removeClass('sub--opened').find('.b-header-nav-sub').slideUp(400) 487 } 488 acc.find('.b-header-nav-sub').slideDown(400) 489 } else { 490 acc.find('.b-header-nav-sub').slideUp(400) 491 } 492 493 return false; 494 } 495 }) 496 497 .on('click', '.b-accordeon--show', function(){ 498 var $this = $(this), 499 wraper = $this.closest('.b-accordeon'); 500 501 wraper.toggleClass('opened'); 502 if(wraper.hasClass('opened')) { 503 var prevOpened = wraper.prev('.opened').length; 504 505 wraper.children('.b-accordeon-content').slideDown(400, function(){ 506 if (prevOpened && (wraper.offset().top < $(window).scrollTop() || wraper.offset().top > $(window).scrollTop() + $(window).height())) { 507 $('html:not(:animated),body:not(:animated)').animate({scrollTop: wraper.offset().top}) 508 } 509 }) 510 wraper.siblings('.b-accordeon.opened').each(function(){ 511 $(this).removeClass('opened').children('.b-accordeon-content').slideUp(); 512 }) 513 } else { 514 wraper.children('.b-accordeon-content').slideUp(); 515 } 516 }) 517 .on('click', '.b-footer-map-item > a:not(.opened)', function(e){ 518 if($(window).width() > 1024) { 519 return; 520 } else { 521 e.preventDefault(); 522 $('#footerMap').find('.b-footer-map-item > a.opened').removeClass('opened').next('.lvl2').slideUp(300); 523 $(this).addClass('opened').next('.lvl2').slideDown(300); 524 } 525 }) 526 .on('change', '#responsiveLangSelect', function(){ 527 $(this).prev('span').text($(this).val()); 528 529 window.location.pathname = $(this).children('[value="' + $(this).val() + '"]').data('href') 530 }) 531 .on('click', '.b-header-top-rsp--btn, .b-header-nav--close, #veil', function(){ 532 $('body').toggleClass('rsp-nav--opened'); 533 534 $('body').hasClass('rsp-nav--opened') ? $('#veil').fadeIn(300) : $('#veil').fadeOut(300); 535 $(window).off('resize.closeRspNav').on('resize.closeRspNav', function(){ 536 if($(window).width() > 1024) { 537 $('body').removeClass('rsp-nav--opened'); 538 $('#veil').fadeOut(300); 539 $(window).off('resize.closeRspNav'); 540 } 541 }) 542 }) 543 /*.on('touchmove', function(e){ 544 var target = $(e.target); 545 546 if($('body').hasClass('rsp-nav--opened')) { 547 e.stopPropagation(); 548 549 if(!target.closest('.b-header-nav-container').length || $('.b-header-nav-scroll-area').height() <= $(window).height()) { 550 e.preventDefault(); 551 } 552 } 553 })*/ 554 .on('click', '.b-top-bar-sevices--show', function(){ 555 var wraper = $(this).parent(); 556 557 wraper.toggleClass('opened'); 558 if (wraper.hasClass('opened')) { 559 wraper.children('.b-top-bar-sevices-wrap').fadeIn(300); 560 wraper.find('.b-services').height($(window).width()/3) 561 $('#veil').show(); 562 563 $(document).off('scroll.closeServices').on('scroll.closeServices', function(){ 564 hideTopBar(); 565 }); 566 $(window).off('resize.closeServices').on('resize.closeServices', function(){ 567 hideTopBar(); 568 }) 569 } else { 570 wraper.children('.b-top-bar-sevices-wrap').fadeOut(300); 571 $('#veil').hide(); 572 } 573 574 function hideTopBar (){ 575 $('.b-top-bar-sevices').removeClass('opened'); 576 wraper.children('.b-top-bar-sevices-wrap').fadeOut(300); 577 $(document).off('scroll.closeServices'); 578 $('#veil').hide(); 579 } 580 }) 581 .on('click', '.b-tenders-tabs-item', function(e){ 582 var id = $(this).data('id'); 583 $(this).addClass('active').siblings().removeClass('active'); 584 $('.b-tenders').hide(); 585 $('#'+id).show(); 586 return false;
587 }) 588 .on('click', '.b-form-checkbox span', function(e) { 589 var target = $(e.target), checkbox, input; 590 591 if (target.is('input[type="text"]') || target.is('.b-select span:not(.nojs)')) { 592 return false; 593 } 594 checkbox = $(this).closest('.b-form-checkbox'); 595 596 input = checkbox.children('input'); 597 input.prop('checked', !input.prop('checked')); 598 input.change(); 599 checkbox[input.prop('checked') ? "addClass" : "removeClass"]('checked'); 600 601 $(this).siblings('.b-form-checkbox-hidden')[input.prop('checked') ? "show" : "hide"]() 602 .find('input').prop('disabled', !input.prop('checked')); 603 }) 604 .on('click', '.b-form-radiobox > span:not(.nojs)', function(){ 605 $(this).parent().addClass('checked').siblings().removeClass('checked'); 606 $(this).closest('.b-form-input').find('input').val($(this).data('id')).trigger("change"); 607 608 if($(this).closest('.b-count-serv-table').length) { 609 $(this).closest('tr').siblings().each(function(){ 610 $(this).find('.b-form-radiobox').removeClass('checked') 611 }) 612 } 613 }) 614 .on('click', '.b-direction-item-icon', function(){ 615 var item = $(this).closest('.b-direction-item'); 616 617 item.toggleClass('opened'); 618 item.hasClass('opened') ? item.find('p').slideDown(400, function(){$(this).addClass('shown')}) : item.find('p').removeClass('shown').slideUp(400); 619 }) 620 .on('click', '.b-foolfilment-item-icon', function(){ 621 var item = $(this).closest('.b-foolfilment-item'); 622 623 item.toggleClass('opened'); 624 item.hasClass('opened') ? item.find('.b-foolfilment-item-description').slideDown(400, function(){$(this).addClass('shown')}) : item.find('.b-foolfilment-item-description').removeClass('shown').slideUp(400); 625 }) 626 .on('click', '[name="showPopup"]', function(e){ 627 var targ = $(this).attr('data-val'); 628 629 e.preventDefault(); 630 showPopup(targ); 631 }) 632 .on('click', '[name="showPopupImage"]', function(e){ 633 var targ = $(this).attr('data-val'), 634 src = $(this).attr('href'), 635 img = $('#'+ targ).find('img'); 636 637 e.preventDefault(); 638 639 scrollTopPopup = $(document).scrollTop(); 640 641 if ($(img).attr('src') !== src) { 642 $(img).attr('src', src).on('load', function(){ 643 showPopup(targ); 644 }); 645 } else { 646 showPopup(targ); 647 } 648 }) 649 .on('click', '.b-popup--close', function(){ 650 $(this).parent().hide(); 651 $('body').removeClass('popup--shown'); 652 $(document).scrollTop(scrollTopPopup); 653 }) 654 .on('click', '#popupVeil', function(e){ 655 $('body').removeClass('popup--shown'); 656 $('.b-popup').each(function(){ 657 $(this).hide() 658 }) 659 }) 660 .on('click', '.help-tip:not(.help-tip_opened)', function(e){ 661 var $this = $(this), 662 el = $this.children('p'), 663 posX = e.pageX, 664 posY = $(window).height() - (e.pageY - $(window).scrollTop()), 665 alignLeft = posX < $(window).width()/2; 666 667 // console.log('X: ' + posX); 668 // console.log('Y: ' + posY); 669 alignLeft ? el.removeClass('right') : el.addClass('right'); 670 671 if ($this.parents('.b-count-table-wrap').length) { 672 var parentX = $('.b-count-table-wrap').offset().left; 673 674 el.removeClass('right'); 675 if (posX < parentX) { 676 posX = parentX; 677 } 678 } 679 680 el.show().css({ 681 'position': 'fixed', 682 'bottom': posY 683 }); 684 alignLeft ? 685 el.css({'left': posX, 'right' : 'auto'}) : 686 el.css({'right': $(window).width() - posX, 'left' : 'auto'}); 687 688 $this.addClass('help-tip_opened'); 689 if($(window).width() <= 480) { 690 $this.find('.arrow').css('left', posX) 691 } 692 $('body').off('touchstart.closeTips').on('touchstart.closeTips', function(e){ 693 var $target = $(e.target); 694 695 if(!$target.closest('.help-tip').length) { 696 $('.help-tip_opened').removeClass('help-tip_opened').children('p').hide(); 697 $('body').off('touchstart.closeTips'); 698 } 699 }) 700 701 if(!$(e.target).is('a')) { 702 return false; 703 } 704 }) 705 .on('mouseleave', '.help-tip', function(e){ 706 $(this).removeClass('help-tip_opened').children('p').hide(); 707 }) 708 .on('scroll', function(e){ 709 $('.help-tip p:not(:hidden)').hide().parent().removeClass('help-tip_opened'); 710 $(document).off('touchstart.closeTips'); 711 }) 712 .on('click', '.b-track-sub--show', function(){ 713 var blockTable = $(this).siblings('.b-track-table-hidden'); 714 715 if (blockTable.length) { 716 if ($(this).hasClass('active')) { 717 $(this).removeClass('active').children().text('РазвеÑнÑÑÑ'); 718 $(this).closest('.b-track-table-info').removeClass('active'); 719 blockTable.slideUp(); 720 } else { 721 $(this).addClass('active').children().text('СвеÑнÑÑÑ'); 722 $(this).closest('.b-track-table-info').addClass('active'); 723 blockTable.slideDown(); 724 } 725 } 726 }) 727 .on('click', '.history--back', function(e){ 728 e.preventDefault(); 729 history.go(-1); 730 }); 731 732 // track page input 733 $('#trackSearchInput').each(function(){ 734 var RESPONSIVE_RES = 1023, 735 wW = $(window).width(), 736 isResponsive = false, 737 input = $(this); 738 739 setPlaceholder(wW); 740 $(window).on('resize', function(){ 741 wW = $(window).width(); 742 setPlaceholder(wW); 743 }) 744 745 function setPlaceholder(w){ 746 if (w > RESPONSIVE_RES && isResponsive) { 747 input.attr('placeholder', Lang['track_search_placeholder1']); 748 isResponsive = false;
749 } else if (w <= RESPONSIVE_RES && !isResponsive){ 750 input.attr('placeholder', Lang['track_search_placeholder2']); 751 isResponsive = true; 752 } 753 } 754 }); 755 756 function showPopup(popup){ 757 var targ = $('#'+ popup); 758 759 $(document).scrollTop(0); 760 761 $('body').addClass('popup--shown'); 762 toCenter(targ); 763 targ.fadeIn(300); 764 765 $(window).off('resize.showpopup').on('resize.showpopup', function(){ 766 toCenter(targ); 767 }); 768 } 769 function toCenter(popup){ 770 popup.css('left', 0); 771 $(window).width() > popup.outerWidth() ? popup.css('left', ($(window).width() - popup.outerWidth()) / 2) : popup.css('left', 0); 772 if($(window).height() > popup.outerHeight()){ 773 popup.css({'top': ($(window).height() - popup.outerHeight()) / 2, 'position': 'fixed'}) 774 } else{ 775 popup.css({'top': 0, 'position': 'absolute'}); 776 $(document).scrollTop(0) 777 } 778 } 779 780 //$.validator.messages.required = Lang['ÐаполниÑе поле']; 781 //$.validator.messages.email = Lang['ÐведиÑе коÑÑекÑнÑй Email']; 782 $.validator.messages.remote = ''; 783 $.validator.methods.email = function(value, element) { 784 return /^([a-zA-Z0-9_.\-+])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(value); 785 }; 786 787 $.validator.addMethod("checkINN", function(value, elem) { 788 var inputNumber = $(elem).val(); 789 inputNumber = "" + inputNumber; 790 if(!inputNumber.length) { 791 return true; 792 } 793 inputNumber = inputNumber.split(''); 794 if((inputNumber.length == 10) && 795 (inputNumber[9] == 796 ((2 * inputNumber[ 0] + 4 * inputNumber[1] + 10 * 797 inputNumber[2] + 3 * inputNumber[3] + 5 * 798 inputNumber[4] + 9 * inputNumber[5] + 4 * 799 inputNumber[6] + 6 * inputNumber[7] + 8 * 800 inputNumber[8]) % 11) % 10)) 801 { 802 return true; 803 } 804 else return !!((inputNumber.length == 12) && 805 ((inputNumber[10] == ((7 * inputNumber[0] + 2 * 806 inputNumber[1] + 4 * inputNumber[2] + 10 * 807 inputNumber[3] + 3 * inputNumber[4] + 5 * 808 inputNumber[5] + 9 * inputNumber[6] + 4 * 809 inputNumber[7] + 6 * inputNumber[8] + 8 * 810 inputNumber[9]) % 11) % 10) && 811 (inputNumber[11] == ((3 * inputNumber[0] + 7 * 812 inputNumber[1] + 2 * inputNumber[2] + 4 * 813 inputNumber[3] + 10 * inputNumber[4] + 3 * 814 inputNumber[5] + 5 * inputNumber[6] + 9 * 815 inputNumber[7] + 4 * inputNumber[8] + 6 * 816 inputNumber[9] + 8 * inputNumber[10]) % 11) % 10))); 817 818 }, Lang["ÐведиÑе коÑÑекÑнÑй ÐÐÐ"]); 819 820 $.validator.addMethod("checkBIN", function (value, elem) { 821 if (value.length == 0) { 822 return true; 823 } 824 if (value.length != 12) { 825 return false; 826 } 827 var regexp = /^\d{12}$/; 828 return regexp.test(value); 829 }, Lang["incorrect_bin"]); 830 831 $('div.captcha').initCaptcha(); 832 833 $('.file-input-wrap').each(function(){ 834 var _this = $(this), 835 input = _this.find('input'), 836 link = _this.find('.file-input'); 837 input.hide(); 838 link.on('click', function(){ 839 input.click(); 840 }); 841 input.on('change', function(){ 842 link.find('span').text(input.val()); 843 }); 844 845 }); 846 847 $('.phone-input-box input[type=text]').inputmask(Lang['phone_mask']); 848 $('.phone-input').inputmask(Lang['phone_mask']); 849 var lock = false; 850 851 $('#callbackBtn').on('click', function() { 852 var box = $('#orderCallForm'); 853 showPopupMessage(' ', ' ', box.children('div').clone()); 854 $('.phone-input').inputmask(Lang['phone_mask']); 855 856 ga('send', 'event', 'form', 'show', 'callback'); 857 yaCounter15069907.reachGoal('show_callback'); 858 859 var form = $('#messagePopup .callback_form'), 860 errorBox = form.find(".mf-error-text"); 861 862 $('#messagePopup div.captcha').initCaptcha() 863 .find('.b-feedback-captcha-renew').click(); 864 865 form.validate({ 866 rules: { 867 form_text_138: 'required', 868 form_text_139: 'required', 869 captcha_word: { 870 required: true, 871 minlength: 5, 872 remote: { 873 url: '/local/ajax/captcha_check.php', 874 type: "post", 875 data: { 876 captcha_sid: function() { 877 return form.find("input[name=captcha_sid]").val(); 878 }, 879 captcha_word: function() { 880 return form.find("input[name=captcha_word]").val(); 881 } 882 } 883 } 884 } 885 }, 886 messages: { 887 captcha_word: { 888 minlength: Lang['ÐепÑавилÑнÑй код'], 889 remote: Lang['ÐепÑавилÑнÑй код'] 890 } 891 }, 892 errorPlacement: function(label, element){ 893 errorBox.hide(); 894 $(element).closest('.b-form-input').addClass('error'); 895 $(element).prev('label.error').remove(); 896 $(element).before(label); 897 }, 898 unhighlight: function(element){ 899 errorBox.hide(); 900 $(element).closest('.b-form-input').removeClass('error'); 901 $(element).prev('label.error').remove(); 902 }, 903 submitHandler: function(form) { 904 if(lock) { 905 return false;
906 } 907 lock = true; 908 errorBox.hide(); 909 910 ga('send', 'event', 'form', 'send', 'callback'); 911 yaCounter15069907.reachGoal('send_callback'); 912 913 $.post('/local/ajax/form.php',$(form).serialize()+'&site_id='+window.Lang.site_id, function(data){ 914 if(data.status != 'ok') { 915 errorBox.html(data.message).show(); 916 } else { 917 showPopupMessage(Lang.callback_success, ' ', ' '); 918 } 919 920 },'json').always(function(){ 921 lock = false; 922 $(form).find('.b-feedback-captcha-renew').click(); 923 }); 924 } 925 }); 926 927 }); 928 929 window.showPopupMessage = function(title, text, content){ 930 var box = $('#messagePopup'); 931 title && box.children('h5').text(title); 932 text && box.children('p').text(text); 933 box.find('.popup-content').html(content); 934 showPopup('messagePopup'); 935 }; 936 937 var allowedExtensions = ['doc','pdf','xls','ppt','xml','zip','rar']; 938 $('.b-content-area a:not(.file-link)').each(function(){ 939 if($(this).hasClass('ignore-file-link')) { 940 return; 941 } 942 if(this.pathname && this.hostname && this.hostname == location.hostname) { 943 var extension= this.pathname.split('.')[1]; 944 if(extension) { 945 extension = extension.substr(0,3); 946 for(var i = 0; i < allowedExtensions.length; i++) { 947 if(extension == allowedExtensions[i]) { 948 $(this).addClass('file-link '+extension); 949 $(this).attr('download'); 950 $(this).html($(this).text()+'<span>' + window.Lang.download + ' (.'+extension+')</span>'); 951 break; 952 } 953 } 954 } 955 } 956 }); 957 958 if(window.location.hash) { 959 $.anchorHash(); 960 } 961 if($('#footerMap').hasClass('opened')) { 962 $('#footerMap').find('.b-accordeon-content').show(); 963 } 964 965 $.cookie('prev_page_title', $('head > title').text(), {path: '/'}); 966 967 window.dataLayer = window.dataLayer || []; 968 var servBlock = { 969 'b-services-block1' : 'fast_calculation', 970 'b-services-block2' : 'fast_call_courier', 971 'b-services-block3' : 'fast_find_delivery', 972 'b-services-block4' : 'fast_find_office', 973 'b-services-block5' : 'fast_contract', 974 'b-services-block6' : 'fast_feedback', 975 } 976 977 function dataLayerServices (blockClass) { 978 979 $('.' + blockClass ).click(function(){ 980 dataLayer.push( 981 {'event': servBlock[blockClass]} 982 ); 983 }) 984 985 } 986 for(el in servBlock) { 987 dataLayerServices(el); 988 } 989 990 991 992}); 993 994 995(function($){ 996 $.fn.initCaptcha = function(){ 997 this.each(function() { 998 999 var _this = $(this), 1000 lock = false, 1001 renew = _this.find('.b-feedback-captcha-renew'), 1002 input = _this.find('input[name=captcha_sid]'), 1003 word = _this.find('input[name=captcha_word]'), 1004 image = _this.find('.b-feedback-captcha-wrap img'); 1005 1006 if(_this.data('captcha_inited')) { 1007 return; 1008 } 1009 _this.data('captcha_inited', 1); 1010 1011 1012 renew.on('click', function(){ 1013 if(lock) { 1014 return false; 1015 } 1016 lock = true; 1017 $.post('/local/ajax/captcha.php',{},function(data) { 1018 if(!data) { 1019 alert(Lang['ÐÑибка запÑоÑа. ÐопÑобÑйÑе позже.']); 1020 } 1021 image.attr('src', '/bitrix/tools/captcha.php?captcha_sid='+data.code); 1022 input.val(data.code); 1023 word.val(''); 1024 },'json').always(function(){ 1025 lock = false; 1026 }); 1027 }); 1028 1029 }); 1030 return this; 1031 } 1032})(jQuery); 1033 1034function plural(n, forms) { 1035 return forms[n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2]; 1036} 1037 1038$(document).ready(function(){ 1039 document.getElementsByClassName('b-main-wrap')[0].onscroll = function(){ 1040 document.getElementsByClassName('b-main-wrap')[0].scrollTop = 0; 1041 }; 1042 1043 1044 var touchstartX = 0; 1045 var touchstartY = 0; 1046 var touchendX = 0; 1047 var touchendY = 0; 1048 1049 document.addEventListener('touchstart', function(event) { 1050 touchstartX = event.pageX ? event.pageX : event.changedTouches[0].pageX; 1051 touchstartY = event.pageY ? event.pageY : event.changedTouches[0].pageY; 1052 1053 }, false); 1054 1055 document.addEventListener('touchend', function(event) { 1056 touchendX = event.pageX ? event.pageX : event.changedTouches[0].pageX; 1057 touchendY = event.pageY ? event.pageY : event.changedTouches[0].pageY; 1058 closeNavigation(); 1059 }, false); 1060 document.getElementById('veil').addEventListener('touchend', function(event) { 1061 if (event.stopPropagation) { 1062 event.stopPropagation(); 1063 event.preventDefault(); 1064 $('body').toggleClass('rsp-nav--opened'); 1065 1066 $('body').hasClass('rsp-nav--opened') ? $('#veil').fadeIn(300) : $('#veil').fadeOut(300); 1067 $(window).off('resize.closeRspNav').on('resize.closeRspNav', function(){ 1068 if($(window).width() > 1024) { 1069 $('body').removeClass('rsp-nav--opened'); 1070 $('#veil').fadeOut(300); 1071 $(window).off('resize.closeRspNav'); 1072 } 1073 }) 1074 } 1075 1076 }, false); 1077 function closeNavigation() { 1078 var swiped = 'swiped: '; 1079 if ((touchendX > touchstartX + 50) && ($('body').hasClass('rsp-nav--opened')) && (Math.abs(touchendY - touchstartY) < 30)) { 1080 $('body').toggleClass('rsp-nav--opened'); 1081 1082 $('body').hasClass('rsp-nav--opened') ? $('#veil').fadeIn(300) : $('#veil').fadeOut(300); 1083 $(window).off('resize.closeRspNav').on('resize.closeRspNav', function(){ 1084 if($(window).width() > 1024) { 1085 $('body').removeClass('rsp-nav--opened'); 1086 $('#veil').fadeOut(300); 1087 $(window).off('resize.closeRspNav'); 1088 } 1089 }) 1090 } 1091 } 1092 1093 (function () { 1094 if (window.localStorage.getItem('cookie-agree')) { 1095 return 1096 } else { 1097 $('.js-cookie-agreement').show(); 1098 } 1099 $(document).on('click', '.js-cookie-agree', function () { 1100 window.localStorage.setItem('cookie-agree', true); 1101 $('.js-cookie-agreement').hide(); 1102 }) 1103 })(); 1104 var rootTabs = function () { 1105 var container = $('.js-root-tabs-container'),
1106 handlers = $('.js-root-tabs-handler'), 1107 content = $('.js-root-tabs-content'); 1108 1109 handlers.on('click', function () { 1110 var index = $(this).index(); 1111 content.hide().eq(index).show(); 1112 index ? container.addClass('_map') : container.removeClass('_map'); 1113 }) 1114 }; 1115 rootTabs(); 1116 1117 $(document).on('click', '.appeal-coronavirus', function () { 1118 $('.appeal-coronavirus-video').toggle(); 1119 }) 1120 $(document).on('click', '.b-contactless-delivery__video-link', function () { 1121 $('.how-we-work-video').toggle(); 1122 }) 1123 1124 if (window.outerWidth < 768 && 1125 document.body.parentNode.dataset.siteId !== 'en' && 1126 document.body.parentNode.dataset.siteId !== 'by' && 1127 document.body.parentNode.dataset.siteId !== 'kz' && 1128 document.body.parentNode.dataset.siteId !== 'cn') { 1129 $(document).on('click', '.js-phone-menu', function(e) { 1130 e.preventDefault(); 1131 $(this).parent().toggleClass('_active'); 1132 }) 1133 } 1134 1135 if ($('.b-header-koronavirus-mobile').length) { 1136 $('.b-services').addClass('_cov') 1137 } 1138});
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.