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(9, 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 #000000 !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:-305px; width:300px; 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-title { font-weight:bold; padding: 0px 20px; display: inline-block; }'; document.head.appendChild(gwpstyle); } gwpNo = {175: "1", 176: "1", 177: "1", 502: "1", 444: "1", 617: "1", 459: "3", 460: "3", 461: "3", 462: "3", 470: "1", 471: "1", 472: "1", 483: "1", 603: "1", 624: "1", 442: "3", 616: "3", 671: "3", 318: "3", 319: "3", 320: "3", 505: "3", 504: "3", 463: "3", 592: "2", 618: "2", 458: "2", 336: "5", 337: "3", 338: "2", 339: "2", 340: "2", 341: "4", 342: "2", 343: "3", 344: "4", 345: "2", 346: "2", 347: "2", 348: "2", 349: "2", 350: "2", 351: "2", 352: "3", 353: "2", 354: "2", 355: "2", 356: "2", 357: "3", 358: "2", 359: "2", 360: "2", 361: "2", 362: "2", 363: "2", 364: "2", 365: "2", 366: "2", 367: "1", 368: "2", 369: "2", 370: "2", 371: "2", 372: "2", 373: "3", 374: "3", 375: "2", 546: "2", 547: "2", 760: "2", 761: "2", 792: "2", 376: "2", 377: "2", 378: "2", 379: "2", 380: "2", 381: "3", 382: "2", 383: "2", 384: "2", 385: "2", 386: "2", 387: "2", 388: "2", 389: "2", 390: "2", 391: "2", 392: "3", 393: "2", 394: "2", 395: "2", 396: "2", 397: "2", 398: "2", 399: "2", 400: "2", 401: "2", 402: "2", 403: "2", 404: "2", 405: "2", 406: "2", 407: "2", 408: "2", 409: "2", 410: "2", 411: "2", 412: "2", 413: "3", 414: "3", 415: "2", 548: "3", 549: "2", 762: "2", 763: "2", 793: "2", 794: "2", 795: "2", 796: "2", 797: "2", 798: "2", 799: "3", 800: "2", 801: "2", 802: "2", 803: "2", 804: "2", 806: "2", 805: "2", 807: "2", 808: "2", 809: "2", 810: "2", 811: "3", 812: "2", 813: "2", 814: "2", 815: "2", 816: "2", 817: "2", 818: "2", 819: "2", 820: "2", 821: "2", 822: "2", 823: "2", 824: "2", 825: "2", 826: "2", 827: "2", 828: "2", 829: "2", 830: "2", 831: "2", 832: "3", 833: "3", 834: "2", 835: "2", 836: "2", 837: "2", 838: "2", 839: "2", 840: "2", 841: "2", 842: "3", 843: "2", 844: "2", 846: "2", 845: "2", 847: "2", 848: "2", 850: "2", 852: "2", 851: "2", 854: "3", 855: "2", 853: "2", 856: "2", 857: "2", 859: "2", 860: "2", 861: "2", 862: "2", 863: "2", 864: "2", 865: "2", 866: "2", 867: "2", 868: "2", 869: "2", 870: "2", 871: "2", 872: "2", 873: "2", 874: "2", 875: "3", 876: "3", 877: "2", 878: "2", 879: "2", 607: "1", 608: "1", 920: "1", 921: "1", 922: "1", 923: "1", 925: "2", 926: "1", 927: "1", 928: "1", 929: "2", 924: "1", 930: "1", 931: "1", 902: "1", 903: "1", 904: "1", 905: "1", 770: "1", 771: "1", 772: "1", 773: "1", 725: "1", 726: "1", 727: "1", 728: "1", 729: "1", 730: "3", 731: "1", 732: "1", 733: "1", 734: "1", 735: "1", 736: "1", 737: "1", 738: "1", 739: "1", 740: "1", 741: "1", 742: "2", 743: "1", 744: "1", 745: "1", 746: "1", 747: "1", 748: "1", 749: "1", 750: "1", 751: "1", 752: "1", 753: "1", 754: "1", 755: "1", 756: "1", 757: "1", 758: "2", 759: "1", 464: "1", 465: "1", 466: "1", 593: "1", 764: "1", 765: "1", 766: "1", 767: "1", 932: "1", 933: "1", 934: "1", 935: "1", 936: "1", 937: "1", 938: "1", 939: "1", 940: "1", 941: "1", 942: "1", 943: "1", 944: "2", 945: "1", 946: "1", 947: "1", 948: "1", 949: "1", 950: "1", 951: "1", 952: "1", 953: "1", 954: "2", 955: "1", 956: "1", 957: "1", 958: "1", 959: "1", 960: "1", 961: "1", 962: "1", 963: "1", 964: "1", 965: "1", 966: "2", 967: "1", 968: "1", 969: "1", 970: "1", 971: "1", 972: "1", 973: "1", 974: "1", 975: "1", 976: "1", 977: "1", 978: "1", 979: "1", 980: "1", 981: "1", 982: "2", 983: "1", 984: "1", 985: "1", 986: "1", 987: "1", 988: "1", 849: "1", 858: "1", 455: "2", 456: "2", 635: "2", 636: "2", 637: "1", 638: "1", 639: "2", 640: "1", 641: "1", 642: "1", 643: "1", 644: "1", 645: "1", 646: "2", 647: "1", 648: "1", 991: "1", 992: "1", 993: "1", 994: "1", 995: "1", 996: "2", 649: "1", 997: "1", 998: "1", 999: "1", 672: "1", 673: "1", 674: "1", 675: "1", 676: "1", 911: "1", 912: "1", 913: "1", 914: "1", 915: "1", 916: "1", 917: "1", 918: "2", 919: "1", 1001: "1", 1002: "1", 1003: "1", 1004: "1", 1005: "1", 1006: "1", 1007: "2", 1008: "1", 1009: "1", 1011: "1", 1010: "1", 989: "1", 990: "1", 1012: "1", 1014: "1", 1015: "1", 1016: "1", 1017: "1", 1018: "1", 1019: "1", 1020: "1", 1021: "1", 1022: "1", 1023: "1", 1024: "1", 1025: "1", 1026: "1", 1027: "1", 1028: "1", 1029: "1", 1158: "1", 1013: "2", 1095: "1", 1096: "1", 1097: "1", 1098: "1", 1099: "1", 1163: "1", 1164: "1", 1165: "1", 1166: "1", 1091: "1", 1092: "1", 1093: "1", 1094: "1", 1159: "1", 1160: "1", 1161: "1", 1162: "1", 1114: "1", 1115: "1", 1116: "1", 1117: "1", 1118: "1", 1119: "2", 1120: "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", 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: "1", 1147: "1", 1148: "1", 1149: "1", 1150: "1", 1151: "1", 1152: "1", 1153: "1", 1043: "2", 1044: "1", 1045: "1", 1046: "1", 1047: "1", 1048: "2", 1049: "1", 1050: "1", 1051: "1", 1052: "1", 1053: "1", 1054: "1", 1055: "1", 1056: "1", 1057: "1", 1058: "1", 1059: "1", 1060: "1", 1061: "1", 1062: "1", 1063: "1", 1064: "1", 1065: "1", 1066: "2", 1067: "1", 1068: "1", 1069: "1", 1070: "1", 1071: "1", 1072: "1", 1073: "1", 1074: "1", 1075: "1", 1076: "1", 1077: "1", 1078: "1", 1079: "1", 1080: "1", 1081: "1", 1082: "1", 1037: "1", 1038: "1", 1039: "1", 1171: "1", 1167: "1", 1168: "1", 1169: "1", 1170: "1", 1083: "1", 1084: "1", 1085: "1", 1086: "1", 1183: "1", 1184: "1", 1107: "1", 1108: "1", 1109: "1", 1186: "1", 1185: "1", 1187: "2", 1188: "2", 604: "1", 625: "1", 1172: "3", 1192: "1", 1193: "1", 1195: "1", 1196: "1", 1197: "1", 1198: "1", 1200: "1", 1199: "1", 1201: "2", 1202: "2", 1212: "1", 1206: "2", 1207: "2", 1226: "1", 1227: "1", 1229: "1", 1230: "1", 1228: "1", 1231: "1", 1232: "1", 1233: "1", 1234: "1", 1235: "1", 1214: "1", 1215: "1", 1216: "2", 1217: "1", 1218: "1", 1219: "1", 1220: "1", 1221: "1", 1222: "1", 1223: "1", 1224: "1", 1225: "1", 1236: "1", 1237: "2", 1238: "2", 1239: "3", 1242: "1", 1243: "1", 1244: "1", 1240: "1", 1241: "1", 1245: "1", 1246: "1", 1247: "", 1248: "1", 1254: "1", 1253: "1", 1255: "1", 1256: "1", 1258: "1", 1257: "1", 1259: "1", 1260: "1", 1261: "1", 1262: "1", 1264: "1", 1263: "1", 1265: "1", 1267: "1", 1268: "1", 1272: "1", 1273: "1", 1274: "1", 1270: "2", 1269: "1", 1271: "1", 1266: "1", 1279: "1", 1280: "1", 1281: "1", 1282: "1", 1283: "1", 1285: "2", 1286: "2", 1287: "2", 1288: "2", 1289: "2", 1290: "2", 1291: "1", 1299: "1", 1300: "3", 1301: "1", 1302: "1", 1303: "1", 1297: "1", 1298: "1", 1294: "1", 1295: "1", 1292: "1", 1293: "1", 1304: "1", 1305: "1", 1306: "2", 1296: "1", 1307: "1", 1308: "1", 1309: "1", 1310: "1", 1311: "1", 1312: "1", 1313: "1", 1314: "1", 1315: "1", 1316: "1", 1317: "1", 1318: "1", 1319: "1", 1320: "1", 1321: "1", 1322: "1", 1323: "1", 1324: "1", 1325: "1", 1326: "1", 1327: "1", 1328: "1", 1329: "1", 1330: "1", 1331: "1", 1332: "1", 1333: "1", 1334: "1", 1335: "1", 1336: "1", 1337: "1", 1338: "1", 1339: "1", 1340: "1", 1341: "1", 1342: "1", 1343: "1", 1344: "1", 1345: "1", 1346: "1", 1347: "1", 1348: "1", 1349: "1", 1350: "1", 1351: "1", 1352: "1", 1353: "1", 1354: "1", 1355: "1", 1356: "1", 1357: "1", 1358: "1", 1359: "1", 1360: "1", 1361: "1", 1362: "1", 1363: "1", 1364: "1", 1365: "1", 1366: "1", 1367: "1", 1368: "1", 1370: "1", 1369: "1", 1378: "1", 1382: "1", 1383: "1", 1409: "1", 1408: "1", 1407: "1", 1406: "1", 1405: "1", 1402: "1", 1403: "1", 1404: "1", 1401: "1", 1398: "1", 1400: "1", 1399: "1", 1397: "1", 1396: "1", 1395: "1", 1394: "1", 1393: "1", 1392: "1", 1384: "1", 1385: "1", 1386: "1", 1387: "1", 1388: "1", 1389: "1", 1390: "1", 1391: "1", 1414: "1", 1415: "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", 1468: "2", 1469: "1", 1470: "1", 1471: "1", 1472: "1", 1473: "1", 1474: "2", 1475: "1", 1476: "1", 1477: "1", 1478: "1", 1479: "1", 1480: "1", 1482: "1", 1483: "1", 1484: "1", 1485: "1", 1481: "1", 1494: "1", 1495: "1", 1496: "1", 1497: "1", 1498: "1", 1499: "1", 1500: "1", 1501: "1", 1502: "1", 1512: "1", 1513: "1", 1514: "1", 1515: "1", 1516: "1", 1517: "1", 1518: "1", 1527: "1", 1528: "1", 1529: "1", 1530: "1", 1531: "1", 1532: "1", 1533: "1", 1534: "1", 1535: "1", 1536: "1", 1537: "1", 1538: "1", 1539: "1", 1540: "1", 1541: "1", 1542: "2", 1543: "1", 1544: "1", 1545: "1", 1546: "2", 1547: "1", 1548: "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", 1564: "1", 1565: "1", 1566: "2", 1567: "1", 1568: "1", 1597: "1", 1600: "2", 1601: "2", 1602: "2", 1603: "2", 1604: "2", 1605: "2", 1606: "2", 1607: "2", 1610: "1", 1611: "1", 1612: "1", 1613: "1", 1614: "1", 1620: "1", 1615: "1", 1621: "1", 1618: "1", 1617: "1", 1491: "2", 1489: "3", 1490: "2", 1486: "1", 1487: "1", 1488: "1", 1642: "1", 1643: "1", 1644: "1", 1645: "1", 1646: "1", 1647: "1", 1648: "1", 1649: "1", 1650: "1", 1651: "1", 1652: "1", 1653: "1", 1654: "1", 1656: "1", 1655: "1", 1657: "1", 1658: "1", 1659: "1", 1667: "1", 1668: "1", 1669: "1", 1670: "2", 1671: "2", 1660: "1", 1662: "2", 1664: "1", 1665: "1", 1666: "1", 1663: "1", 1661: "1", 1672: "1", 1673: "1", 1674: "1", 1675: "1", 1676: "1", 1677: "1", 1678: "1", 1679: "1", 1680: "1", 1681: "1", 1682: "1", 1683: "1", 1684: "1", 1685: "1", 1686: "1", 1687: "1", 1688: "1", 1689: "1", 1699: "1", 1701: "1", 1700: "1", 1702: "1", 1724: "2", 1725: "2", 1726: "2", 1727: "2", 1608: "1", 1609: "1", 1736: "1", 1738: "1", 1741: "1", 1745: "2", 1746: "2", 1747: "3", 1748: "2", 1749: "2", 1750: "1", 1751: "1", 1754: "1", 1755: "1", 1756: "1", 1753: "1", 1757: "1", 1758: "1", 1759: "1", 1760: "1", 1761: "1", 1762: "1", 1763: "1", 1764: "1", 1765: "1", 1766: "1", 1767: "1", 1768: "1", 1769: "1", };var opt_list = [21,48,55,62,80,81,83,34,37,47,38,88,52,53,115,116,130,118,111,109,107,56,131,132,91,135,133,136,137,138,149,148,152,156,141,142,166,168,170,176,177,175,181,182,186,187,202,203,210,218,219,212,232,233,249,254]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '388'; var gwpurl = 'https://gwp.brweb.pl/i/388/'; var imgLimit = '30'; var moreLabel = 'pokaż więcej '; var lessLabel = 'pokaż mniej '; var showMLcnt = 0; 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 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 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]; 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 == 388 || sid == 497) { s = srl[0].parentElement.parentElement.parentElement.parentElement.parentElement; smain = srl[0].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.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.innerHTML || optTmpVal[opt_id] != s.value) ? 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') { 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 = (optType == 'S') ? c[j].innerText.trim() : c[j].dataset.userValue; oId = (optType == 'S') ? s.name : c[j].name; if (smItenSelect == ' gwp-opt-sel') { smTitle = oName; } sOptions += '
' + oName + '
'; } } if (optCnt > imgLimit) { sOptions += '
' + more_txt[opt_id] + '
'; } sPreview = '
'; sTitle = smTitle != '' ? smTitle : ''; if (document.getElementById('gwp_div_list_'+opt_id)) { document.getElementById('gwp_div_title_'+opt_id).innerHTML = sTitle; document.getElementById('gwp_div_list_'+opt_id).innerHTML = sOptions; } else { const div_title = document.createElement('div'); div_title.id = 'gwp_div_title_'+opt_id; div_title.className = 'gwp-opt-title'; div_title.innerHTML = sTitle; const div_prev = document.createElement('div'); div_prev.id = 'gwp_div_prev_'+opt_id; div_prev.className = 'gwp-opt-prev'; div_prev.innerHTML = sPreview; const div_list = document.createElement('div'); div_list.id = 'gwp_div_list_'+opt_id; div_list.className = 'sm-gwp-img-list'; div_list.innerHTML = sOptions; if (optType == 'S') { var div4title = s.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.getElementsByTagName('LABEL')[0]; } else { var div4title = s.parentElement.parentElement.parentElement.getElementsByTagName('LABEL')[0]; } div4title.appendChild(div_title); s.parentElement.parentElement.parentElement.appendChild(div_prev); s.parentElement.parentElement.parentElement.appendChild(div_list); } optTmp[opt_id] = s.innerHTML; optTmpVal[opt_id] = s.value; } }); changeStock = 0; if (isLoading > 0 || isDiff == 1) { setTimeout(showGWP,100); } } window.onload = function(){ showGWP(); }; showGWP(); setTimeout(showGWP,1000);