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(6, 1fr); gap: 0px; width: 100%; } .gwp-opt { box-sizing: border-box; text-align: center; border:1px solid transparent; padding:1px; margin:0px; border-radius:6px; overflow-x:hidden; position: relative; } .gwp-opt:hover { border-top:0px solid #EEEEEE; padding:1px; } .gwp-opt:hover .gwp-opt-name { padding-top:1px; } .gwp-opt-sel:hover .gwp-opt-name { padding-top: 0px; } .gwp-opt-sel { border:1px 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:-405px; width:400px; 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:6px; } .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 = {2708: "2", 2709: "1", 2710: "1", 2711: "1", 2744: "1", 2745: "2", 2746: "1", 2747: "1", 2748: "1", 2749: "1", 2750: "1", 2751: "2", 2752: "2", 2753: "1", 2754: "1", 2755: "1", 2756: "1", 2757: "1", 2758: "1", 2759: "1", 2760: "1", 2761: "1", 2762: "1", 2763: "1", 2764: "1", 2765: "1", 2766: "1", 2767: "1", 2768: "1", 2769: "1", 2770: "1", 2771: "1", 2772: "1", 2773: "1", 2774: "1", 2775: "1", 2776: "1", 2777: "1", 2778: "1", 2779: "1", 2780: "1", 2781: "1", 2782: "1", 2783: "1", 2784: "1", 2785: "1", 2786: "1", 2787: "1", 2788: "1", 2789: "1", 2790: "2", 2791: "2", 2734: "1", 2735: "1", 2736: "1", 2738: "1", 2739: "2", 2740: "2", 2741: "1", 0: "5", 2743: "1", 2792: "1", 2793: "1", 2794: "1", 2795: "1", 2796: "1", 2797: "1", 2798: "1", 2799: "1", 2800: "1", 2801: "1", 2802: "1", 2803: "1", 2804: "1", 2805: "1", 2806: "1", 2807: "1", 2808: "1", 2809: "1", 2810: "1", 2811: "1", 2819: "1", 2820: "1", 2821: "1", 2822: "1", 2826: "1", 2827: "1", 2828: "1", 2829: "1", 2830: "1", 2831: "1", 2832: "1", 2833: "1", 2834: "1", 2835: "1", 2836: "1", 2838: "1", 2839: "1", 2840: "1", 2841: "1", 2842: "1", 2843: "1", 2844: "1", 2845: "1", 2846: "1", 2847: "2", 2848: "1", 2849: "1", 2850: "1", 1486: "2", 1487: "2", 1488: "3", 1489: "2", 1490: "2", 1491: "2", 2301: "1", 2302: "1", 2303: "1", 2304: "1", 2305: "1", 2306: "1", 2307: "", 2308: "2", 2309: "2", 2310: "1", 2311: "1", 2312: "1", 2313: "1", 2315: "1", 2316: "1", 2317: "1", 2318: "1", 2319: "1", 2320: "1", 2321: "", 2322: "1", 2323: "1", 2324: "1", 2325: "1", 2326: "1", 2327: "1", 2328: "", 2329: "1", 2330: "1", 2331: "1", 2332: "1", 2333: "1", 2334: "1", 2336: "1", 2337: "1", 2338: "1", 2339: "1", 2340: "1", 2341: "1", 2345: "1", 2346: "1", 2347: "1", 2348: "1", 2349: "1", 2350: "1", 2352: "1", 2353: "1", 2354: "1", 2355: "1", 2356: "1", 2357: "1", 2359: "1", 2360: "1", 2361: "1", 2362: "1", 2363: "1", 2364: "1", 2366: "1", 2367: "1", 2368: "1", 2369: "1", 2370: "1", 2371: "1", 2373: "1", 2374: "1", 2375: "1", 2376: "1", 2377: "1", 2378: "1", 2380: "1", 2381: "1", 2382: "1", 2383: "1", 2384: "1", 2385: "1", 2387: "1", 2388: "1", 2389: "1", 2390: "1", 2391: "1", 2392: "1", 2394: "1", 2395: "1", 2396: "1", 2397: "1", 2398: "1", 2399: "1", 2401: "1", 2402: "1", 2403: "1", 2404: "1", 2405: "1", 2406: "1", 2408: "1", 2409: "1", 2410: "1", 2411: "1", 2412: "1", 2413: "1", 2415: "1", 2416: "1", 2417: "2", 2418: "1", 2419: "1", 2420: "1", 2422: "1", 2423: "1", 2424: "1", 2425: "1", 2426: "1", 2427: "1", 2429: "1", 2430: "1", 2431: "1", 2432: "1", 2433: "1", 2434: "1", 2436: "2", 2437: "1", 2438: "2", 2439: "1", 2440: "1", 2441: "1", 2443: "1", 2444: "1", 2445: "1", 2446: "1", 2447: "1", 2448: "1", 2450: "1", 2451: "1", 2452: "1", 2453: "1", 2454: "1", 2455: "1", 2457: "1", 2458: "1", 2459: "1", 2460: "1", 2461: "1", 2462: "1", 2464: "1", 2465: "1", 2466: "1", 2467: "1", 2468: "1", 2469: "1", 2471: "1", 2472: "1", 2473: "1", 2474: "1", 2475: "1", 2476: "1", 1549: "1", 1550: "1", 1551: "1", 1552: "1", 1553: "1", 1554: "1", 1556: "1", 1557: "1", 1558: "1", 1559: "1", 1560: "1", 1561: "1", 1563: "1", 1564: "1", 1565: "1", 1566: "1", 1567: "1", 1568: "1", 1570: "1", 1571: "1", 1572: "1", 1573: "1", 1574: "1", 1575: "1", 1577: "1", 1578: "1", 1579: "1", 1580: "1", 1581: "1", 1582: "1", 1584: "1", 1585: "1", 1586: "1", 1587: "1", 1588: "1", 1589: "1", 1600: "1", 1601: "1", 1602: "1", 1603: "1", 1604: "1", 1605: "1", 1607: "1", 1608: "1", 1609: "1", 1610: "1", 1611: "1", 1612: "1", 1614: "1", 1615: "1", 1616: "1", 1617: "1", 1618: "1", 1619: "1", 1621: "1", 1622: "1", 1623: "1", 1624: "1", 1625: "1", 1626: "1", 1650: "1", 1651: "1", 1652: "1", 1653: "1", 1654: "1", 1655: "1", 1657: "1", 1658: "1", 1659: "1", 1660: "1", 1661: "1", 1662: "1", 1664: "1", 1665: "1", 1666: "1", 1667: "1", 1668: "1", 1669: "1", 1671: "1", 1672: "1", 1673: "1", 1674: "1", 1675: "1", 1676: "1", 1678: "1", 1679: "1", 1680: "1", 1681: "1", 1682: "1", 1683: "1", 1685: "1", 1686: "1", 1687: "1", 1688: "1", 1689: "1", 1690: "1", 1700: "1", 1701: "1", 1702: "1", 1703: "1", 1704: "1", 1705: "1", 1707: "1", 1708: "1", 1709: "1", 1710: "1", 1711: "1", 1712: "1", 1714: "1", 1715: "1", 1716: "1", 1717: "1", 1718: "1", 1719: "1", 1721: "1", 1722: "1", 1723: "1", 1724: "1", 1725: "1", 1726: "1", 1728: "1", 1729: "1", 1730: "1", 1731: "1", 1732: "1", 1733: "1", 1735: "1", 1736: "1", 1737: "1", 1738: "1", 1739: "1", 1740: "1", 1742: "1", 1743: "1", 1744: "1", 1745: "1", 1746: "1", 1747: "1", 1749: "1", 1750: "1", 1751: "1", 1752: "1", 1753: "1", 1754: "1", 1756: "1", 1757: "1", 1758: "1", 1759: "1", 1760: "1", 1761: "1", 1763: "1", 1764: "1", 1765: "1", 1766: "1", 1767: "1", 1768: "1", 1771: "1", 1772: "1", 1773: "1", 1774: "1", 1775: "1", 1776: "1", 1778: "1", 1779: "1", 1780: "1", 1781: "1", 1782: "1", 1783: "1", 1785: "1", 1786: "1", 1787: "1", 1788: "1", 1789: "1", 1790: "1", 1791: "1", 1792: "1", 1793: "1", 1794: "1", 1795: "1", 1796: "1", 1797: "1", 1798: "1", 1799: "1", 1800: "1", 1801: "1", 1802: "1", 1809: "1", 1810: "1", 1811: "1", 1812: "1", 1813: "1", 1814: "1", 1816: "1", 1817: "1", 1818: "1", 1819: "1", 1820: "1", 1821: "1", 1823: "1", 1824: "1", 1825: "1", 1826: "1", 1827: "1", 1828: "1", 1830: "2", 1831: "1", 1832: "1", 1833: "1", 1834: "1", 1835: "1", 1836: "1", 1837: "1", 1838: "1", 1839: "1", 1840: "1", 1841: "1", 1845: "1", 1846: "1", 1847: "1", 1848: "1", 1849: "1", 1850: "1", 1852: "1", 1853: "1", 1854: "1", 1855: "1", 1856: "1", 1857: "1", 1859: "1", 1860: "1", 1861: "1", 1862: "1", 1863: "1", 1864: "1", 1866: "1", 1867: "1", 1868: "1", 1869: "1", 1870: "1", 1871: "1", 1872: "1", 1873: "1", 1874: "1", 1875: "1", 1876: "1", 1877: "1", 1892: "1", 1893: "1", 1894: "1", 1895: "1", 1896: "1", 1897: "1", 1900: "1", 1901: "1", 1902: "1", 1903: "1", 1904: "1", 1905: "1", 1907: "1", 1908: "1", 1909: "1", 1910: "1", 1911: "1", 1912: "1", 1914: "1", 1915: "1", 1916: "1", 1917: "1", 1918: "1", 1919: "1", 1921: "1", 1922: "1", 1923: "1", 1924: "1", 1925: "1", 1926: "1", 1928: "1", 1929: "1", 1930: "1", 1931: "1", 1932: "1", 1933: "1", 1935: "1", 1936: "1", 1937: "1", 1938: "1", 1939: "1", 1940: "1", 2615: "1", 2616: "1", 2617: "1", 2618: "1", 2619: "1", 2620: "1", 2622: "1", 2623: "1", 2624: "1", 2625: "1", 2626: "1", 2627: "1", 2673: "1", 2674: "1", 2675: "1", 2676: "1", 2677: "1", 2678: "1", 1959: "1", 1960: "1", 1961: "1", 1962: "1", 1963: "1", 1964: "1", 1966: "1", 1967: "1", 1968: "1", 1969: "1", 1970: "1", 1971: "1", 1973: "1", 1974: "1", 1975: "1", 1976: "1", 1977: "1", 1978: "1", 1980: "1", 1981: "1", 1982: "1", 1983: "1", 1984: "1", 1985: "1", 1987: "1", 1988: "1", 1989: "1", 1990: "1", 1991: "1", 1992: "1", 1994: "1", 1995: "1", 1996: "1", 1997: "1", 1998: "2", 1999: "1", 2000: "1", 2001: "1", 2002: "1", 2003: "1", 2004: "1", 2005: "1", 2006: "1", 2007: "1", 2008: "1", 2009: "1", 2010: "1", 2011: "1", 2040: "1", 2041: "1", 2042: "1", 2043: "1", 2044: "1", 2045: "1", 2047: "1", 2048: "1", 2049: "1", 2050: "1", 2051: "1", 2052: "1", 2062: "", 2063: "", 2064: "", 2065: "", 2066: "", 2067: "", 2083: "1", 2084: "1", 2085: "1", 2086: "1", 2087: "1", 2088: "1", 2090: "1", 2091: "1", 2092: "1", 2093: "1", 2094: "1", 2095: "1", 2097: "1", 2098: "1", 2099: "1", 2100: "1", 2101: "1", 2102: "1", 2145: "1", 2146: "1", 2147: "1", 2148: "1", 2149: "1", 2150: "1", 2207: "1", 2208: "1", 2209: "1", 2210: "1", 2211: "1", 2212: "1", 2214: "1", 2215: "1", 2216: "1", 2217: "1", 2218: "1", 2219: "1", 1521: "1", 1522: "1", 1523: "1", 1524: "1", 1525: "1", 1526: "1", 2485: "1", 2486: "1", 2487: "1", 2488: "1", 2489: "1", 2490: "1", 2076: "1", 2077: "1", 2078: "1", 2079: "1", 2080: "1", 2081: "1", 2021: "1", 2022: "1", 2023: "1", 2024: "1", 2025: "1", 2026: "1", 2030: "1", 2031: "1", 2032: "1", 2033: "1", 2034: "1", 2035: "1", 2069: "1", 2070: "1", 2071: "1", 2072: "1", 2073: "1", 2074: "2", 2223: "1", 2224: "1", 2225: "1", 2226: "1", 2227: "1", 2228: "1", 2229: "1", 2230: "1", 2231: "1", 2232: "1", 2233: "1", 2234: "2", 2240: "1", 2241: "1", 2242: "1", 2243: "1", 2244: "1", 2245: "1", 2247: "1", 2248: "1", 2249: "1", 2250: "1", 2251: "1", 2252: "1", 2665: "1", 2666: "1", 2667: "1", 2668: "1", 2669: "1", 2670: "1", 2173: "1", 2174: "1", 2175: "1", 2176: "1", 2177: "1", 2178: "1", 2180: "1", 2181: "1", 2182: "1", 2183: "1", 2184: "1", 2185: "1", 2187: "1", 2188: "1", 2189: "1", 2190: "1", 2191: "1", 2192: "1", 2272: "1", 2273: "1", 2274: "1", 2275: "1", 2276: "1", 2277: "1", 2281: "1", 2282: "1", 2283: "1", 2284: "1", 2285: "1", 2286: "1", 2254: "1", 2255: "1", 2256: "1", 2257: "1", 2258: "1", 2259: "1", 2505: "1", 2506: "1", 2507: "1", 2508: "1", 2509: "1", 2510: "1", 2518: "1", 2519: "1", 2520: "1", 2521: "1", 2522: "1", 2523: "1", 2525: "1", 2526: "1", 2527: "1", 2528: "1", 2529: "1", 2530: "1", 2570: "1", 2571: "1", 2572: "1", 2573: "1", 2574: "1", 2575: "1", 2594: "1", 2595: "1", 2596: "1", 2597: "1", 2598: "1", 2599: "1", 2689: "1", 2690: "1", 2691: "1", 2692: "1", 2693: "1", 2694: "1", 2631: "1", 2632: "1", 2633: "1", 2634: "1", 2635: "1", 2636: "1", 2642: "1", 2643: "1", 2644: "1", 2645: "1", 2646: "1", 2647: "1", 2648: "1", 2649: "1", 2650: "1", 2651: "1", 2652: "1", 2653: "1", 1536: "2", 1537: "2", 1538: "2", 1539: "3", 2660: "3", 2661: "3", 2662: "4", 2663: "2", 1541: "1", 1542: "1", 1543: "1", 1545: "1", 1546: "1", 1547: "1", 1506: "1", 1508: "1", 1514: "1", 1515: "1", 1516: "1", 1532: "1", 1533: "1", 1534: "1", 1528: "2", 1529: "2", 1530: "2", 1510: "1", 1511: "1", 1512: "1", 1496: "1", 1497: "1", 1498: "1", 1500: "1", 1501: "1", 1502: "1", 1518: "1", 1519: "1", 2852: "1", 2853: "1", 2854: "1", 2855: "1", 2856: "1", 2857: "1", 2859: "1", 2860: "1", 2861: "1", 2862: "1", 2863: "1", 2864: "1", };var opt_list = [559,562,567,570,569,571,568,572,575,576,578,579,580,581,582,583,584,585,586,587,588,589,338,354,357,358,359,360,361,362,364,365,366,367,373,374,375,376,377,378,382,383,384,385,386,387,388,389,390,391,393,394,395,396,397,399,400,401,402,403,404,405,406,407,408,412,413,414,415,416,417,418,537,538,549,422,423,424,425,426,427,428,429,436,437,441,442,443,444,452,465,466,351,512,432,434,440,468,469,471,472,548,459,460,461,479,480,473,518,521,522,533,535,553,540,543,544,547,590,591]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '681'; var gwpurl = 'https://gwp.brweb.pl/i/index.php?path=/i/681/'; var imgLimit = '6'; 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 = '
'+e.title+'
'; 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 = ''+e.title+'
'; 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 += '