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(8, 1fr); gap: 0px; width: 100%; } .gwp-opt { box-sizing: border-box; text-align: center; border:0px solid transparent; padding:1px; margin:0px; border-radius:10%; overflow-x:hidden; position: relative; } .gwp-opt:hover { border-top:0px solid #EEEEEE; padding:1px; } .gwp-opt:hover .gwp-opt-name { padding-top:0px; } .gwp-opt-sel:hover .gwp-opt-name { padding-top: 0px; } .gwp-opt-sel { border:0px 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:-125px; width:120px; 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:10%; } .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 = {200: "1", 203: "1", 204: "1", 205: "1", 206: "1", 207: "1", 208: "", 209: "1", 210: "1", 211: "1", 212: "1", 213: "1", 214: "1", 215: "1", 216: "1", 219: "1", 220: "1", 221: "1", 222: "1", 223: "1", 224: "1", 227: "1", 225: "1", 226: "1", 229: "1", 230: "1", 231: "1", 232: "1", 234: "1", 236: "1", 237: "1", 238: "1", 239: "1", 240: "1", 243: "1", 244: "1", 245: "1", 247: "1", 248: "1", 249: "1", 250: "1", 251: "1", 252: "1", 253: "1", 254: "1", 256: "1", 257: "1", 258: "1", 259: "1", 262: "1", 263: "1", 264: "1", 265: "1", 266: "1", 267: "1", 268: "1", 269: "1", 270: "1", 271: "1", 272: "1", 275: "1", 276: "1", 277: "1", 278: "1", 282: "1", 284: "1", 285: "1", 287: "1", 291: "1", 293: "1", 295: "1", 296: "1", 297: "1", 298: "1", 299: "1", 301: "1", 303: "1", 304: "1", 306: "1", 308: "1", 310: "1", 311: "1", 312: "1", 314: "1", 315: "1", 316: "1", 318: "1", 319: "1", 320: "1", 321: "1", 322: "1", 324: "1", 327: "1", 328: "1", 329: "1", 330: "1", 333: "1", 334: "1", 335: "1", 336: "1", 337: "1", 338: "1", 340: "1", 341: "1", 342: "1", 281: "1", 283: "1", 292: "1", 288: "1", 302: "1", 309: "1", 325: "1", 323: "1", 332: "3", 339: "1", 286: "1", 290: "1", 273: "1", 274: "1", 279: "1", 280: "1", 289: "1", 300: "1", 305: "1", 313: "1", 317: "1", 326: "1", 331: "1", 343: "1", 344: "2", 345: "1", 346: "1", 347: "1", 348: "1", 349: "1", 307: "1", 691: "1", 692: "1", 631: "1", 610: "1", 613: "1", 614: "1", 616: "1", 617: "1", 618: "1", 778: "2", 779: "2", 720: "1", 703: "2", 706: "2", 707: "2", 708: "2", 709: "2", 713: "2", 716: "2", 715: "2", 718: "2", 723: "2", 725: "2", 726: "2", 727: "2", 728: "2", 730: "2", 731: "2", 733: "2", 735: "2", 736: "2", 738: "2", 740: "2", 742: "2", 743: "2", 744: "2", 746: "2", 747: "2", 748: "2", 751: "2", 752: "2", 753: "2", 754: "2", 755: "2", 757: "2", 761: "2", 762: "2", 763: "2", 764: "2", 767: "2", 768: "2", 769: "2", 770: "2", 771: "2", 772: "2", 775: "2", 776: "2", 777: "2", 710: "2", 734: "2", 741: "2", 749: "2", 759: "2", 717: "2", 711: "2", 704: "2", 705: "2", 745: "2", 732: "2", 719: "2", 712: "2", 714: "2", 722: "2", 724: "2", 756: "2", 766: "2", 773: "2", 758: "2", 774: "2", 729: "2", 721: "2", 737: "2", 760: "1", 765: "2", 790: "2", 791: "2", 792: "2", 793: "2", 794: "2", 795: "2", 780: "2", 781: "2", 750: "2", 782: "1", 783: "3", 784: "1", 785: "1", 788: "1", 787: "1", 786: "1", 789: "1", 1624: "1", 1625: "1", 1627: "1", 1628: "1", 1626: "1", 1629: "1", 1630: "1", 1631: "1", 1632: "1", 1633: "1", 1634: "1", 1635: "1", 1636: "1", 1638: "1", 1639: "1", 1637: "1", 1640: "1", 1641: "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", 1655: "1", 1656: "1", 1657: "1", 1658: "1", 1659: "1", 1660: "1", 1661: "1", 1662: "1", 1663: "1", 1665: "1", 1666: "1", 1667: "1", 1668: "1", 1669: "1", 1670: "1", 1671: "1", 1672: "1", 1673: "1", 1674: "1", 1675: "1", 1676: "1", 1677: "1", 1678: "1", 1679: "1", 1680: "1", 1681: "1", 1682: "1", 1618: "1", 1619: "1", 1620: "1", 1621: "1", 1622: "1", 1623: "1", 1617: "1", 1616: "1", 1615: "1", 1614: "1", 1591: "1", 1592: "1", 1593: "1", 1594: "1", 1595: "1", 1596: "1", 1597: "1", 1598: "1", 1599: "1", 1600: "1", 1601: "1", 1604: "1", 1602: "2", 1605: "1", 1610: "1", 1611: "1", 1612: "1", 1613: "1", 1606: "1", 1607: "1", 1608: "1", 1609: "1", 1664: "1", 1724: "1", 1731: "1", 1732: "1", 1733: "1", 1734: "1", 1735: "1", 1736: "1", 1737: "1", 1738: "1", 1739: "1", 1740: "1", 1741: "1", 1742: "1", 1743: "1", 1744: "1", 1745: "1", 1746: "1", 1747: "1", 1751: "1", 1752: "1", 1753: "1", 1730: "1", 1756: "1", 1759: "1", 1758: "1", 1760: "1", 1761: "1", 1762: "1", 1763: "1", 1764: "1", 1765: "1", 1766: "1", 1768: "1", 1769: "1", 1770: "1", 1771: "1", 1772: "1", 1773: "1", 1774: "1", 1775: "1", 1776: "1", 1777: "1", 1778: "1", 1779: "1", 1784: "1", 1785: "1", 1786: "1", 1787: "1", 1789: "1", 1788: "1", 1790: "1", 1791: "1", 1792: "1", 1793: "1", 1794: "1", 1795: "1", 1796: "1", 1780: "1", 1781: "1", 1782: "1", 1783: "1", 1797: "1", 1799: "1", 1800: "1", 1801: "1", 1802: "1", 1803: "1", 1804: "1", 1806: "1", 1807: "1", 1805: "1", 1808: "1", 1809: "1", 1810: "1", 1811: "1", 1719: "1", 1683: "1", 1684: "1", 1685: "1", 1686: "1", 1687: "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", 1710: "1", 1711: "1", 1712: "1", 1713: "1", 1714: "1", 1715: "1", 1716: "1", 1717: "1", 1718: "1", 1720: "1", 1721: "1", 1722: "1", 1723: "1", 1728: "1", 1726: "1", 1725: "1", 1727: "1", 1729: "1", 1755: "1", 1750: "1", 1748: "2", 1749: "1", 1754: "1", 1757: "1", 1590: "1", 1812: "1", 1813: "1", 1815: "1", 1816: "1", 1817: "1", 1818: "1", 1819: "1", 1825: "1", 1827: "1", 1828: "1", 1829: "1", 1832: "1", 1831: "1", 1826: "1", 1830: "1", 1822: "1", 1823: "1", 1824: "1", 1821: "1", 1820: "1", 1814: "1", 1833: "1", 1834: "2", 1835: "1", 2014: "1", 1837: "1", 1838: "1", 1839: "1", 1840: "1", 1841: "1", 1842: "1", 1843: "1", 1844: "1", 1845: "1", 1846: "1", 1847: "1", 1848: "1", 1849: "2", 1860: "1", 1850: "1", 1851: "1", 1852: "1", 1853: "1", 1854: "1", 1855: "1", 1856: "1", 1857: "1", 1858: "1", 1859: "1", 1861: "1", 1862: "1", 1863: "1", 1971: "1", 1977: "1", 1978: "1", 1979: "1", 1980: "1", 1981: "1", 1982: "1", 1983: "1", 1984: "1", 1985: "1", 1986: "1", 1987: "1", 1988: "1", 1989: "1", 1990: "1", 1991: "1", 1992: "1", 1993: "1", 1997: "1", 1998: "1", 1999: "1", 2002: "1", 2005: "1", 2006: "1", 2007: "1", 2008: "1", 2009: "1", 2011: "2", 2012: "1", 2013: "1", 2015: "1", 2016: "1", 2017: "1", 2018: "1", 2019: "1", 2020: "1", 2021: "1", 2023: "1", 2024: "1", 2025: "1", 2026: "1", 2031: "1", 2032: "1", 2033: "1", 2034: "1", 2036: "1", 2037: "1", 2038: "1", 2039: "1", 2040: "1", 2041: "1", 2042: "1", 2043: "1", 2044: "1", 2046: "1", 2047: "1", 2048: "1", 2049: "1", 2050: "1", 2051: "1", 2052: "1", 2053: "1", 2054: "1", 2055: "1", 2056: "1", 2057: "1", 2058: "1", 2022: "1", 2030: "1", 2029: "1", 2028: "1", 2027: "1", 2035: "1", 2004: "1", 2010: "1", 2064: "1", 2067: "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", 1876: "1", 1877: "1", 1878: "1", 1880: "1", 1879: "1", 1881: "1", 1882: "1", 1883: "1", 1884: "1", 1886: "1", 1885: "1", 1887: "1", 1888: "1", 1889: "1", 1890: "1", 1891: "1", 1892: "1", 1893: "1", 1894: "1", 1895: "1", 1896: "1", 1897: "1", 1898: "1", 1899: "1", 1900: "1", 1901: "1", 1902: "1", 1903: "1", 1904: "1", 1905: "1", 1906: "1", 1907: "1", 1908: "1", 1909: "1", 1911: "1", 1912: "1", 1913: "1", 1914: "1", 1915: "1", 1916: "1", 1917: "1", 1918: "1", 1919: "1", 1920: "1", 1921: "1", 1922: "1", 1923: "2", 1924: "1", 1925: "1", 1926: "1", 1927: "1", 1928: "1", 1965: "1", 1976: "1", 1910: "1", 2059: "1", 2060: "1", 2061: "1", 2062: "1", 2063: "1", 2065: "1", 2066: "1", 2068: "1", 2069: "1", 2070: "1", 2071: "1", 2073: "1", 2072: "1", 2074: "1", 2075: "1", 2076: "1", 2077: "1", 2078: "1", 2080: "1", 2081: "1", 2079: "1", 1994: "1", 1995: "1", 1996: "1", 2000: "1", 2001: "1", 2003: "1", 1975: "1", 1974: "1", 1836: "1", 1929: "1", 1930: "1", 1931: "1", 1932: "1", 1933: "1", 1934: "1", 1935: "1", 1936: "1", 1937: "1", 1938: "1", 1939: "1", 1940: "1", 1941: "1", 1942: "1", 1943: "1", 1944: "2", 1945: "1", 1946: "1", 1947: "1", 1948: "1", 1949: "1", 1950: "1", 1951: "1", 1952: "1", 1953: "1", 1954: "1", 1955: "1", 1956: "1", 1957: "1", 1958: "1", 1959: "1", 1960: "1", 1961: "1", 1962: "1", 1963: "1", 1964: "1", 1966: "1", 1967: "1", 1968: "1", 1969: "1", 1972: "1", 1973: "1", 1970: "1", 1767: "1", };var opt_list = [20,21,36,34,38,42,44,45]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '562'; var gwpurl = 'https://gwp.brweb.pl/i/index.php?path=/i/562/'; var imgLimit = '66'; var moreLabel = '+'; var lessLabel = '-'; var showMLcnt = 0; var prevMopen = ''; var selectLangVal = ['','wybierz','choose','wählen','Vybrat','vali','izvēlēties','pasirinkti','választ','vyberte si','вибрати','-1']; 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; } } 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 == 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; } 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 += '