if (!gwpstyle) { var gwpstyle = document.createElement('style'); gwpstyle.textContent = ' .gwp-div { clear: both; position:relative; } .sm-gwp-img-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0px; width: 100%; } .gwp-opt { box-sizing: border-box; text-align: center; border:1px solid transparent; padding:1px; margin:0px; border-radius:7px; overflow-x:hidden; position: relative; } .gwp-opt:hover { border-top:0px solid #EEEEEE; padding:1px; } .gwp-opt:hover .gwp-opt-name { padding-top:1px; } .gwp-opt-sel:hover .gwp-opt-name { padding-top: 0px; } .gwp-opt-sel { border:1px solid #000000 !important; padding:1px; } .gwp-opt-sel:hover { padding:1px; } .gwp-opt-name { text-align: center; width: 100%; } .gwp-opt-title { min-height: 1em; padding: 11px 0px; } .gwp-opt-prev { position:relative; width: 100%; } .gwp-opt-prev div { position:absolute; left:-505px; width:500px; display:none; z-index:1000; border:1px solid #bcbcbc; background-color:#FFFFFF; box-shadow:3px 3px 6px #AAAAAA; } .gwp-opt img { cursor:pointer; border-radius:7px; } .gwp-opt-more { position:relative; cursor:pointer; border-radius:7px; border:1px solid #888888; color:#888888; padding-top:100%; } .gwp-opt-more div { font-size:14px; text-align:center; line-height:12px; position:absolute; top:50%; left:0px; width:100%; margin-top:-0.5em; } .gwp-opt-prev-title { display: block; text-align: center; } .gwp-opt-title { font-weight:bold; padding: 0px 20px; display: inline-block; } .gwp-opt-prev .icon { width:auto; height:auto; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .gwp-opt-prev .icon-close:before { content: "✕"; font-weight: bold; } '; document.head.appendChild(gwpstyle); } gwpNo = {101: "1", 102: "1", 103: "", 106: "1", 105: "1", 207: "1", 208: "1", 209: "1", 210: "1", 211: "1", 212: "1", 213: "1", 214: "1", 215: "1", 216: "1", 218: "1", 217: "1", 220: "2", 219: "2", 221: "1", 222: "1", 223: "1", 224: "1", 225: "1", 226: "1", 139: "4", 140: "3", 113: "1", 114: "1", 135: "1", 136: "1", 195: "1", 196: "1", 147: "1", 148: "1", 137: "1", 138: "1", 197: "1", 198: "1", 227: "1", 228: "1", 234: "3", 235: "3", 236: "3", 237: "3", 238: "3", 239: "3", 240: "3", 241: "3", 242: "3", 243: "3", 244: "3", 245: "3", 246: "3", 247: "8", 269: "2", 270: "2", 271: "2", 272: "2", 273: "2", 274: "2", 275: "2", 276: "2", 277: "2", 278: "1", 280: "1", 281: "1", 282: "1", 283: "1", 279: "1", 284: "1", 285: "1", 286: "1", 287: "1", 288: "1", 289: "1", 290: "2", 266: "3", 267: "3", 268: "4", 291: "4", 292: "4", 248: "2", 250: "2", 249: "2", 259: "1", 260: "1", 298: "3", 299: "3", 300: "4", 301: "1", 302: "1", 303: "1", 304: "1", 305: "1", 306: "1", 307: "1", 308: "1", 309: "1", 310: "1", 311: "1", 312: "1", 313: "1", 314: "1", 315: "1", 317: "1", 316: "1", 318: "2", 320: "6", 319: "6", 326: "2", 327: "2", 328: "2", 336: "2", 337: "2", 329: "2", 330: "2", 331: "2", 332: "2", 333: "2", 334: "2", 335: "2", 343: "1", 344: "1", 345: "1", 357: "1", 356: "1", 346: "1", 347: "1", 348: "1", 349: "1", 350: "1", 351: "1", 352: "1", 353: "1", 354: "1", 355: "1", 389: "1", 390: "1", 391: "1", 392: "1", 393: "1", 394: "1", 395: "1", 396: "1", 397: "1", 398: "1", 399: "1", 400: "1", 401: "1", 402: "1", 403: "1", 404: "1", 405: "1", 406: "1", 407: "1", 408: "1", 409: "1", 410: "1", 411: "1", 412: "1", 386: "1", 387: "1", 388: "1", 363: "1", 364: "1", 365: "1", 379: "1", 380: "1", 366: "1", 367: "1", 368: "1", 369: "1", 370: "2", 376: "2", 373: "3", 371: "1", 372: "1", 374: "1", 375: "1", 377: "1", 378: "1", 444: "1", 442: "1", 445: "1", 443: "1", 441: "1", 440: "1", 439: "1", 438: "1", 434: "1", 435: "1", 436: "1", 437: "1", 433: "1", 432: "1", 431: "1", 430: "1", 429: "1", 428: "1", 427: "1", 426: "1", 425: "1", 424: "1", 423: "1", 422: "1", 421: "1", 446: "1", 448: "1", 447: "1", 418: "1", 419: "1", 420: "1", 449: "1", 450: "1", 451: "1", 452: "1", 453: "1", 454: "1", 455: "1", 456: "1", 457: "1", 458: "1", 459: "1", 460: "1", 461: "1", 462: "1", 463: "2", 464: "2", 465: "1", 466: "1", 467: "1", 468: "1", 469: "1", 470: "1", 471: "1", 472: "1", 473: "1", 474: "1", 475: "1", 476: "1", 477: "1", 478: "1", 479: "1", 480: "1", 481: "1", 482: "1", 483: "1", 486: "1", 484: "1", 487: "1", 485: "1", 489: "1", 490: "1", 491: "1", 488: "1", 492: "1", 493: "1", 494: "2", 495: "1", 496: "1", 497: "1", 498: "1", 499: "1", 500: "1", 501: "1", 502: "1", 503: "1", 504: "1", 505: "1", 506: "1", 507: "1", 508: "1", 509: "1", 510: "1", 511: "1", 512: "1", 513: "1", 514: "1", 515: "1", 516: "1", 517: "1", 518: "1", 519: "1", 520: "1", 521: "1", 522: "1", 523: "1", 524: "1", 525: "1", 526: "1", 527: "1", 528: "1", 529: "1", 530: "1", 531: "1", 532: "1", 533: "1", 534: "1", 535: "1", 536: "1", 537: "1", 538: "1", 539: "1", 540: "1", 541: "1", 542: "1", 543: "1", 544: "1", 545: "1", 546: "1", 547: "1", 548: "1", 549: "1", 550: "1", 551: "1", 552: "1", 553: "1", 554: "1", 555: "1", 556: "1", 557: "1", 558: "1", 559: "1", 560: "1", 561: "1", 562: "1", 563: "1", 564: "1", 565: "1", 566: "1", 567: "1", 568: "1", 569: "1", 570: "1", 571: "1", 572: "1", 573: "1", 574: "1", 575: "1", 576: "1", 577: "1", 578: "1", 579: "1", 585: "1", 586: "1", 587: "1", 603: "1", 602: "1", 598: "1", 593: "1", 594: "1", 595: "1", 596: "1", 597: "1", 599: "1", 600: "1", 588: "1", 589: "1", 590: "1", 591: "1", 592: "1", 601: "1", 613: "1", 614: "1", 615: "1", 616: "1", 612: "1", 617: "1", 619: "1", 618: "1", 609: "1", 610: "1", 611: "1", 628: "1", 629: "1", 630: "1", 634: "1", 632: "1", 631: "1", 633: "1", 635: "1", 637: "1", 636: "1", 625: "1", 626: "1", 627: "1", 647: "1", 649: "1", 646: "1", 648: "1", 650: "1", 651: "1", 643: "1", 644: "1", 645: "1", 653: "1", 652: "1", 662: "1", 663: "1", 664: "1", 665: "1", 666: "1", 667: "1", 668: "1", 669: "1", 670: "1", 671: "1", 672: "1", 673: "1", 674: "1", 675: "1", 677: "1", 676: "1", 659: "1", 660: "1", 661: "1", 678: "1", 695: "1", 696: "1", 698: "1", 697: "1", 684: "1", 685: "1", 686: "1", 687: "1", 688: "1", 689: "1", 690: "1", 691: "1", 692: "1", 693: "1", 694: "1", 704: "1", 705: "1", 706: "1", 735: "1", 734: "1", 733: "1", 707: "1", 708: "1", 709: "1", 710: "1", 715: "1", 716: "1", 717: "1", 718: "1", 719: "1", 720: "1", 721: "1", 722: "1", 723: "1", 724: "1", 725: "1", 726: "1", 727: "1", 728: "1", 729: "1", 730: "1", 731: "1", 732: "1", 711: "1", 712: "1", 713: "1", 714: "1", 741: "1", 742: "1", 743: "1", 771: "1", 773: "1", 772: "1", 745: "1", 746: "1", 744: "1", 747: "1", 749: "1", 751: "1", 752: "1", 770: "1", 748: "1", 750: "1", 799: "1", 801: "1", 800: "1", 779: "1", 780: "1", 781: "1", 782: "1", 783: "1", 784: "1", 786: "1", 787: "1", 788: "1", 789: "1", 790: "1", 791: "1", 792: "1", 793: "1", 794: "1", 795: "1", 796: "1", 785: "1", 798: "1", 797: "5", 803: "1", 802: "1", 835: "1", 829: "1", 830: "1", 832: "1", 831: "1", 834: "1", 833: "1", 836: "1", 809: "4", 810: "1", 811: "1", 812: "1", 813: "1", 814: "1", 815: "1", 816: "1", 817: "1", 818: "1", 819: "1", 820: "1", 821: "1", 822: "1", 823: "1", 824: "1", 825: "1", 826: "1", 827: "1", 828: "1", 848: "1", 850: "1", 849: "1", 852: "1", 851: "1", 854: "1", 847: "1", 853: "1", 842: "1", 843: "1", 844: "1", 845: "1", 846: "1", 860: "1", 861: "1", 862: "1", 863: "1", 870: "1", 865: "1", 867: "1", 866: "1", 869: "1", 868: "1", 864: "1", 872: "1", 871: "1", 878: "1", 879: "1", 880: "1", 881: "1", 882: "1", 883: "1", 884: "1", 886: "1", 885: "1", 887: "1", 888: "1", 890: "1", 889: "1", 891: "1", };var opt_list = [22,121,40,122,96,41,123,126,130,29,39,93,45,134,137,140,150,149,152,147,156,157,159,162,164,165,167,171,172,174,187,186,189,179,180,182,193,194,196,199,200,201,202,203,204,206,209,207,214,216,213,220,221,223,227,230,228,235,234,237,241,242,244,248,251,249,255,256,261,265,269,270,271,273,275,276,277,281,284,283,285,289,291,292,295,299,301,302,303]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '649'; var gwpurl = 'https://gwp.brweb.pl/i/649/'; var imgLimit = '8'; var moreLabel = '+'; var lessLabel = '-'; var showMLcnt = '1'; var prevMopen = ''; var selectLangVal = ['','wybierz','choose','wählen','Vybrat','vali','izvēlēties','pasirinkti','választ','vyberte si','вибрати','-1']; function oClick(e,type) { if (type == 'S') { selectClick(e); } else { radioClick(e); } setTimeout(showGWP,500); } function setValToInput(optInput,optValue) { if (optInput) { optInput.value = optValue; } else { setTimeout(function() { setValToInput(optInput,optValue); }, 500); } } function selectClick(e) { var id = e.id; var aId = id.split('__'); var optId = aId[0].replace('option_',''); var srl = document.getElementsByName(aId[0]); var sr = null; var optInput = null; var optValue = null; for( var k = 0; k < srl.length; k++){ if (srl[k].tagName == 'H-DROPDOWN-CONTENT') { sr = srl[k]; } if (srl[k].tagName == 'INPUT') { optInput = srl[k]; } } if (sr == null) { srl[1].click(); setTimeout(function() { selectClick(e); }, 500); return false; } sr = document.getElementsByTagName('H-OPTION'); for( var k = 0; k < sr.length; k++){ if (sr[k].value == aId[1]) { sr[k].click(); optValue = aId[1]; /* if (e.parentNode.classList.contains('gwp-opt-sel')) { optValue = ''; } */ setValToInput(optInput,optValue); var aSO = aId[0].split('_'); var soptid = aSO[1]; if (document.getElementById('gwp_div_title_'+soptid)) document.getElementById('gwp_div_title_'+soptid).innerHTML = e.title; } } var c = document.getElementsByClassName('c_' + aId[0]); for( var i = 0; i < c.length; i++){ c[i].parentElement.className = c[i].parentElement.className.replace(' gwp-opt-sel'); if ( c[i].id == id ) { c[i].parentElement.className = c[i].parentElement.className + ' gwp-opt-sel'; } } } function radioClick(e) { var id = e.id; var aId = id.split('__'); document.getElementById(aId[0].replaceAll('_','-')+'-'+aId[1]).click(); var aSO = aId[0].split('_'); var soptid = aSO[1]; if (document.getElementById('gwp_div_title_'+soptid)) document.getElementById('gwp_div_title_'+soptid).innerHTML = e.title; var c = document.getElementsByClassName('c_' + aId[0]); for( var i = 0; i < c.length; i++){ c[i].parentElement.className = c[i].parentElement.className.replace(' gwp-opt-sel',''); if ( c[i].id == id ) c[i].parentElement.className = c[i].parentElement.className + ' gwp-opt-sel'; } } function gwpMore(oid) { var h = document.getElementsByClassName('gwpHidden'+oid); var type = more_txt[oid] == document.getElementById('gwp_more'+oid).innerHTML ? 'block' : 'none'; for( var i = 0; i < h.length; i++){ h[i].style.display = (h[i].className == 'gwp-opt gwpHidden'+oid+' gwp-opt-sel') ? 'block' : type; } document.getElementById('gwp_more'+oid).innerHTML = type == 'block' ? less_txt[oid] : more_txt[oid] ; } function showGWP() { var isLoading = 0; var isDiff = 0; opt_list.forEach(function(opt_id) { var pv = document.getElementsByTagName('product-variants')[0]; var radiov = ''; var srl = document.getElementsByName('option_'+opt_id); if (pv && srl.length == 0) { radiov = '_'+pv.getAttribute("product-instance-key"); srl = document.getElementsByName('option_'+opt_id+radiov); } if (srl.length == 0) { return; } var optValue = ''; var sr = null; if (srl[0].tagName == 'H-DROPDOWN') { srl[0].style.display = 'none'; var smain = srl[0].parentElement.parentElement.parentElement.parentElement; for( var k = 0; k < srl.length; k++){ if (srl[k].tagName == 'H-DROPDOWN-CONTENT') { sr = srl[k]; } if (srl[k].tagName == 'INPUT') { optValue = srl[k].value; } } if (sr == null) { srl[1].click(); setTimeout(function() { var srl = document.getElementsByName('option_'+opt_id); for( var k = 0; k < srl.length; k++){ if (srl[k].tagName == 'H-DROPDOWN-CONTENT') { sr = srl[k]; } if (srl[k].tagName == 'INPUT') { optValue = srl[k].value; } } }, 500); } var optType = 'S'; var s = sr; var c = sr.getElementsByTagName('h-option'); } else { var optType = 'R'; var s = srl[0].parentElement.parentElement.parentElement.parentElement; var smain = srl[0].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; if (sid == 497 || sid == 562 || sid == 588 || sid == 602) { s = srl[0].parentElement.parentElement.parentElement.parentElement.parentElement; smain = srl[0].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; } if (s.className != 'control') { s = s.parentElement; smain = smain.parentElement; } s.parentElement.style.display = 'none'; var c = srl; for( var j = 0; j < c.length; j++){ if (c[j].checked == true) { optValue = c[j].dataset.userValue; } } } isDiff = (!optTmp[opt_id] || optTmp[opt_id] != s.innerText.replace(/\s+/g, '') || (sid != 367 && optTmpVal[opt_id] != optValue)) ? 1 : 0; if (sid == 562) { isDiff = (!optTmp[opt_id] || optTmp[opt_id] != s.innerHTML.replace(/\s+/g, '') || (optTmpVal[opt_id] != optValue)) ? 1 : 0; } if (smain.getAttribute("stock-order") > 0 && smain.className.indexOf('loading') != -1) { isLoading++; } if (isDiff == 1 || changeStock == 1) { var sOptions = '', sPreview = '', sTitle = ''; var imgNo = 0; var optCnt = (optType == 'S') ? c.length : c.length; if (optType == 'R') { for( var j = 0; j < c.length; j++){ if (c[j].parentElement.getAttribute("hidden") != null) { optCnt--; } } } more_txt[opt_id] = moreLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); less_txt[opt_id] = lessLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); var smTitle = ''; for( var j = 0; j< c.length; j++){ if (!selectLangVal.includes(c[j].value) && c[j].parentElement.className != 'radio-wrap none' && !c[j].hidden) { imgNo++; var smIsSelect = ((optType == 'S' && (optValue == c[j].value)) || (optType == 'R' && c[j].checked == true)) ? 1 : 0; smItenSelect = smIsSelect == 1 ? ' gwp-opt-sel' : ''; smItenDisplay = (imgNo < imgLimit || (imgNo == imgLimit && imgNo == optCnt)) ? 'block' : 'none'; var lastOpt = (imgNo == imgLimit - 1) ? '!important' : ''; var lastOptClass = (imgNo == imgLimit - 1) ? ' toHidden ' : ''; var lastOptId = (imgNo == imgLimit - 1) ? ' id="gwp_loi_'+oId+'" ' : ''; if (smIsSelect == 1) { smItenDisplay = 'block'; if (imgNo > imgLimit || (imgNo == imgLimit && imgNo < optCnt)) { sOptions = sOptions.replace('block!important','none'); sOptions = sOptions.replace('toHidden','gwpHidden'+opt_id); } } smItenHidden = (imgNo > imgLimit || (imgNo == imgLimit && imgNo != optCnt)) ? ' gwpHidden'+opt_id+' ' : ''; oName = c[j].dataset.userValue ; var smItemUnavailable = (c[j].hasAttribute('data-option-value-unavailable')) ? ' gwp-opt-unavailable' : ''; if (c[j].dataset.priceModifier && c[j].dataset.priceModifier != '') { oName += ' (' + c[j].dataset.priceModifier + ')'; } oId = (optType == 'S') ? s.name : c[j].name; if (smItenSelect == ' gwp-opt-sel') { smTitle = oName; } sOptions += '