gwpNo = {773: "0", 774: "0", 775: "0", 777: "0", 786: "0", 779: "0", 781: "0", 783: "0", 787: "0", 788: "0", 789: "0", 790: "0", 791: "0", 792: "0", 793: "0", 794: "0", 71: "0", 72: "0", 74: "0", 76: "0", 78: "0", 79: "0", 80: "0", 82: "0", 83: "0", 85: "0", 87: "0", 89: "0", 90: "0", 91: "0", 439: "0", 441: "0", 442: "0", 443: "0", 444: "0", 445: "0", 486: "0", 487: "0", 488: "0", 489: "0", 490: "0", 491: "0", 492: "0", 493: "0", 494: "0", 495: "0", 496: "0", 497: "0", 498: "0", 499: "0", 500: "0", 501: "0", 502: "0", 503: "0", 504: "0", 505: "0", 506: "0", 694: "0", 695: "0", 696: "0", 697: "0", 698: "0", 699: "0", 700: "0", 795: "0", 797: "0", 798: "0", 799: "0", 800: "0", 801: "0", 802: "0", 803: "0", 804: "0", 805: "0", 806: "0", 807: "0", 808: "0", 825: "0", 826: "0", 827: "0", 828: "0", 855: "0", 856: "0", 857: "0", 858: "0", 860: "0", 861: "0", 862: "0", 863: "0", 864: "0", 753: "0", 754: "0", 755: "0", 756: "0", 757: "0", 758: "0", 759: "0", 760: "0", 761: "0", 762: "0", 726: "0", 727: "0", 728: "0", 729: "0", 730: "0", 731: "0", 732: "0", 733: "0", 734: "0", 735: "0", 865: "0", 866: "0", 867: "0", 868: "0", 869: "0", 870: "0", 871: "0", 872: "0", 873: "0", 874: "0", 875: "0", 877: "0", 880: "0", 882: "0", 876: "0", 878: "0", 879: "0", 881: "0", 883: "0", 884: "0", 885: "0", 886: "0", 887: "0", 888: "0", 890: "0", 891: "0", 892: "0", 893: "0", 894: "0", 896: "0", 897: "0", 898: "0", 899: "0", 900: "0", 901: "0", 902: "0", 903: "0", 904: "0", 905: "0", 906: "0", 907: "0", 908: "0", 909: "0", 910: "0", 911: "0", 912: "0", 913: "0", 914: "0", 915: "0", 809: "0", 811: "0", 810: "0", 812: "0", 918: "0", 814: "0", 919: "0", 920: "0", 916: "0", 917: "0", 925: "0", 926: "0", 927: "0", 928: "0", 929: "0", 930: "0", 931: "0", 932: "0", 933: "1", 934: "1", 935: "1", 936: "1", 937: "1", 938: "1", 939: "1", 940: "1", 941: "1", 942: "1", 946: "2", 947: "2", 167: "1", 168: "1", 796: "1", 171: "1", 173: "1", 174: "1", 175: "1", 176: "1", 944: "1", 341: "1", 343: "2", 344: "1", 345: "1", 346: "1", 945: "2", 661: "1", 662: "1", 663: "1", 664: "1", 665: "1", 943: "1", 691: "1", 692: "1", 693: "1", 178: "1", 183: "1", 184: "1", 185: "1", 186: "1", 189: "1", 190: "1", 447: "1", 948: "2", 951: "1", 952: "2", 953: "2", 954: "2", 949: "2", 950: "1", 958: "1", 959: "1", 960: "3", 955: "2", 956: "1", 957: "4", 961: "1", 962: "1", 963: "3", 964: "1", 965: "1", 966: "3", 967: "1", 968: "1", 969: "1", 970: "3", 971: "1", 972: "1", 973: "1", 974: "1", 975: "1", 976: "4", 977: "1", 978: "1", 979: "4", 980: "1", 981: "1", 982: "1", 983: "1", 984: "4", 985: "1", 986: "1", 987: "1", 988: "4", 989: "1", 990: "1", 991: "1", 992: "1", 993: "1", 994: "1", 995: "1", 996: "1", 997: "1", 998: "1", 999: "2", 1000: "1", 1004: "1", 1001: "1", 1002: "1", 1003: "1", 1005: "1", 1006: "1", 1007: "1", 1008: "1", 1009: "1", 1010: "1", 1011: "2", 1012: "2", 1013: "2", 1014: "2", 1015: "2", 1016: "4", 1017: "2", 1018: "2", 1019: "4", 1020: "3", 1021: "2", 1022: "2", 1023: "2", 1025: "3", 1024: "4", 1027: "2", 1028: "2", 1029: "2", 1030: "2", 1031: "2", 1032: "2", 1033: "2", 1034: "3", 1035: "3", 1036: "2", 1026: "2", 1049: "2", 1050: "2", 1051: "2", 1052: "2", 1053: "1", 1054: "1", 1055: "1", 1056: "1", 1057: "1", 1058: "1", 1059: "1", 1060: "1", 1061: "1", 1062: "1", 1066: "1", 1063: "1", 1064: "1", 1067: "1", 1065: "1", 1068: "1", 1083: "1", 1084: "1", 1085: "1", 1086: "1", 1087: "1", 1088: "1", 1089: "1", 1090: "1", 1091: "1", 1092: "1", 1093: "1", 1094: "1", 1095: "1", 1096: "1", 1097: "1", 1098: "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", 1072: "1", 1073: "1", 1074: "1", 1075: "1", 1076: "1", 1077: "1", 1078: "1", 1079: "1", 1080: "1", 1081: "1", 1082: "1", 1069: "1", 1070: "1", 1071: "2", 1122: "1", 1123: "1", 1124: "1", 1125: "1", 1126: "1", 1127: "1", 1132: "1", 1133: "3", 1134: "1", 1135: "1", 1136: "1", 1130: "1", 1131: "1", 1137: "1", 1138: "1", 1141: "1", 1142: "1", 1143: "1", 1128: "1", 1129: "1", 1139: "1", 1140: "1", 1144: "1", 1145: "1", 1146: "1", 1147: "1", 1148: "1", 1149: "1", 1150: "1", 1151: "1", 1152: "1", 1153: "1", 1154: "1", 1155: "1", 1156: "1", 1157: "1", 1158: "1", 1159: "1", 1160: "1", 1161: "1", 1162: "1", 1163: "1", 1164: "1", 1165: "1", 1166: "1", 1167: "1", 1168: "1", 1169: "1", 1173: "2", 1170: "1", 1171: "1", 1172: "1", 1174: "1", 1175: "1", 1176: "1", 1177: "1", 1178: "1", 1179: "1", 1180: "1", 1181: "1", 1182: "1", 1183: "1", 1184: "1", 1185: "1", 1186: "1", 1187: "1", 1188: "1", 1189: "1", 1193: "1", 1190: "1", 1191: "1", 1192: "1", 1194: "1", 1195: "1", 1196: "1", 1197: "1", 1198: "1", 1199: "1", 1200: "1", 1201: "1", 1202: "1", 1203: "1", 815: "1", 816: "1", 817: "1", 818: "1", 819: "1", 820: "1", 821: "1", 822: "1", 823: "1", 824: "1", 853: "1", 93: "2", 94: "2", 95: "2", 96: "2", 97: "2", 98: "1", 99: "1", 100: "1", 101: "1", 102: "1", 103: "1", 1204: "1", 1205: "1", 1206: "1", 1207: "1", 1208: "1", 1209: "1", 1210: "1", 1211: "1", 1212: "1", 1213: "1", 1214: "1", 1215: "1", 1216: "1", 1217: "1", 1218: "1", 1219: "1", 1220: "1", 1221: "1", 1222: "1", 1223: "1", 1224: "1", 1225: "1", 1226: "1", 1227: "1", 1228: "1", 1229: "1", 1230: "1", 1231: "1", 1232: "1", 1233: "1", 1234: "1", 1235: "1", 1236: "1", 1237: "1", 1238: "1", 1239: "1", 1240: "1", 1241: "1", 1242: "1", 1243: "1", 1244: "1", 1245: "1", 1246: "1", 1247: "1", 1248: "1", 1249: "1", 1250: "1", 1251: "1", 1252: "1", 1253: "1", 1254: "1", 1255: "1", 1256: "1", 1257: "1", 1258: "1", 1259: "1", 1260: "1", 1261: "1", 1262: "1", 1264: "1", 1263: "1", 348: "1", 349: "1", 350: "1", 351: "1", 352: "1", 353: "1", 354: "1", 355: "1", 356: "1", 357: "1", 358: "1", 1443: "1", 1444: "1", 1445: "1", 1446: "1", 1447: "1", 1448: "1", 1449: "1", 1450: "1", 1451: "1", 1452: "1", 1453: "1", 1454: "1", 1455: "1", 1456: "1", 1457: "1", 1458: "1", 1459: "1", 1460: "1", 1461: "1", 1462: "1", 1463: "1", 1464: "1", 1465: "1", 1466: "1", 1467: "1", 1468: "1", 1469: "1", 1470: "1", 1471: "1", 1472: "1", 1473: "1", 1474: "1", 1475: "1", 1476: "1", 1477: "1", 1478: "3", 1479: "1", 1480: "1", 1481: "1", 1482: "1", 1483: "1", 1484: "1", 1485: "1", 1486: "1", 1487: "1", 1488: "1", 1489: "1", 1490: "1", 1491: "1", 1492: "1", 1493: "1", 1494: "1", 1495: "1", 1496: "1", 1497: "1", 1498: "1", 1499: "1", 1500: "1", 1501: "1", 1502: "1", 1503: "1", 1504: "1", 1505: "1", 1506: "1", 1507: "1", 1508: "1", 1509: "1", 1510: "1", 1511: "1", 1512: "1", 1513: "1", 1514: "1", 1515: "1", 1516: "1", 1517: "1", 1518: "1", 1520: "1", 1519: "1", 1521: "1", 1522: "1", 1523: "1", 1524: "1", 1525: "1", 1526: "1", 1527: "1", 1528: "1", 1529: "1", 1530: "1", 1531: "1", 1532: "1", 1533: "1", 1534: "1", 1535: "1", 1536: "1", 1540: "2", 1541: "2", 1539: "1", 1537: "1", 1538: "1", 1542: "1", 1543: "1", 1544: "1", 1545: "1", 1546: "1", 1548: "1", 1547: "1", 1549: "1", 1550: "1", 1551: "1", 1552: "1", 1553: "1", 1554: "1", 1555: "1", 1556: "1", 1557: "1", 1558: "1", 1559: "1", 1560: "1", 1561: "1", 1562: "1", 1563: "1", 1566: "1", 1565: "1", 1569: "1", 1572: "1", 1574: "1", 1575: "1", 1571: "1", 1568: "1", 1567: "1", 1564: "1", 1573: "1", 1570: "1", 1606: "2", 1609: "1", 1612: "1", 1615: "1", 1618: "1", 1619: "1", 1616: "1", 1613: "1", 1610: "1", 1607: "1", 1608: "1", 1611: "1", 1614: "1", 1617: "1", 1620: "1", 1590: "1", 1587: "1", 1584: "1", 1581: "1", 1578: "1", 1577: "1", 1576: "1", 1579: "1", 1580: "1", 1582: "1", 1583: "1", 1585: "1", 1586: "1", 1588: "1", 1589: "1", 1604: "1", 1603: "1", 1600: "1", 1591: "1", 1592: "1", 1594: "1", 1595: "1", 1597: "1", 1598: "1", 1601: "1", 1593: "1", 1596: "1", 1599: "1", 1602: "1", 1605: "1", 1623: "1", 1626: "1", 1629: "1", 1632: "2", 1630: "1", 1631: "1", 1627: "1", 1628: "1", 1624: "1", 1625: "1", 1621: "1", 1622: "1", 1633: "1", 1634: "1", 1635: "1", 1650: "1", 1647: "1", 1644: "1", 1641: "1", 1638: "1", 1636: "1", 1637: "1", 1639: "1", 1640: "1", 1642: "1", 1643: "1", 1645: "1", 1646: "1", 1648: "1", 1649: "1", 1651: "1", 1652: "1", 1653: "1", 1654: "1", 1655: "1", 1656: "1", 1657: "1", 1658: "3", 1659: "3", 1660: "3", 1661: "4", 1662: "3", 1663: "3", 1664: "3", 1667: "3", 1668: "3", 1669: "3", 1670: "3", 1671: "3", 1672: "3", 1673: "3", 236: "1", 237: "1", 238: "2", 1674: "2", 384: "1", 385: "1", 386: "2", 1675: "2", 1676: "2", 1677: "2", 1678: "2", 1679: "2", 1680: "2", 1665: "2", 1666: "2", 1681: "1", 1682: "1", 1683: "1", 1688: "1", 1689: "1", 1690: "1", 1691: "1", 1692: "1", 1693: "1", 1694: "1", 1695: "1", 1696: "1", 1697: "1", 1698: "1", 1699: "1", 1700: "1", 1701: "1", 1702: "1", 1703: "1", 1704: "1", 1705: "1", 1706: "1", 1707: "1", 1708: "1", 1709: "1", 1712: "1", 1713: "1", 1714: "1", 1715: "1", 1716: "1", 1717: "1", 1718: "1", 1719: "1", 1720: "1", 1721: "1", 1722: "1", 1723: "1", 1724: "1", 1725: "1", 1726: "1", 1727: "1", 1728: "1", 1729: "1", 1730: "1", 1731: "1", 1732: "1", 1733: "1", 1734: "1", 1735: "1", 1736: "1", 1737: "1", 1738: "1", 1739: "1", 1740: "1", 1741: "1", 1762: "1", 1763: "1", 1764: "1", 1753: "1", 1754: "1", 1755: "1", 1759: "1", 1760: "1", 1761: "1", 1756: "1", 1757: "1", 1758: "1", 1765: "1", };var opt_list = [241,15,249,250,16,82,154,155,156,170,254,255,256,259,265,226,266,267,268,273,18,33,257,279,280,283,288,289,290,292,296,297,303,304,31,32,59,167,169,305,306,307,308,314,315,316,317,318,323,324,326,327,61,364,365,366,367,370,380,381,382,43,63,383,386,390,420,443,444]; var more_txt = [], less_txt = [], optTmp = [], isStock = 0; var sid = '137'; var url = 'https://gwp.brweb.pl/i/137/'; var selcolor = '#777777'; var imgLimit = '16'; var moreLabel = '+'; var lessLabel = '-'; var showMLcnt = 1; var prevMopen = ''; 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) { 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 { 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 = ''; } 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.style.border = '1px solid transparent'; if ( c[i].id == id ) c[i].parentElement.style.border = '1px solid ' + selcolor; } } function radioClick(e) { var id = e.id; 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.style.border = '1px solid transparent'; if ( c[i].id == id ) c[i].parentElement.style.border = '1px solid ' + selcolor; } } 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 = type; } document.getElementById('gwp_more'+oid).innerHTML = type == 'block' ? less_txt[oid] : more_txt[oid] ; } function showGWP() { opt_list.forEach(function(opt_id) { var s = document.getElementById('option_'+opt_id); if (s && (!optTmp[opt_id] || optTmp[opt_id] != s.innerHTML)) { s.style.display = 'none'; optTmp[opt_id] = s.innerHTML; var sColors = ''; if (s.parentElement.className.indexOf('option_truestock ') != -1 && isStock == 0) { isStock = 1; const intervalGWP = setInterval(function() { showGWP(); if (s.value == 'wybierz') { var c30 = document.getElementsByClassName('c_option_' + opt_id); for( var i30 = 0; i30 < c30.length; i30++){ if (c30[i30].parentElement.style.border != '1px solid transparent') { selectClick(document.getElementById(c30[i30].id)); } } } }, 500); } sColors += '
'; sColors += '
'; var c = s.getElementsByTagName('option'); var imgNo = 0; var optCnt = c.length - 1; more_txt[opt_id] = moreLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); less_txt[opt_id] = lessLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); for( var j = 0; j< c.length; j++){ if (c[j].value != '' && c[j].value != 'wybierz' && c[j].value != 'choose' && c[j].value != 'wählen' && c[j].value != 'Vybrat' && c[j].value != 'vali' && c[j].value != 'izvēlēties' && c[j].value != 'pasirinkti' && c[j].value != 'választ' && c[j].value != 'vyberte si' && c[j].value != 'вибрати') { imgNo++; sColors += '
imgLimit || (imgNo == imgLimit && imgNo != optCnt)) ? ' class="gwpHidden'+opt_id+' gwp-opt" ' : 'class="gwp-opt"') + '>
'; } } if (optCnt > imgLimit) { sColors += '
' + more_txt[opt_id] + '
'; } sColors += '
'; if (document.getElementById('gwp_div_'+opt_id)) { div = document.getElementById('gwp_div_'+opt_id); div.innerHTML = sColors; s.parentElement.appendChild(div); } else { const div = document.createElement('div'); div.innerHTML = sColors; div.id = 'gwp_div_'+opt_id; div.className = 'gwp-div'; div.style = 'position:relative;'; s.parentElement.appendChild(div); } } var sr = document.getElementsByName('option_'+opt_id); if (sr && sr.length > 0 && (!optTmp[opt_id] || optTmp[opt_id] != s.innerHTML)) { optTmp[opt_id] = sr[0].parentElement.parentElement.innerHTML; var sColors = ''; var imgNo = 0; var optCnt = sr.length; for( var ri = 0; ri < sr.length; ri++){ if (sr[ri].parentElement.className == 'radio-wrap none') { optCnt--; } } more_txt[opt_id] = moreLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); less_txt[opt_id] = lessLabel + (showMLcnt == 1 ? (optCnt - imgLimit + 1) : ''); var rlabels = sr[0].parentElement.parentElement.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; } sColors += '
'; sColors += '
'; for( var ri = 0; ri < sr.length; ri++){ if (sr[ri].parentElement.className != 'radio-wrap none') { imgNo++; sColors += '
imgLimit || (imgNo == imgLimit && imgNo != optCnt)) ? ' class="gwpHidden'+opt_id+' gwp-opt" ' : 'class="gwp-opt"') + '>
'; } } if (optCnt > imgLimit) { sColors += '
' + more_txt[opt_id] + '
'; } sColors += '
'; if (document.getElementById('gwp_div_'+opt_id)) { div = document.getElementById('gwp_div_'+opt_id); div.innerHTML = sColors; s.parentElement.appendChild(div); } else { const div = document.createElement('div'); div.innerHTML = sColors; div.id = 'gwp_div_'+opt_id; div.style = 'position:relative;'; div.className = 'gwp-div'; sr[0].parentElement.parentElement.parentElement.appendChild(div); sr[0].parentElement.parentElement.style.height = '0px'; sr[0].parentElement.parentElement.style.visibility = 'hidden'; } } }); } showGWP();