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:2px 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:2px; } .gwp-opt-sel:hover .gwp-opt-name { padding-top: 0px; } .gwp-opt-sel { border:2px solid #777777 !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:-205px; width:200px; 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 = {2322: "4", 2323: "3", 2324: "3", 2325: "3", 2326: "3", 2327: "2", 2328: "2", 2329: "2", 2330: "1", 2331: "1", 2332: "1", 2335: "1", 2336: "1", 2337: "1", 2338: "1", 2339: "1", 2340: "1", 2345: "1", 2346: "1", 2347: "1", 2348: "1", 2349: "1", 2350: "1", 2351: "1", 2352: "1", 2353: "1", 2354: "1", 2355: "1", 2356: "1", 2357: "1", 2358: "1", 2359: "2", 2360: "1", 2361: "1", 2362: "1", 2363: "2", 2364: "2", 2365: "1", 2367: "1", 2366: "1", 2368: "1", 2369: "1", 2370: "1", 2371: "1", 2372: "1", 2373: "1", 2374: "1", 2375: "1", 2376: "1", 2377: "1", 2378: "1", 2379: "1", 2380: "1", 2381: "1", 2382: "1", 2414: "1", 2415: "1", 2677: "1", 2678: "2", 2679: "1", 2680: "1", 2681: "1", 2682: "1", 2683: "1", 2684: "1", 2685: "2", 2686: "1", 2687: "1", 2688: "1", 2689: "2", 2690: "2", 2691: "2", 2692: "2", 2693: "2", 2694: "2", 2695: "2", 2696: "2", 2697: "2", 2698: "2", 2699: "1", 2699: "1", 2700: "1", 2701: "1", 2702: "1", 2703: "1", 2704: "1", 2705: "1", 2706: "1", 2709: "1", 2710: "1", 2711: "1", 2712: "1", 2713: "1", 2714: "1", 2715: "1", 2716: "1", 2717: "1", 2718: "1", 2721: "1", 2722: "1", 2725: "1", 2726: "1", 2727: "1", 2728: "1", 2729: "1", 2730: "1", 2731: "1", 2732: "1", 2733: "1", 2734: "1", 2735: "1", 2736: "1", 2737: "1", 2738: "1", 2739: "1", 2740: "1", 2741: "1", 2742: "1", 2743: "1", 1290: "2", 1291: "2", 1292: "2", 1293: "2", 1294: "1", 1295: "1", 1296: "1", 1297: "1", 1382: "1", 1383: "1", 1384: "1", 1385: "1", 1386: "1", 1387: "1", 1388: "1", 1389: "1", 1474: "1", 1475: "1", 1476: "1", 1477: "1", 1478: "1", 1479: "1", 1480: "1", 1481: "1", 1567: "1", 1568: "1", 1569: "1", 1570: "1", 1571: "1", 1572: "1", 1573: "1", 1658: "1", 1659: "1", 1660: "1", 1661: "1", 1662: "1", 1663: "1", 1664: "1", 1665: "1", 1750: "1", 1751: "1", 1752: "1", 1753: "1", 1754: "1", 1755: "1", 1756: "1", 1757: "2", 1842: "1", 1843: "1", 1844: "1", 1845: "1", 1846: "1", 1847: "1", 1848: "1", 1849: "1", 1934: "1", 1935: "1", 1936: "1", 1937: "1", 1938: "1", 1939: "1", 1940: "1", 1941: "1", 2026: "1", 2027: "1", 2028: "1", 2029: "1", 2030: "1", 2031: "1", 2032: "1", 2033: "1", 2119: "1", 2120: "1", 2121: "1", 2122: "1", 2123: "1", 2124: "1", 2125: "1", 2126: "1", 1298: "1", 1299: "1", 1300: "1", 1301: "1", 1302: "1", 1390: "1", 1391: "1", 1392: "1", 1393: "1", 1394: "1", 1482: "1", 1483: "1", 1484: "1", 1485: "1", 1486: "1", 1574: "1", 1575: "1", 1576: "1", 1577: "1", 1578: "1", 1666: "1", 1667: "1", 1668: "1", 1669: "1", 1670: "1", 1758: "1", 1759: "1", 1760: "1", 1761: "1", 1762: "1", 1850: "1", 1851: "1", 1852: "1", 1853: "1", 1854: "1", 1942: "1", 1943: "1", 1944: "1", 1945: "1", 1946: "1", 2034: "1", 2035: "1", 2036: "1", 2037: "1", 2038: "1", 2127: "1", 2128: "1", 2129: "1", 2130: "1", 2131: "1", 2132: "1", 2133: "1", 2134: "1", 2135: "1", 2136: "1", 2137: "1", 2138: "1", 2139: "1", 2140: "1", 2039: "1", 2040: "1", 2041: "1", 2042: "1", 2043: "1", 2045: "1", 2046: "1", 2047: "1", 2048: "1", 1947: "1", 1948: "1", 1949: "1", 1950: "1", 1951: "1", 1952: "1", 1953: "1", 1954: "1", 1955: "1", 1855: "1", 1856: "1", 1857: "1", 1858: "1", 1859: "1", 1860: "1", 1861: "1", 1862: "1", 1863: "1", 1763: "1", 1764: "1", 1765: "1", 1766: "1", 1767: "1", 1768: "1", 1769: "1", 1770: "1", 1771: "1", 1671: "1", 1672: "1", 1673: "1", 1674: "1", 1675: "1", 1676: "1", 1677: "1", 1678: "1", 1679: "1", 1579: "1", 1580: "1", 1581: "1", 1582: "1", 1583: "1", 1584: "1", 1585: "1", 1586: "1", 1587: "1", 1487: "1", 1488: "1", 1489: "1", 1490: "1", 1491: "1", 1492: "1", 1493: "1", 1494: "1", 1495: "1", 1395: "1", 1396: "1", 1397: "1", 1398: "1", 1399: "1", 1400: "1", 1401: "1", 1402: "1", 1403: "1", 1303: "1", 1304: "1", 1305: "1", 1306: "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", 1404: "1", 1405: "1", 1406: "1", 1407: "1", 1408: "1", 1409: "1", 1410: "1", 1411: "1", 1412: "1", 1413: "1", 1414: "1", 1415: "1", 1496: "2", 1497: "1", 1498: "1", 1499: "1", 1500: "1", 1501: "1", 1502: "1", 1503: "1", 1504: "1", 1505: "1", 1506: "1", 1508: "1", 1588: "1", 1589: "1", 1590: "1", 1591: "1", 1592: "1", 1593: "1", 1594: "1", 1595: "1", 1596: "1", 1597: "1", 1598: "1", 1603: "", 1599: "1", 1680: "1", 1681: "1", 1682: "1", 1683: "1", 1684: "1", 1685: "1", 1686: "1", 1687: "1", 1688: "1", 1689: "1", 1690: "1", 1691: "1", 1772: "1", 1773: "1", 1774: "1", 1775: "1", 1776: "1", 1777: "1", 1778: "1", 1779: "1", 1780: "1", 1781: "1", 1782: "1", 1783: "1", 1864: "1", 1865: "1", 1866: "1", 1867: "1", 1868: "1", 1869: "1", 1870: "1", 1871: "1", 1872: "1", 1873: "1", 1874: "1", 1875: "1", 1956: "1", 1957: "1", 1958: "1", 1959: "1", 1960: "1", 1961: "1", 1962: "1", 1963: "1", 1964: "1", 1965: "1", 1966: "1", 1967: "1", 2049: "1", 2050: "1", 2051: "1", 2052: "1", 2053: "1", 2054: "1", 2055: "1", 2056: "1", 2057: "1", 2058: "1", 2059: "1", 2060: "1", 2141: "1", 2142: "1", 2143: "1", 2144: "1", 2145: "1", 2146: "1", 2147: "1", 2148: "1", 2149: "1", 2150: "1", 2151: "1", 2152: "1", 2161: "1", 2162: "1", 2163: "1", 2164: "1", 2165: "1", 2166: "1", 2069: "1", 2070: "1", 2071: "1", 2072: "1", 2073: "1", 2074: "1", 1976: "1", 1977: "1", 1978: "1", 1979: "1", 1980: "1", 1981: "1", 1884: "1", 1885: "1", 1886: "1", 1887: "1", 1888: "1", 1889: "1", 1792: "1", 1793: "1", 1794: "1", 1795: "1", 1796: "1", 1797: "1", 1700: "1", 1701: "1", 1702: "1", 1703: "1", 1704: "1", 1705: "1", 1608: "1", 1609: "1", 1610: "1", 1611: "1", 1612: "1", 1613: "1", 1517: "1", 1518: "1", 1519: "1", 1520: "1", 1521: "1", 1522: "1", 1424: "1", 1425: "1", 1426: "1", 1427: "1", 1428: "1", 1429: "1", 1332: "1", 1333: "1", 1334: "1", 1335: "1", 1336: "1", 1337: "1", 2744: "2", 2745: "2", 2746: "2", 2748: "1", 2749: "1", 2750: "1", 2751: "1", 2752: "1", 2753: "1", 2754: "1", 2755: "1", 2756: "1", 2757: "1", 2758: "1", 2759: "1", 2760: "1", 2761: "1", 2762: "1", 2763: "1", 2772: "1", 2773: "1", 2774: "1", 2775: "1", 2776: "1", 2777: "1", 2778: "1", 2779: "1", 1022: "2", 1026: "2", 1027: "2", 1028: "2", 1029: "2", 1030: "2", 1032: "2", 1033: "2", 1035: "2", 1037: "2", 1023: "1", 1024: "1", 1036: "1", 2821: "1", 2822: "1", 2823: "1", 2824: "1", 2825: "1", 2826: "1", 1012: "1", 1013: "1", 1014: "1", 1015: "1", 1016: "1", 1017: "1", 1018: "1", 1019: "1", 1020: "1", 1021: "1", 1219: "2", 1220: "2", 1221: "2", 1222: "2", 1223: "2", 1224: "2", 1225: "2", 1226: "2", 1227: "2", 1228: "2", 1229: "2", 1230: "2", 1231: "1", 1232: "1", 1233: "1", 1234: "1", 1235: "1", 1236: "1", 1237: "1", 1238: "1", 1239: "1", 2805: "2", 2806: "1", 2807: "1", 2808: "1", 2809: "1", 2810: "1", 2811: "2", 2812: "1", 2813: "1", 2814: "1", 2815: "1", 2816: "1", 2817: "1", 2818: "1", 2819: "1", 2820: "1", 2827: "8", 2828: "3", 2829: "2", 2830: "2", 2831: "2", 2832: "2", 2833: "2", 2834: "2", 2839: "1", 2840: "1", 2841: "1", 2842: "1", 2843: "1", 2844: "1", 2845: "1", 2846: "1", 2853: "1", 2847: "1", 2848: "1", 2849: "1", 2850: "1", 2851: "1", 2854: "1", 2852: "1", 1004: "1", 1005: "1", 1006: "1", 1007: "1", 1008: "1", 1009: "1", 1010: "1", 1011: "1", 2863: "1", 2864: "1", 2865: "1", 2866: "1", 2867: "1", 2868: "1", 2869: "1", 2870: "1", 2747: "1", };var opt_list = [89,90,91,92,93,94,95,97,98,99,100,101,102,103,109,116,117,118,119,120,121,122,123,124,125,126,127,131,40,41,138,140]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '510'; var gwpurl = 'https://gwp.brweb.pl/i/index.php?path=/i/510/'; var imgLimit = '15'; 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 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); if (prev_div) { 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 = ''; console.log(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 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; if (window.innerWidth < 700) showPrevMobile(e); } } 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; if (window.innerWidth < 700) showPrevMobile(e); 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 += '
' + oName + '
'; } } if (optCnt > imgLimit) { sOptions += '
' + more_txt[opt_id] + '
'; } sPreview = '
'; if (document.getElementById('gwp_div_list_'+opt_id)) { if (document.getElementById('gwp_div_title_'+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'); 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.getElementsByClassName('label')[0]; } div4title.appendChild(div_title); if (optType == 'S') { s.parentElement.parentElement.parentElement.parentElement.appendChild(div_prev); s.parentElement.parentElement.parentElement.parentElement.appendChild(div_list); } else { s.parentElement.parentElement.parentElement.appendChild(div_prev); s.parentElement.parentElement.parentElement.appendChild(div_list); } } optTmp[opt_id] = s.innerText.replace(/\s+/g, ''); optTmpVal[opt_id] = optValue; if (sid == 562) { optTmp[opt_id] = s.innerHTML.replace(/\s+/g, ''); } } }); changeStock = 0; if (isLoading > 0 || isDiff == 1) { setTimeout(showGWP,1000); } } window.onload = function(){ showGWP(); }; showGWP(); setTimeout(showGWP,1000);