1 2 3(function ($) { 4 "use strict"; 5 6 function isDivVisibleForUser(_idClass) { 7 var _delay = -10; 8 9 var offset = $(_idClass).offset(); 10 var wHeight = $(window).height(); 11 var pageYOffset = getScrollTop(); 12 13 var returnVar = pageYOffset + wHeight - _delay > offset.top; 14 // var returnVar = pageYOffset+wHeight > offset.top; 15 16 return returnVar; 17 } 18 19 function getScrollTop() { 20 if (typeof pageYOffset != "undefined") { 21 //most browsers 22 return pageYOffset; 23 } else { 24 var B = document.body; //IE 'quirks' 25 var D = document.documentElement; //IE with doctype 26 D = D.clientHeight ? D : B; 27 return D.scrollTop; 28 } 29 } 30 31 $(document).ready(function () { 32 33 /*var order_boxes = new Swiper(".order-boxes", { 34 slidesPerView:3, 35 spaceBetween: 40, 36 navigation: { 37 enabled: false 38 }, 39 breakpoints: { 40 320: { 41 slidesPerView: 1.3, 42 spaceBetween: 15, 43 navigation: { 44 enabled: true, 45 nextEl: '.swiper-button-next', 46 prevEl: '.swiper-button-prev', 47 }, 48 }, 49 1000: { 50 slidesPerView: 3, 51 spaceBetween: 40, 52 navigation: { 53 enabled: false 54 } 55 } 56 } 57 });*/ 58 59 // $( '.videos-tabs a' ).on( 'click tap', function( event ) { 60 // $( this ).addClass( 'active' ).siblings().removeClass( 'active' ); 61 // $( '.videos-tab-item' ) 62 // event.preventDefault(); 63 // }); 64 65 $( '.gallery-thumbs .swiper-slide a' ).on( 'click tap', function( event ) { 66 event.preventDefault(); 67 }); 68 69 $('.prod-jak-zakladac p').filter(function() { 70 return $.trim($(this).text()) === ' ' && $(this).children().length == 0 71 }).remove(); 72 73 var prod_carousel = new Swiper("#similar-products, #prod-carousel, #absorptivity", { 74 slidesPerView:4, 75 spaceBetween: 40, 76 pagination: { 77 el: '.swiper-pagination', 78 dynamicBullets: true 79 }, 80 navigation: { 81 nextEl: '.swiper-button-next', 82 prevEl: '.swiper-button-prev', 83 }, 84 breakpoints: { 85 320: { 86 slidesPerView: 1.75, 87 spaceBetween: 15, 88 navigation: { 89 enabled: false 90 } 91 }, 92 1000: { 93 slidesPerView: 4, 94 spaceBetween: 40, 95 navigation: { 96 enabled: true 97 } 98 } 99 } 100 }); 101 102 var blog_carousel = new Swiper( '.bw-posts.swiper', { 103 slidesPerView:3, 104 spaceBetween: 35, 105 navigation: { 106 nextEl: ".swiper-button-next", 107 prevEl: ".swiper-button-prev" 108 }, 109 pagination: { 110 el: '.swiper-pagination', 111 dynamicBullets: true 112 }, 113 breakpoints: { 114 320: { 115 slidesPerView: 1.5, 116 spaceBetween: 20 117 }, 118 1000: { 119 slidesPerView: 3, 120 spaceBetween: 35 121 } 122 } 123 }); 124 125 var galleryThumbs = new Swiper(".gallery-thumbs .swiper", { 126 spaceBetween: 10, 127 slidesPerView: 4, 128 centeredSlides: false, 129 freeMode: false, 130 navigation: { 131 nextEl: ".gallery-thumbs .swiper-button-next", 132 prevEl: ".gallery-thumbs .swiper-button-prev" 133 }, 134 breakpoints: { 135 320: { 136 slidesPerView: 2, 137 spaceBetween: 20 138 }, 139 1000: { 140 slidesPerView: 4, 141 spaceBetween: 10 142 } 143 } 144 }); 145 146 if ( $( '.gallery-thumbs' ).length > 0 ) { 147 148 var galleryTop = new Swiper("#gallery-top", { 149 spaceBetween: 0, 150 slidesPerView: 1, 151 thumbs: { 152 swiper: galleryThumbs 153 }, 154 navigation: { 155 nextEl: ".swiper-button-next", 156 prevEl: ".swiper-button-prev" 157 }, 158 breakpoints: { 159 320: { 160 navigation: { 161 enabled: true 162 } 163 }, 164 1000: { 165 navigation: { 166 enabled: false 167 } 168 } 169 } 170 }); 171 172 } else { 173 174 var galleryTop = new Swiper("#gallery-top", { 175 spaceBetween: 0, 176 slidesPerView: 1, 177 navigation: { 178 nextEl: ".swiper-button-next", 179 prevEl: ".swiper-button-prev" 180 }, 181 breakpoints: { 182 320: { 183 navigation: { 184 enabled: true 185 } 186 }, 187 1000: { 188 navigation: { 189 enabled: false 190 } 191 } 192 } 193 }); 194 195 } 196 197 if ( $( window ).width() < 1000 ) { 198 $( '.cat-list.prod-accordion-content, .bw-posts.prod-accordion-content').css('display', 'none'); 199 } 200 201 $('.product-nav-tabs a').on('click tap', function(event) { 202 let ind = $(this).index(); 203 $(this).addClass('nav-tab-active').siblings().removeClass('nav-tab-active'); 204 $('.prod-accordion-content:eq(' + ind + ')').css('display', 'block').siblings('.prod-accordion-content').css('display', 'none'); 205 event.preventDefault(); 206 }); 207 208 $('.prod-accordion-btn').on('click tap', function(event) { 209 if (!$(this).hasClass('nav-tab-active')) { 210 $(this).addClass('nav-tab-active').siblings('.prod-accordion-btn').removeClass('nav-tab-active'); 211 $(this).next('.prod-accordion-content').css('display', 'block').siblings('.prod-accordion-content').css('display', 'none'); 212 } else { 213 $('.prod-accordion-btn').removeClass('nav-tab-active'); 214 $('.prod-accordion-content').css('display', 'none'); 215 } 216 event.preventDefault(); 217 }); 218 219 let contents = []; 220 let contents_slug; 221 222 const slugify = str => str.toLowerCase().trim().replace(/[^\w\s-]/g, '').replace(/[\s_-]+/g, '-').replace(/^-+|-+$/g, ''); 223 224 $('.contents').append( '<ol />' ); 225 $('.single-doc.wysiwyg.blog').find( 'h2' ).each(function () { 226 contents_slug = slugify($(this).text()); 227 $(this).prop('id', contents_slug); 228 $('.contents ol').append('<li><a href="#" title="' + $(this).text() + '" data-link="' + contents_slug + '">' + $(this).text() + '</a></li>'); 229 }); 230 231 $('.contents ol li a').on('click tap', function (event) { 232 233 let heading_id = $(this).attr('data-link'); 234 let heading = $('.single-doc.wysiwyg.blog #' + heading_id); 235 let heading_pos = heading.offset().top - ($('.main-nav').height() * 1.5); 236 237 $('html, body').animate({ 238 scrollTop: heading_pos 239 }, 500); 240 241 event.preventDefault(); 242 243 }); 244 245 let html; 246 $('h1, h2, h3, h4, h5, h6, h1 *, h2 *, h3 *, h4 *, h5 *, h6 *').each(function () { 247 html = $(this).html(); 248 if ($(this).children().length == 0 && html.indexOf("no-uppercase") < 0) { 249 $(this).html($(this).html().replace(/Ã/g, '<span class="no-uppercase">Ã</span>')); 250 } 251 }); 252 253 /** 254 * external links target blank 255 */ 256 257 $('a').on('click tap', function (event) { 258 var link = $('<a>', { href: $(this).attr('href') })[0].hostname; 259 var host = window.location.host; 260 261 if ($('body').hasClass('pl_PL') && link !== host) { 262 event.preventDefault(); 263 window.open($(this).attr('href'), '_blank'); 264 } 265 }); 266 267 /** 268 * gdzie kupic 269 */ 270 271 let gk_anchor; 272 $( '.ref-top-buttons a' ).on( 'click tap', function( event ) { 273 gk_anchor = $( this ).attr( 'href' ); 274 $([document.documentElement, document.body]).animate({ 275 scrollTop: $( gk_anchor ).offset().top - 110 276 }, 2000); 277 event.preventDefault(); 278 }); 279 280 $.QueryString = (function (a) { 281 if (a == "") return {}; 282 var b = {}; 283 for (var i = 0; i < a.length; ++i) { 284 var p = a[i].split('='); 285 if (p.length != 2) continue; 286 b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 287 } 288 return b; 289 })(window.location.search.substr(1).split('&')); 290 291 if (window.location.href === 'https://seni.pl/pl_PL?where-buy=go') { 292 $([document.documentElement, document.body]).animate({ 293 scrollTop: $(".gdzie-kupic-in").offset().top 294 }, 2000); 295 } 296 297 $('.main-nav-list .sample-btn-home.buy-btn-home').on('click tap', function (event) { 298 if (window.location.href === 'https://seni.pl/pl_PL' || window.location.href === 'https://seni.pl/pl_PL?where-buy=go') { 299 $([document.documentElement, document.body]).animate({ 300 scrollTop: $(".gdzie-kupic-in").offset().top 301 }, 2000); 302 } else { 303 window.location.href = 'https://seni.pl/pl_PL?where-buy=go'; 304 } 305 $('html').removeClass('menu-active'); 306 event.preventDefault(); 307 }); 308 309 $('a.bar-find').on('click tap', function (event) { 310 311 $([document.documentElement, document.body]).animate({ 312 scrollTop: $("#find-prod").offset().top - 200 313 }, 2000); 314 315 316 event.preventDefault(); 317 }); 318 319 $(function () { 320 if ($('.lady-pol').length === 0 && !$('body').hasClass('ru_RU')) { 321 jcf.replaceAll(); 322 } 323 }); 324 325 thin_menu(); 326 327 // SK - lokalizator 328 329 var tt1 = ['B1', 'B2', 'B3', 'B4', 'B5', 'MA', 'MY', 'NM', 'PK', 'PN', 'SC', 'SE', 'SI', 'TT']; 330 var tt2 = ['BN', 'DS', 'GA', 'HC', 'KN', 'LV', 'NR', 'NZ', 'PE', 'TO', 'ZM', 'SA']; 331 var tt3 = ['BY', 'DK', 'IL', 'KM', 'LM', 'MT', 'NO', 'PB', 'PU', 'RK', 'TN', 'TR', 'TS', 'CA', 'ZA']; 332 var tt4 = ['BB', 'BS', 'BR', 'DT', 'KA', 'LC', 'PT', 'PD', 'RA', 'RS', 'VK', 'ZV', 'ZC', 'ZH']; 333 var tt5 = ['BJ', 'HE', 'KK', 'LE', 'ML', 'PP', 'PO', 'SB', 'SV', 'SL', 'SP', 'SK', 'VT']; 334 var tt6 = ['GL', 'KE', 'KE', 'KE', 'KE', 'KS', 'MI', 'RV', 'SO', 'SN', 'TV']; 335 336 $('#l-map-list').change(function () { 337 //console.log($(this).val() + '/' + $('#l-map-list option:selected').attr('data-x') + '/' + $('#l-map-list option:selected').attr('data-y')); 338 339 if ($.inArray($(this).val(), tt1) !== parseInt(-1)) { 340 $('.l-map-tooltips .tt1').siblings().css('display', 'none'); 341 $('.l-map-tooltips .tt1').css({ 342 'display': 'block', 343 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 344 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 345 }).siblings().css('display', 'none'); 346 347 $('.tt1-hover, .tt12-hover').siblings().removeClass('l-map-active'); 348 $('.tt1-hover, .tt12-hover').addClass('l-map-active'); 349 } else if ($.inArray($(this).val(), tt2) !== parseInt(-1)) { 350 $('.l-map-tooltips .tt2').siblings().css('display', 'none'); 351 $('.l-map-tooltips .tt2').css({ 352 'display': 'block', 353 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 354 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 355 }).siblings().css('display', 'none'); 356 357 $('.tt2-hover').siblings().removeClass('l-map-active'); 358 $('.tt2-hover').addClass('l-map-active'); 359 } else if ($.inArray($(this).val(), tt3) !== parseInt(-1)) { 360 $('.l-map-tooltips .tt3').siblings().css('display', 'none'); 361 $('.l-map-tooltips .tt3').css({ 362 'display': 'block', 363 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 364 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 365 }).siblings().css('display', 'none'); 366 367 $('.tt3-hover').siblings().removeClass('l-map-active'); 368 $('.tt3-hover').addClass('l-map-active'); 369 } else if ($.inArray($(this).val(), tt4) !== parseInt(-1)) { 370 $('.l-map-tooltips .tt4').siblings().css('display', 'none'); 371 $('.l-map-tooltips .tt4').css({ 372 'display': 'block', 373 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 374 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 375 }).siblings().css('display', 'none'); 376 377 $('.tt4-hover').siblings().removeClass('l-map-active'); 378 $('.tt4-hover').addClass('l-map-active'); 379 } else if ($.inArray($(this).val(), tt5) !== parseInt(-1)) { 380 $('.l-map-tooltips .tt5').siblings().css('display', 'none'); 381 $('.l-map-tooltips .tt5').css({ 382 'display': 'block', 383 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 384 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 385 }).siblings().css('display', 'none'); 386 387 $('.tt5-hover').siblings().removeClass('l-map-active'); 388 $('.tt5-hover').addClass('l-map-active'); 389 } else { 390 $('.l-map-tooltips .tt6').siblings().css('display', 'none'); 391 $('.l-map-tooltips .tt6').css({ 392 'display': 'block', 393 'left': $('#l-map-list option:selected').attr('data-x') - 155 + 'px', 394 'top': $('#l-map-list option:selected').attr('data-y') - 100 + 'px' 395 }).siblings().css('display', 'none'); 396 397 $('.tt6-hover').siblings().removeClass('l-map-active'); 398 $('.tt6-hover').addClass('l-map-active'); 399 } 400 }); 401 402 $('.lml-1').hover(function () { 403 $('.tt1-hover, .tt12-hover').addClass('l-map-active'); 404 }, function () { 405 $('.tt1-hover, .tt12-hover').removeClass('l-map-active'); 406 }); 407 408 $('.lml-2').hover(function () { 409 $('.tt2-hover').addClass('l-map-active'); 410 }, function () { 411 $('.tt2-hover').removeClass('l-map-active'); 412 }); 413 414 $('.lml-3').hover(function () { 415 $('.tt3-hover').addClass('l-map-active'); 416 }, function () { 417 $('.tt3-hover').removeClass('l-map-active'); 418 }); 419 420 $('.lml-4').hover(function () { 421 $('.tt4-hover').addClass('l-map-active'); 422 }, function () { 423 $('.tt4-hover').removeClass('l-map-active'); 424 }); 425 426 $('.lml-5').hover(function () { 427 $('.tt5-hover').addClass('l-map-active'); 428 }, function () { 429 $('.tt5-hover').removeClass('l-map-active'); 430 }); 431 432 $('.lml-6').hover(function () { 433 $('.tt6-hover').addClass('l-map-active'); 434 }, function () { 435 $('.tt6-hover').
435removeClass('l-map-active'); 436 }); 437 438 $(".dla-profesjonalisty, .seni-care-nav > ul > li > a").on( 439 "click tap", 440 function (e) { 441 e.preventDefault(); 442 443 var target = this.hash; 444 var $target = $(target); 445 446 $("html, body") 447 .stop() 448 .animate( 449 { 450 scrollTop: $target.offset().top, 451 }, 452 900, 453 "swing", 454 function () { 455 window.location.hash = target; 456 } 457 ); 458 } 459 ); 460 461 if (window.location.href.indexOf("produkt/seni-active") > -1) { 462 $(".gallery-top img.jzb").css("display", "inline"); 463 } 464 465 if ($(window).width() <= 1024) { 466 $(document).mouseup(function (e) { 467 var container = $("header"); 468 469 if (!container.is(e.target) && container.has(e.target).length === 0) { 470 /*$("header").animate( 471 { 472 bottom: "-90px", 473 }, 474 400 475 );*/ 476 $("header").removeClass("shown"); 477 } 478 }); 479 480 $(".c-hamburger").on("click tap", function (event) { 481 if ($("html").hasClass("menu-active")) { 482 $("header").removeClass("shown"); 483 } 484 event.preventDefault(); 485 }); 486 } 487 488 $(".cookies-close").on("click tap", function (event) { 489 $(".cookies").remove(); 490 $.cookie("cookiesShow", "dontShow", { expires: 365, path: "/" }); 491 event.preventDefault(); 492 return false; 493 }); 494 495 if ($.cookie("cookiesShow")) { 496 $(".cookies").remove(); 497 } 498 499 $(".dr-cat").on("click tap", function (event) { 500 $(this).addClass("active").siblings().removeClass("active"); 501 502 event.preventDefault(); 503 }); 504 505 $(".sel-name").on("click tap", function (event) { 506 $(this).next(".sel-content").css("display", "block"); 507 508 event.preventDefault(); 509 }); 510 511 $("body").on("click tap", ".sel-content ul li", function (event) { 512 $(this).parent().parent().css("display", "none"); 513 $(this).parent().parent().parent().addClass("selected"); 514 $(this) 515 .parent() 516 .parent() 517 .prev() 518 .find(".sel-value") 519 .removeData("val") 520 .attr("data-val", $(this).data("val")) 521 .text($(this).text()); 522 $(".clear-filters").css("display", "inline-block"); 523 524 event.preventDefault(); 525 }); 526 527 $(".clear-filters").on("click tap", function (event) { 528 $(this).css("display", "none"); 529 $(".sel").removeClass("selected"); 530 $(".sel-value").text(""); 531 $(".sel-value").removeData("val"); 532 event.preventDefault(); 533 }); 534 535 $(".run-video").on("click tap", function (event) { 536 var o = $(this).prev("iframe").attr("src") + "?autoplay=1"; 537 $(this).prev("iframe").attr("src", o), $(this).fadeOut(); 538 event.preventDefault(); 539 }); 540 541 $(window).resize(function () { 542 thin_menu(); 543 }); 544 545 var toggles = document.querySelectorAll(".c-hamburger"); 546 547 for (var i = toggles.length - 1; i >= 0; i--) { 548 var toggle = toggles[i]; 549 toggleHandler(toggle); 550 } 551 552 function toggleHandler(toggle) { 553 toggle.addEventListener("click", function (e) { 554 this.classList.contains("is-active") === true 555 ? this.classList.remove("is-active") 556 : this.classList.add("is-active"); 557 $("html").toggleClass("menu-active"); 558 559 e.preventDefault(); 560 }); 561 } 562 563 564 565 $(".show-prod").hide(); 566 567 $(".new-seni-lady .show-prod .close").click(function () { 568 569 570 $(this).parent().hide(); 571 572 }); 573 574 $(".new-seni-lady .item-prod").click(function () { 575 576 $(".new-seni-lady .item-prod .prod-img").removeClass("active"); 577 $(" .prod-img", this).addClass("active"); 578 var dataId = $(this).attr("data-name"); 579 //$(".show-prod").toogle(); 580 $(".new-seni-lady .show-prod").hide(); 581 $(".new-seni-lady .show-prod[data-name=" + dataId + "],.new-seni-lady .show-prod[data-name=" + dataId + "] img,.new-seni-lady .show-prod[data-name=" + dataId + "] .show-prod-img").show(); 582 $('html, body').animate({ 583 scrollTop: $("#" + dataId).offset().top - 100 584 }, 400); 585 586 587 588 // $( ".new-seni-lady .show-prod[data-name="+dataId+"]" ).hide(); 589 //$(".show-prod").not(this).hide(); 590 }); 591 592 $(".lady-hero .button:first-of-type").click(function () { 593 $('html, body').animate({ 594 scrollTop: $("#zamow").offset().top - 100 595 }, 400); 596 }); 597 598 599 $('[name="product_name"]').change(function () { 600 $('#product_name_hidden').val($(this).val()); 601 }); 602 603 $(".new-seni-lady .order-box").on('click', function () { 604 605 $(".choose-size").hide(); 606 $(".order-bottom-helper").show(); 607 //$(".new-seni-lady .order-box").attr('data-click-state', 1); 608 609 $(".new-seni-lady .order-box").removeClass("active"); 610 $(this).addClass("active"); 611 let productName = $(this).data('product_name'); 612 613 if (productName) { 614 $('[name="product_name"]').prop('checked', false).parent().removeClass('jcf-checked'); 615 $('#product_name_hidden').val(productName); 616 } else { 617 if ($('[name="product_name"]:checked').length) { 618 619 } else { 620 $('#product_name_hidden').val(''); 621 } 622 } 623 624 $(".order .form").show(); 625 $(".choose-size", this).show(); 626 $(".order-bottom-helper", this).hide(); 627 628 }); 629 630 let endpoint = 'https://seni.pl/pl_PL/sample-save'; 631 let regex = new RegExp("([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|\"\(\[\]!#-[^-~ \t]|(\\[\t -~]))+\")@([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|\[[\t -Z^-~]*])"); 632 let validateEmail = (mail) => regex.test(mail); 633 let validateProd = () => $('#product_name_hidden').val().length; 634 635 let validation = () => { 636 let ok = true; 637 let reqFields = ['name', 'surname', 'street','number', 'city', 'zip' ];//'age' 638 for(let i in reqFields){ 639 let s = $('[name="sample[' + reqFields[i] + ']"]'); 640 s.removeClass('error'); 641 let v = s.val(); 642 if(!v){ 643 s.addClass('error'); 644 ok = false;
645 } 646 } 647 648 let s = $('[name="sample[email]"]'); 649 s.removeClass('error'); 650 let v = s.val(); 651 if(!validateEmail(v)){ 652 s.addClass('error'); 653 ok = false; 654 } 655 if(!ok){ 656 $('#data-error').show(); 657 }else{ 658 $('#data-error').hide(); 659 } 660 if(!validateProd()){ 661 $('#product-error').show(); 662 ok = false; 663 }else{ 664 $('#product-error').hide(); 665 } 666 return ok; 667 } 668 $('#zamow-probke-woman-pl').on('submit', function (e) { 669 e.preventDefault(); 670 if(!validation()){ 671 672 //$('.error').first().scro 673 console.log('validation error'); 674 return false; 675 }else{ 676 677 console.log('validation ok'); 678 } 679 680 $('input[type="submit"]').hide(); 681 $.ajax({ 682 type: 'post', 683 url: endpoint, 684 data: $('#zamow-probke-woman-pl').serialize(), 685 success: function (data) { 686 $('#exist-error').hide(); 687 $('#valid-error').hide(); 688 $('#consent-error').hide(); 689 $('#send').hide(); 690 if (data.status == 'ok') { 691 692 $('.order').remove(); 693 let idSend = 'send-success'; 694 if(data.email)idSend += '2'; 695 $('#'+idSend).show(); 696 window.location.hash = idSend; 697 $('html, body').animate({ 698 scrollTop: $("#"+idSend).offset().top -100 699 }, 1000); 700 fbq('track', 'zamow_probke_seni-dla-kobiet'); 701 702 703 } else { 704 if (data.exists) { 705 $('#exist-error').show(); 706 } 707 if (data.errors) { 708 $('#valid-error').show(); 709 } 710 if (data.consent) { 711 $('#consent-error').show(); 712 } 713 $('input[type="submit"]').show(); 714 } 715 console.log(data); 716 }, 717 error: function (data) { 718 console.log(data); 719 } 720 }); 721 722 723 return false; 724 }); 725 726 727 $('.faq-item h3').on('click', function () { 728 // $('.faq-item h3').toggleClass('active'); 729 $(this).next(".faq-content").slideToggle(); 730 $(this).closest(".faq-item").siblings().find('.faq-content').slideUp('fast'); 731 732 //$('.items .expand').removeClass('up'); 733 $(this).toggleClass('active'); 734 // $(this).closest(".faq-item").find('.expand').toggleClass('up'); 735 $(".faq-item>h3").not($(this)).removeClass('active'); 736 }); 737 738 }); 739 740 /** 741 * produkt 742 */ 743 744 745 746 $(".gallery-thumbs, .gallery-top").lightGallery({ 747 selector: "a", 748 thumbnail: false, 749 autoplayControls: false, 750 fullScreen: false, 751 zoom: false, 752 share: false, 753 hash: false 754 }); 755 756})(jQuery); 757 758function thin_menu() { 759 "use strict"; 760 if ($(window).width() > 1024) { 761 if ($(window).scrollTop() > 110) { 762 $("header").addClass("thin"); 763 $("body").css("padding-top", "110px"); 764 } else { 765 $("header").removeClass("thin"); 766 $("body").css("padding-top", "0px"); 767 } 768 769 $(window).scroll(function () { 770 if ($(window).scrollTop() > 110) { 771 $("header").addClass("thin"); 772 $("body").css("padding-top", "110px"); 773 } else { 774 $("header").removeClass("thin"); 775 $("body").css("padding-top", "0px"); 776 } 777 }); 778 } 779} 780 781var zamowProbke = function () { 782 var pages = $(".zamow-probke-form > div.clear"); 783 784 $(".zpf-next").on("click", function (e) { 785 $(".error").hide(); 786 var nextpage = $(this).attr("data-next"); 787 if (nextpage) { 788 if (nextpage == "zpf4") { 789 if (!validateSampleProducts()) { 790 $(".sampleProductError").show(); 791 e.preventDefault(); 792 return false; 793 } 794 } 795 if (nextpage == "zpf3") { 796 if ( 797 /*window.location.href.indexOf("pl_PL") > -1 ||*/ window.location.href.indexOf( 798 "nl_NL" 799 ) > -1 800 ) { 801 //pl_PL || nl_NL 802 if (!validateSampleProducts()) { 803 $(".sampleProductError").show(); 804 e.preventDefault(); 805 return false;
806 } 807 } 808 if (window.location.href.indexOf("ru_RU") > -1) { 809 if (!$('[name="zpf-osoba"]:checked').length) { 810 $(".ntmLevelError").show(); 811 e.preventDefault(); 812 return false; 813 } 814 } 815 816 $("#fntm1").hide(); 817 $("#fntm2").hide(); 818 $("#fntm3").hide(); 819 $("#fntm4").hide(); 820 $("fieldset#f" + $("input[name=zpf-osoba]:checked").val()).show(); 821 } 822 if (nextpage == "zpf2") { 823 console.log(window.location.href.indexOf("pl_PL") > -1); 824 if (window.location.href.indexOf("ru_RU") > -1) { 825 if (!$('[name="sample[from_know]"]:checked').length) { 826 $(".knowFromError").show(); 827 e.preventDefault(); 828 return false; 829 } 830 if (!$('[name="sample[sex]"]:checked').length) { 831 $(".sexError").show(); 832 e.preventDefault(); 833 return false; 834 } 835 } 836 837 if (window.location.href.indexOf("pl_PL") > -1) { 838 if (!$("#ntm2").is(":checked")) { 839 if ($(this).text() == "« wstecz") { 840 nextpage = "zpf1"; 841 } else { 842 nextpage = "zpf3"; 843 } 844 } 845 } 846 if (window.location.href.indexOf("nl_NL") > -1) { 847 if (!validateNtm()) { 848 $(".sampleNtmError").show(); 849 e.preventDefault(); 850 return false; 851 } 852 } 853 } 854 pages.removeClass("current"); 855 $("." + nextpage).addClass("current"); 856 } else { 857 } 858 $("#noMoreAlert").css("display", "none"); 859 }); 860}; 861 862/* ========================================================================== 863 DIAGNOSTYKA 864 ========================================================================== */ 865 866$().ready(function () { 867 $("[data-form-item]").click(function () { 868 var n = $(this).attr("data-form-item"); 869 var v = $(this).attr("data-form-value"); 870 $("[data-form-item=" + n + "]").removeClass("active"); 871 $(this).addClass("active"); 872 $("[name=" + n + "]").val(v); 873 874 diagnostics.next(); 875 876 return false; 877 }); 878 879 880 $(".diag-steps > span").click(function () { 881 if ($(this).hasClass("dsi-result")) return false; 882 var idx = $(this).index() + 1; 883 if (idx == 2 && $('[name="for_whom"]').val() == "") return; 884 if (idx == 3 && $('[name="physical_condition"]').val() == "") return; 885 886 $(this).addClass("dsi-curr").siblings().removeClass("dsi-curr"); 887 diagnostics.goto(idx); 888 }); 889 890 891 $(".diag-submit").click(function () { 892 if (diagnostics.checkSubmit()) { 893 $("#diagnostics-form").submit(); 894 } 895 return false; 896 }); 897 898 899 $(".printPage").click(function () { 900 window.print(); 901 return false; 902 }); 903}); 904 905 906var diagnostics = { 907 current: 1, 908 variant: "", 909 next: function () { 910 diagnostics.goto(diagnostics.current + 1); 911 }, 912 getVariant: function () { 913 var w = ""; 914 var fw = $('[name="for_whom"]').val(); 915 switch (fw) { 916 case "woman": 917 w = "a"; 918 break; 919 case "man": 920 w = "b"; 921 break; 922 case "care_child": 923 w = "c"; 924 break; 925 case "care_woman": 926 case "care_man": 927 w = "d"; 928 break; 929 } 930 return w; 931 }, 932 goto: function (idx) { 933 $(".diag-steps > span").removeClass("dsi-curr"); 934 $(".diag-steps > span:eq(" + (idx - 1) + ")").addClass("dsi-curr"); 935 var currentClass = ".diag-step-" + diagnostics.current + diagnostics.variant; 936 937 diagnostics.current = idx; 938 939 var fw = $('[name="for_whom"]').val(); 940 var pc = $('[name="physical_condition"]').val(); 941 var inc = $('[name="incontinence"]').val(); 942 var sl = $('[name="senilady"]').val(); 943 var special = $('[name="special"]').val(); 944 945 946 switch (idx) { 947 case 6: 948 if (special == 'special_dn') { 949 diagnostics.current = 5; 950 diagnostics.variant = "kd"; 951 } else { 952 this.submit(); 953 return false;
954 } 955 break; 956 case 5: 957 diagnostics.variant = "k" + sl; 958 break; 959 case 4: 960 if ((fw == 'woman' || fw == 'care_woman') && (pc == 'active' || pc == 'wheelchair') && (inc == 'incontinence_1' || inc == 'incontinence_2' || inc == 'incontinence_preg')) { 961 diagnostics.variant = "k" 962 } else { 963 this.submit(); 964 return false; 965 } 966 break; 967 case 3: 968 switch (fw) { 969 case "woman": 970 diagnostics.variant = "a"; 971 break; 972 case "man": 973 diagnostics.variant = "b"; 974 break; 975 case "care_child": 976 diagnostics.variant = "c"; 977 break; 978 case "care_woman": 979 case "care_man": 980 diagnostics.variant = "d"; 981 break; 982 } 983 break; 984 } 985 986 $(currentClass).removeClass("active"); 987 $(".diag-step-" + diagnostics.current + diagnostics.variant).addClass("active"); 988 }, 989 submit: function () { 990 if (diagnostics.checkSubmit()) { 991 $("#diagnostics-form").submit(); 992 } 993 return false; 994 }, 995 checkSubmit: function () { 996 var error = false; 997 998 if ($('[name="incontinence"]').val() == "") { 999 error = true; 1000 $(".diag-step-3" + diagnostics.variant) 1001 .children(".diag-right-row") 1002 .children(".groupError") 1003 .addClass("error"); 1004 } else { 1005 $(".diag-step-3" + diagnostics.variant) 1006 .children(".diag-right-row") 1007 .children(".groupError") 1008 .removeClass("error"); 1009 } 1010 if (error) { 1011 $(".formErrorInfo").addClass("active"); 1012 } else { 1013 $(".formErrorInfo").removeClass("active"); 1014 } 1015 1016 return !error; 1017 }, 1018}; 1019 1020/* ========================================================================== 1021 DIAGNOSTYKA - END 1022 ========================================================================== */ 1023 1024function validateSampleProducts() { 1025 if (window.location.href.indexOf("cs_CZ") > -1) { 1026 //cs_CZ 1027 $(".productError").hide(); 1028 var selectedProds = $('[name="sample[message]"]:checked'); 1029 if (selectedProds.length > 0) { 1030 var inputId = selectedProds[0].id; 1031 if ($('[for="' + inputId + '"]').is(":visible")) { 1032 return true; 1033 } 1034 } 1035 return false; 1036 } else if (window.location.href.indexOf("de_DE") > -1) { 1037 //de_DE 1038 var selectedProds = $('[name="sample[message]"]:checked'); 1039 if (selectedProds.length > 0) { 1040 var inputId = selectedProds[0].id; 1041 if ($('[for="' + inputId + '"]').is(":visible")) { 1042 return true; 1043 } 1044 } 1045 return false; 1046 } else if (window.location.href.indexOf("en_IN") > -1) { 1047 //en_IN 1048 var selectedProds = $('[name="sample[message]"]:checked'); 1049 if (selectedProds.length > 0) { 1050 var inputId = selectedProds[0].id; 1051 if ($('[for="' + inputId + '"]').is(":visible")) { 1052 return true; 1053 } 1054 } 1055 return false; 1056 } else if (window.location.href.indexOf("en_US") > -1) { 1057 //en_US 1058 var selectedProds = $(".zpfchecked"); 1059 if (selectedProds.length > 0) { 1060 return true; 1061 } 1062 return false; 1063 } else if (window.location.href.indexOf("hu_HU") > -1) { 1064 //hu_HU 1065 var selectedProds = $(".zpfchecked"); 1066 if (selectedProds.length > 0) { 1067 return true; 1068 } 1069 return false; 1070 } else if (window.location.href.indexOf("lv_LV") > -1) { 1071 //lv_LV 1072 var selectedProds = $('[name="sample[message]"]:checked'); 1073 if (selectedProds.length > 0) { 1074 var inputId = selectedProds[0].id; 1075 if ($('[for="' + inputId + '"]').is(":visible")) { 1076 return true; 1077 } 1078 } 1079 return false;
1080 } else if (window.location.href.indexOf("nl_NL") > -1) { 1081 //nl_NL 1082 var selectedProds = $('[name="sample[message]"]:checked'); 1083 if (selectedProds.length > 0) { 1084 var inputId = selectedProds[0].id; 1085 if ($('[for="' + inputId + '"]').is(":visible")) { 1086 return true; 1087 } 1088 } 1089 return false; 1090 } else if (window.location.href.indexOf("pl_PL") > -1) { 1091 //pl_PL 1092 var selectedProds = $('[name="sample[product]"]:checked'); 1093 if (selectedProds.length > 0) { 1094 var inputId = selectedProds[0].id; 1095 if ($('[for="' + inputId + '"]').is(":visible")) { 1096 return true; 1097 } 1098 } 1099 return false; 1100 } else if (window.location.href.indexOf("ru_BY") > -1) { 1101 //ru_BY 1102 var selectedProds = $('[name="sample[message]"]:checked'); 1103 if (selectedProds.length > 0) { 1104 var inputId = selectedProds[0].id; 1105 if ($('[for="' + inputId + '"]').is(":visible")) { 1106 return true; 1107 } 1108 } 1109 return false; 1110 } else if (window.location.href.indexOf("ru_RU") > -1) { 1111 //ru_RU 1112 var selectedProds = $('[name="sample[message]"]:checked'); 1113 if (selectedProds.length > 0) { 1114 var inputId = selectedProds[0].id; 1115 if ($('[for="' + inputId + '"]').is(":visible")) { 1116 return true; 1117 } 1118 } 1119 return false; 1120 } else if (window.location.href.indexOf("ru_UA") > -1) { 1121 //ru_UA 1122 var selectedProds = $('[name="sample[message]"]:checked'); 1123 if (selectedProds.length > 0) { 1124 var inputId = selectedProds[0].id; 1125 if ($('[for="' + inputId + '"]').is(":visible")) { 1126 return true; 1127 } 1128 } 1129 return false; 1130 } else if (window.location.href.indexOf("sk_SK") > -1) { 1131 //sk_SK 1132 var selectedProds = $(".zpfchecked"); 1133 if (selectedProds.length > 0) { 1134 return true; 1135 } 1136 return false; 1137 } else if (window.location.href.indexOf("uk_UA") > -1) { 1138 //uk_UA 1139 var selectedProds = $('[name="sample[message]"]:checked'); 1140 if (selectedProds.length > 0) { 1141 var inputId = selectedProds[0].id; 1142 if ($('[for="' + inputId + '"]').is(":visible")) { 1143 return true; 1144 } 1145 } else { 1146 return true; 1147 } 1148 } 1149} 1150function validateNtm() { 1151 var selectedNtm = $('[name="zpf-osoba"]:checked'); 1152 if (selectedNtm.length > 0) { 1153 return true; 1154 } 1155 return false; 1156}
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.