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:3px solid transparent; border-bottom: 0px; padding:1px 1px 5px 1px; margin:0px; border-radius:7px; overflow-x:hidden; position: relative; padding-bottom: 20px; } .gwp-opt:hover { border:0px solid #EEEEEE; padding:1px; padding-bottom: 17px; } .gwp-opt-sel { border:2px solid #777777 !important; padding:1px; padding-bottom: 17px; } .gwp-opt-sel:hover { padding:1px; padding-bottom: 17px; } .gwp-opt-name { text-align: center; width: 100%; } .gwp-opt-title { min-height: 1em; padding: 11px 0px; } .gwp-opt-prev { position:relative; } .gwp-opt-prev div { position:absolute; left:-255px; width:250px; 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; }'; document.head.appendChild(gwpstyle); } gwpNo = {252: "3", 254: "2", 256: "2", 257: "2", 262: "2", 258: "2", 261: "2", 260: "2", 253: "3", 263: "2", 255: "2", 259: "2", 264: "1", 265: "1", 266: "1", 35: "1", 33: "1", 37: "1", 32: "1", 39: "1", 40: "1", 31: "1", 30: "1", 16: "1", 17: "1", 28: "1", 38: "1", 29: "1", 15: "1", 36: "2", 34: "1", 268: "1", 301: "1", 269: "1", 267: "1", 270: "1", 271: "1", 277: "1", 276: "1", 274: "1", 275: "1", 272: "1", 273: "1", 289: "1", 291: "1", 290: "1", 288: "1", 287: "1", 286: "1", 285: "1", 302: "1", 281: "1", 278: "1", 280: "1", 279: "1", 283: "1", 284: "1", 282: "1", 298: "1", 299: "1", 300: "1", 292: "1", 293: "1", 294: "1", 296: "1", 295: "1", 297: "1", 312: "1", 311: "1", 303: "1", 307: "1", 308: "1", 313: "1", 309: "1", 305: "1", 304: "1", 306: "1", 310: "1", 314: "1", 318: "1", 322: "1", 321: "1", 317: "1", 325: "1", 324: "1", 320: "1", 316: "1", 315: "1", 319: "1", 323: "1", 338: "1", 327: "1", 326: "1", 328: "1", 333: "", 334: "1", 335: "1", 337: "1", 336: "1", 339: "1", 340: "1", 341: "1", 342: "1", 352: "1", 343: "1", 344: "1", 345: "1", 346: "1", 347: "1", 348: "1", 349: "1", 350: "1", 351: "1", 353: "2", 354: "1", 355: "1", 356: "1", 357: "1", 358: "1", 359: "1", 360: "1", 361: "1", 362: "1", 363: "1", 391: "1", 392: "1", 393: "1", 394: "1", 389: "1", 390: "1", 364: "1", 365: "1", 366: "1", 367: "1", 368: "1", 369: "1", 370: "1", 371: "1", 372: "1", 373: "1", 374: "1", 416: "1", 375: "1", 376: "1", 377: "1", 378: "1", 379: "1", 380: "1", 381: "1", 382: "1", 384: "1", 383: "1", 385: "1", 386: "1", 395: "1", 396: "1", 397: "1", 398: "1", 399: "1", 400: "1", 401: "1", 387: "2", 417: "1", 454: "1", 455: "2", 419: "1", 420: "1", 421: "1", 422: "1", 426: "1", 425: "1", 424: "1", 423: "1", 427: "1", 428: "1", 429: "1", 457: "1", 430: "1", 431: "1", 432: "1", 433: "1", 437: "1", 436: "1", 435: "1", 440: "1", 441: "1", 434: "1", 439: "1", 438: "1", 442: "1", 444: "1", 445: "1", 446: "1", 447: "1", 448: "1", 449: "1", 453: "1", 450: "1", 458: "1", 460: "1", 461: "1", 465: "1", 464: "1", 463: "1", 466: "1", 467: "1", 468: "1", 469: "1", 472: "1", 470: "1", 462: "1", 459: "1", 473: "1", 474: "1", 475: "1", 476: "1", 477: "1", 478: "1", 479: "1", 480: "1", 481: "1", 482: "1", 483: "1", 484: "1", 485: "1", 486: "1", 487: "1", 534: "1", 535: "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", 515: "1", 512: "1", 513: "1", 511: "1", 516: "1", 514: "1", 510: "1", 506: "1", 505: "1", 504: "1", 508: "1", 509: "1", 507: "1", 503: "1", 488: "1", 489: "1", 490: "1", 491: "1", 495: "1", 494: "1", 493: "1", 492: "1", 496: "1", 497: "1", 498: "1", 499: "1", 501: "1", 500: "1", 533: "2", 537: "1", 538: "1", 540: "1", 542: "1", 543: "1", 545: "1", 546: "2", 547: "1", 548: "1", 388: "1", 502: "1", 517: "1", 443: "1", 471: "1", 452: "1", 451: "1", 549: "1", 550: "1", 551: "1", 552: "1", 553: "1", 554: "1", 555: "1", 559: "1", 560: "1", 561: "1", 562: "1", 557: "1", 556: "1", 564: "1", 563: "1", 558: "1", 565: "1", 566: "1", 567: "1", 568: "1", 569: "1", 570: "1", 571: "1", 573: "1", 572: "1", 574: "1", 575: "1", 576: "1", 577: "1", 581: "1", 580: "1", 584: "1", 585: "1", 579: "1", 578: "1", 582: "1", 583: "1", 586: "1", 587: "1", 588: "1", 589: "1", 590: "1", 591: "1", 592: "1", 593: "1", 594: "1", 595: "1", 596: "1", 597: "1", 598: "1", 599: "1", 600: "1", 601: "1", 603: "1", 602: "1", 604: "1", 605: "1", 608: "1", 607: "1", 606: "1", 628: "1", 629: "1", 626: "1", 624: "1", 627: "1", 625: "1", 621: "1", 622: "1", 623: "1", 609: "1", 610: "1", 611: "1", 612: "1", 616: "1", 615: "1", 620: "1", 619: "1", 618: "1", 614: "1", 613: "1", 617: "1", 655: "1", 656: "1", 648: "1", 652: "1", 651: "1", 650: "1", 654: "1", 649: "1", 653: "1", 647: "1", 646: "1", 644: "1", 633: "1", 635: "1", 634: "2", 640: "1", 636: "1", 632: "1", 631: "1", 630: "1", 637: "1", 641: "1", 645: "1", 643: "1", 642: "1", 638: "1", 639: "1", 657: "1", 658: "1", 659: "1", 699: "1", 700: "1", 701: "1", 702: "1", 706: "1", 710: "1", 714: "1", 713: "1", 709: "1", 705: "1", 712: "1", 708: "1", 704: "1", 711: "1", 707: "1", 703: "1", 715: "1", 716: "1", 717: "1", 720: "1", 719: "1", 721: "1", 718: "1", 722: "1", 723: "1", 724: "2", 725: "1", 726: "1", 738: "1", 737: "1", 740: "1", 747: "1", 746: "1", 744: "1", 743: "1", 739: "2", 745: "1", 741: "1", 742: "1", 727: "1", 729: "1", 731: "1", 730: "2", 728: "2", 734: "2", 736: "1", 735: "1", 732: "1", 733: "1", 748: "1", 749: "1", 750: "1", 751: "1", 752: "1", 753: "1", 754: "1", 755: "1", 756: "1", 757: "1", 758: "2", 759: "2", 760: "2", 762: "1", 784: "1", 773: "1", 761: "1", 772: "1", 783: "1", 794: "1", 763: "1", 764: "1", 765: "1", 766: "1", 774: "1", 775: "1", 776: "1", 777: "1", 785: "1", 786: "1", 787: "1", 788: "1", 795: "1", 796: "1", 797: "1", 798: "1", 767: "1", 768: "1", 778: "1", 779: "1", 789: "1", 790: "1", 799: "1", 800: "1", 769: "1", 770: "1", 771: "1", 780: "1", 781: "1", 782: "1", 791: "1", 792: "1", 793: "1", 801: "1", 802: "1", 803: "1", 807: "1", 806: "1", 809: "1", 815: "1", 814: "1", 813: "1", 808: "1", 810: "1", 812: "1", 811: "1", 818: "1", 819: "2", 820: "2", 821: "2", 822: "1", 823: "1", 817: "1", 824: "2", 825: "1", 826: "1", 827: "1", 828: "1", 829: "1", 830: "1", 831: "1", 833: "1", 832: "1", 835: "1", 834: "1", 836: "1", 837: "1", 838: "1", 840: "1", 839: "1", 841: "1", 847: "2", 848: "2", 843: "1", 842: "1", 845: "1", 844: "2", 846: "1", 849: "1", 850: "1", 854: "1", 858: "1", 857: "1", 856: "1", 860: "1", 859: "1", 861: "1", 852: "1", 851: "1", 853: "1", 855: "1", 862: "2", 863: "1", 864: "2", 865: "2", 866: "3", 867: "2", 868: "5", 869: "1", 870: "1", 875: "1", 876: "1", 873: "3", 874: "2", 871: "1", 872: "1", 922: "1", 923: "1", 925: "2", 924: "1", 926: "1", 927: "1", 928: "1", 929: "1", 930: "1", 931: "1", 933: "1", 934: "1", 935: "1", 932: "1", 937: "1", 936: "1", 938: "1", 902: "1", 903: "1", 904: "1", 906: "1", 907: "1", 908: "1", 909: "1", 910: "1", 911: "1", 905: "1", 893: "1", 894: "1", 895: "1", 896: "1", 900: "1", 899: "1", 898: "1", 897: "1", 901: "1", 877: "1", 878: "1", 879: "1", 881: "1", 882: "1", 883: "1", 885: "1", 889: "1", 886: "1", 890: "1", 891: "1", 887: "1", 892: "1", 888: "1", 884: "1", 880: "2", 969: "1", 970: "1", 971: "1", 972: "1", 968: "1", 967: "1", 966: "1", 965: "1", 939: "1", 940: "1", 941: "1", 943: "1", 947: "1", 945: "1", 946: "1", 942: "1", 944: "1", 948: "1", 949: "1", 950: "1", 951: "1", 952: "1", 953: "1", 954: "1", 955: "1", 956: "1", 957: "1", 958: "1", 959: "1", 960: "1", 961: "1", 962: "1", 963: "1", 964: "1", 912: "1", 913: "1", 914: "1", 915: "1", 919: "1", 918: "1", 916: "1", 917: "1", 921: "1", 920: "1", 973: "1", 974: "1", 975: "1", 976: "1", 977: "1", 978: "1", 979: "1", 980: "1", 981: "1", 982: "1", 983: "1", 984: "1", 985: "1", 986: "1", 987: "1", 988: "1", 990: "1", 989: "1", 991: "1", 992: "1", 993: "1", 994: "1", 995: "1", 996: "1", 997: "1", 1001: "1", 1002: "1", 1003: "1", 1004: "1", 1005: "1", 1006: "1", 1007: "1", 1009: "1", 1013: "1", 1012: "1", 1011: "1", 1010: "1", 998: "1", 999: "1", 1000: "1", 1016: "1", 1015: "1", 1014: "1", 1008: "1", 1017: "1", 1022: "1", 1018: "1", 1019: "1", 1020: "1", 1023: "1", 1024: "1", 1025: "1", 1026: "1", 1030: "1", 1034: "1", 1038: "1", 1037: "1", 1033: "1", 1029: "1", 1028: "1", 1032: "1", 1036: "1", 1027: "1", 1031: "1", 1035: "1", 1039: "1", 1040: "1", 1041: "1", 1044: "1", 1045: "1", 1046: "1", 1042: "1", 1050: "1", 1054: "1", 1053: "1", 1049: "1", 1043: "1", 1047: "1", 1051: "1", 1052: "1", 1048: "1", 1055: "1", 1057: "2", 1056: "1", 1059: "1", 1060: "1", 1061: "1", 1065: "1", 1064: "1", 1063: "1", 1067: "1", 1068: "1", 1069: "1", 1058: "1", 1062: "1", 1070: "1", 1066: "1", 1071: "1", 1072: "1", 1073: "1", 1077: "1", 1076: "1", 1075: "1", 1079: "1", 1080: "1", 1081: "1", 1085: "1", 1084: "1", 1083: "1", 1074: "1", 1078: "1", 1082: "1", 1086: "1", 1087: "1", 1088: "1", 1090: "1", 1089: "1", 1095: "1", 1091: "4", 1092: "3", 1093: "4", 1094: "3", 1096: "1", 1098: "1", 1097: "1", 1099: "1", 1100: "1", 1101: "1", 1102: "1", 1103: "1", 1104: "1", 1105: "1", 1106: "1", 1107: "1", 1108: "1", 1109: "1", 1110: "1", 1111: "1", 1112: "1", 1113: "1", 1114: "1", 1115: "1", 1116: "1", 1117: "1", 1118: "1", 1119: "1", 1121: "1", 1122: "1", 1123: "1", 1124: "1", 1125: "1", 1126: "1", 1127: "1", 1128: "1", 1129: "1", 1130: "1", 1131: "1", 1132: "1", 1120: "1", 1133: "1", 1134: "1", 1135: "1", 1136: "1", 1137: "1", 1138: "1", 1139: "1", 1140: "1", 1141: "1", 1142: "1", 1143: "1", 1144: "1", 1145: "1", 1146: "2", 1147: "1", 1151: "1", 1150: "1", 1149: "1", 1148: "1", 1152: "1", 1153: "1", 1154: "1", 1155: "1", 1156: "1", 1157: "1", 1158: "1", 1159: "1", 1163: "1", 1162: "1", 1161: "1", 1160: "1", 1164: "1", 1165: "1", 1166: "1", 1167: "1", };var opt_list = [2,51,52,62,63,64,66,67,68,69,72,71,70,73,78,76,77,79,80,81,82,83,84,87,86,85,88,89,90,91,92,93,94,95,96,97,98,99,100,104,103,102,101,105,107,106,108,114,115,116,122,121,120,118,117,119,123,125,126,127,128,129,130,131,132,133,134,135,136,137,138,141,140,139,142,144,143,145,146,147,148,153,155,156,157,158,159,151,150,149,152,160,161,162,164,163,166,165,167,168,169,170,171,172,173,174,175,176,177]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '482'; var gwpurl = 'https://gwp.brweb.pl/i/482/'; var imgLimit = '16'; 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','вибрати']; function showPrev(e) { if (window.innerWidth < 700) return null; var id = e.id; var aId = id.split('__'); var aSO = aId[0].split('_'); var soptid = aSO[1]; var pid = soptid; var prev_div = document.getElementById('gwp_div_preview_'+pid); prev_div.style.display = 'block'; prev_div.innerHTML = ''; setTimeout(movePrev,10,pid); } function hidePrev(e) { if (window.innerWidth < 700) return null; var id = e.id; var aId = id.split('__'); var aSO = aId[0].split('_'); var soptid = aSO[1]; var pid = soptid; var prev_div = document.getElementById('gwp_div_preview_'+pid); prev_div.style.display = 'none'; prev_div.innerHTML = ''; prev_div.style.top = '0px'; } function movePrev(pid) { var prev_div = document.getElementById('gwp_div_preview_'+pid); var imgH = prev_div.getElementsByTagName('IMG')[0]; if (!imgH) { setTimeout(movePrev,10,pid); return false; } const recti = imgH.getBoundingClientRect(); if (recti.height == 0) { setTimeout(movePrev,10,pid); return false; } var hcorr = (recti.top + recti.height - window.innerHeight + 20) * -1; hcorr = (hcorr < 0 ? hcorr : 0); if (recti.top < 20) { hcorr = (recti.top + hcorr - 20) * -1; } if (recti.top > 20 && recti.height + 40 > window.innerHeight) { hcorr = (recti.top - 20) * -1; } prev_div.style.top = hcorr + 'px'; } function showPrevMobile(e) { var id = e.id; var aId = id.split('__'); var aSO = aId[0].split('_'); var soptid = aSO[1]; var prev_id = 'gwp_div_preview_'+soptid; var prev_div = document.getElementById(prev_id); if (prevMopen != '' && prevMopen != prev_div) document.getElementById(prevMopen).style.display = 'none'; prev_div.style.display = 'block'; prev_div.innerHTML = '
'; prev_div.style.position = 'absolute'; prev_div.style.left = '0px'; prev_div.style.bottom = '20px'; prev_div.style.margin = '0px 10px'; prev_div.style.width = 'calc(100% - 20px)'; prevMopen = prev_id; } function hidePrevMobile(e) { var id = e.id; var aId = id.split('__'); var aSO = aId[0].split('_'); var soptid = aSO[1]; var prev_id = 'gwp_div_preview_'+soptid; var prev_div = document.getElementById(prev_id); prev_div.style.display = 'none'; prev_div.innerHTML = ''; } function hideDiv() { document.getElementById(prevMopen).style.display = 'none'; } function oClick(e,type) { if (type == 'S') { selectClick(e); } else { radioClick(e); } setTimeout(showGWP,500); } function selectClick(e) { var id = e.id; var aId = id.split('__'); if (document.getElementById(aId[0]).value != aId[1] || document.getElementById(aId[0]).length == 1) { if (window.innerWidth < 700) showPrevMobile(e); document.getElementById(aId[0]).value = aId[1]; if (document.getElementById('gwp_div_title_'+aId[0].replace('option_',''))) document.getElementById('gwp_div_title_'+aId[0].replace('option_','')).innerHTML = e.title; } else { if (window.innerWidth < 700) hidePrevMobile(e); document.getElementById(aId[0]).selectedIndex = '0'; if (document.getElementById('gwp_div_title_'+aId[0].replace('option_',''))) document.getElementById('gwp_div_title_'+aId[0].replace('option_','')).innerHTML = ''; id = aId[0] + '__' + document.getElementById(aId[0]).value; } document.getElementById(aId[0]).dispatchEvent(new Event('change')); 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'; } } optTmpVal[aId[0].replace('option_','')] = document.getElementById(aId[0]).value; } function radioClick(e) { var id = e.id; if (window.innerWidth < 700) showPrevMobile(e); var aId = id.split('__'); document.getElementById(aId[0]+'_'+aId[1]).click(); if (document.getElementById('gwp_div_title_'+aId[0].replace('option_',''))) document.getElementById('gwp_div_title_'+aId[0].replace('option_','')).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 sr = document.getElementsByName('option_'+opt_id); if (sr.length == 0) { return; } var optValue = ''; if (sr[0].id == sr[0].name ) { var optType = 'S'; var s = sr[0]; var c = s.getElementsByTagName('option'); var optValue = s.value; } else { var optType = 'R'; var s = sr[0].parentElement.parentElement; var c = sr; for( var j = 0; j < c.length; j++){ if (c[j].checked == true) { optValue = c[j].innerHTML; } } } isDiff = (!optTmp[opt_id] || optTmp[opt_id] != s.innerHTML || optTmpVal[opt_id] != s.value) ? 1 : 0; var eStock = (optType == 'S') ? s.parentElement.className : sr[0].parentElement.className; if (eStock.indexOf('option_truestock ') != -1 && eStock.indexOf('loading') != -1) { isLoading++; } if (isDiff == 1 || changeStock == 1) { if (optType == 'R') { s.style.visibility = 'hidden'; s.style.width = '0px'; s.style.height = '0px'; s.style.position = 'absolute'; s.style.bottom = '0px'; } else { s.style.display = 'none'; } var sOptions = '', sPreview = '', sTitle = ''; var imgNo = 0; var optCnt = (optType == 'S') ? c.length - 1 : c.length; if (optType == 'R') { for( var j = 0; j < c.length; j++){ if (c[j].parentElement.className == 'radio-wrap none') { optCnt--; } } var rlabels = s.getElementsByTagName('label'); var rDict = new Array(); for( var rli = 0; rli < rlabels.length; rli++){ if (rlabels[1].innerHTML != '' || !rlabels[rli]) rDict[rlabels[rli].getAttribute('for')] = rlabels[rli].innerHTML; } } 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') { imgNo++; var smIsSelect = ((optType == 'S' && (s.options[s.selectedIndex].value == c[j].value || s.value == 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 = (optType == 'S') ? c[j].innerHTML : rDict[c[j].id]; oId = (optType == 'S') ? s.id : c[j].name; if (smItenSelect == ' gwp-opt-sel') { smTitle = oName; } sOptions += '