gwpNo = {1140: "0", 1141: "0", 1142: "0", 72: "0", 73: "0", 74: "0", 75: "0", 76: "0", 77: "0", 78: "0", 79: "0", 80: "0", 81: "0", 82: "0", 83: "0", 84: "0", 122: "0", 242: "0", 767: "0", 802: "0", 820: "0", 941: "0", 1080: "0", 1081: "0", 1082: "0", 1083: "0", 1084: "0", 1085: "0", 1086: "0", 1087: "0", 1088: "0", 1089: "0", 1090: "0", 1091: "0", 1092: "0", 1093: "0", 1094: "0", 1095: "0", 1096: "0", 1097: "0", 1098: "0", 639: "0", 640: "0", 641: "0", 642: "0", 643: "0", 644: "0", 645: "0", 646: "0", 647: "0", 648: "0", 649: "0", 650: "0", 651: "0", 652: "0", 653: "0", 772: "0", 773: "0", 821: "0", 956: "0", 109: "0", 110: "0", 111: "0", 112: "0", 113: "0", 114: "0", 115: "0", 116: "0", 117: "0", 118: "0", 119: "0", 120: "0", 121: "0", 943: "0", 944: "0", 945: "0", 947: "0", 948: "0", 468: "0", 469: "0", 470: "0", 471: "0", 472: "0", 473: "0", 474: "0", 477: "0", 478: "0", 479: "0", 480: "0", 481: "0", 482: "0", 483: "0", 870: "0", 871: "0", 893: "0", 476: "0", 499: "0", 500: "0", 501: "0", 502: "0", 503: "0", 504: "0", 505: "0", 506: "0", 507: "0", 508: "0", 509: "0", 510: "0", 511: "0", 512: "0", 513: "0", 514: "0", 816: "0", 817: "0", 515: "0", 516: "0", 517: "0", 518: "0", 519: "0", 520: "0", 521: "0", 522: "0", 523: "0", 524: "0", 525: "0", 526: "0", 527: "0", 528: "0", 529: "0", 530: "0", 818: "0", 819: "0", 547: "0", 548: "0", 549: "0", 550: "0", 551: "0", 552: "0", 553: "0", 554: "0", 555: "0", 556: "0", 557: "0", 558: "0", 559: "0", 862: "0", 863: "0", 864: "0", 949: "0", 566: "0", 567: "0", 568: "0", 569: "0", 570: "0", 571: "0", 572: "0", 573: "0", 574: "0", 575: "0", 576: "0", 577: "0", 578: "0", 579: "0", 759: "0", 813: "0", 872: "0", 617: "0", 618: "0", 619: "0", 620: "0", 621: "0", 622: "0", 623: "0", 624: "0", 625: "0", 626: "0", 627: "0", 628: "0", 629: "0", 630: "0", 631: "0", 632: "0", 952: "0", 953: "0", 955: "0", 691: "0", 692: "0", 693: "0", 694: "0", 695: "0", 696: "0", 697: "0", 698: "0", 699: "0", 700: "0", 702: "0", 703: "0", 704: "0", 705: "0", 706: "0", 814: "0", 815: "0", 958: "0", 894: "0", 895: "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", 876: "0", 877: "0", 878: "0", 879: "0", 880: "0", 881: "0", 882: "0", 883: "0", 884: "0", 885: "0", 886: "0", 887: "0", 888: "0", 889: "0", 890: "0", 891: "0", 892: "0", 921: "0", 922: "0", 923: "0", 924: "0", 925: "0", 926: "0", 927: "0", 928: "0", 929: "0", 930: "0", 931: "0", 932: "0", 933: "0", 934: "0", 935: "0", 936: "0", 937: "0", 961: "0", 962: "0", 963: "0", 964: "0", 965: "0", 966: "0", 967: "0", 968: "0", 969: "0", 970: "0", 971: "0", 972: "0", 973: "0", 974: "0", 975: "0", 976: "0", 977: "0", 978: "0", 979: "0", 984: "0", 985: "0", 986: "0", 987: "0", 988: "0", 989: "0", 990: "0", 991: "0", 992: "0", 993: "0", 994: "0", 995: "0", 996: "0", 997: "0", 998: "0", 999: "0", 1000: "0", 1001: "0", 1002: "0", 1019: "0", 1020: "0", 1021: "0", 1022: "0", 1023: "0", 1024: "0", 1025: "0", 1026: "0", 1027: "0", 1028: "0", 1029: "0", 1030: "0", 1031: "0", 1032: "0", 1033: "0", 1034: "0", 1035: "0", 1036: "0", 1037: "0", 1057: "0", 1058: "0", 1059: "0", 1060: "0", 1061: "0", 1062: "0", 1063: "0", 1064: "0", 1065: "0", 1066: "0", 1067: "0", 1068: "0", 1069: "0", 1070: "0", 1071: "0", 1072: "0", 1073: "0", 1074: "0", 1075: "0", 1106: "0", 1107: "0", 1108: "0", 1109: "0", 1110: "0", 1111: "0", 1112: "0", 1113: "0", 1114: "0", 1115: "0", 1116: "0", 1117: "0", 1118: "0", 1119: "0", 1120: "0", 1121: "0", 1122: "0", 1123: "0", 1124: "0", 1143: "0", 1144: "0", 1145: "0", 1146: "0", 1147: "0", 1148: "0", 1149: "0", 1150: "0", 1151: "0", 1152: "0", 1153: "0", 1154: "0", 1155: "0", 1156: "0", 1157: "0", 1158: "0", 1159: "0", 1160: "0", 1161: "0", 942: "0", 946: "0", 981: "0", 950: "0", 951: "0", 954: "0", 957: "0", 959: "0", 960: "0", 982: "0", 983: "0", 1003: "0", 1076: "0", 1099: "0", 1125: "0", 1185: "0", 1186: "0", 1187: "0", 1188: "0", 1189: "0", 1190: "0", 1191: "0", 1192: "0", 1193: "0", 1194: "0", 1195: "0", 1196: "0", 1197: "0", 1198: "0", 1199: "0", 1200: "0", 1201: "0", 1202: "0", 1216: "0", 1217: "0", 1218: "0", 1219: "0", 1220: "0", 1221: "0", 1222: "0", 1223: "0", 1224: "0", 1225: "0", 1226: "0", 1227: "0", 1228: "0", 1229: "0", 1230: "0", 1231: "0", 1232: "0", 1233: "0", 1256: "0", 1257: "0", 1258: "0", 1259: "0", 1260: "0", 1267: "0", 1261: "0", 1262: "0", 1263: "0", 1264: "0", 1265: "0", 1266: "0", 1162: "0", };var opt_list = [209,27,203,126,29,100,105,106,116,119,121,139,147,180,187,191,192,197,202,206,227]; var more_txt = [], less_txt = [], optTmp = [], isStock = 0; var sid = '11'; var url = 'https://gwp.brweb.pl/i/11/'; var selcolor = '#0D0A0A'; var imgLimit = '5'; var moreLabel = '+'; var lessLabel = '-'; var showMLcnt = 1; var prevMopen = ''; function showPrev(e) { if (window.innerWidth < 700) return null; var id = e.id; var aId = id.split('__'); var prev_div = document.getElementById('gwp_div_preview_'+aId[0].replace('option_','')); prev_div.style.display = 'block'; prev_div.innerHTML = ''; } function hidePrev(e) { if (window.innerWidth < 700) return null; var id = e.id; var aId = id.split('__'); var prev_div = document.getElementById('gwp_div_preview_'+aId[0].replace('option_','')); prev_div.style.display = 'none'; prev_div.innerHTML = ''; } 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 += '
'; 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') { 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 += '
'; 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();