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(3, 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:-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: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; }'; document.head.appendChild(gwpstyle); } gwpNo = {413: "1", 414: "1", 614: "0", 615: "0", 616: "0", 1220: "0", 1221: "0", 1222: "0", 1598: "0", 1599: "0", 1602: "0", 1603: "0", 1606: "0", 1607: "0", 1608: "0", 1610: "0", 1641: "0", 1642: "0", 415: "0", 416: "0", 418: "0", 419: "0", 420: "0", 421: "0", 422: "0", 423: "0", 424: "0", 425: "0", 426: "0", 427: "0", 428: "0", 429: "0", 430: "0", 431: "0", 432: "0", 433: "0", 434: "0", 1383: "0", 1384: "0", 1386: "0", 1387: "0", 1388: "0", 1389: "0", 1390: "0", 1391: "0", 1392: "0", 1393: "0", 1394: "0", 1395: "0", 1396: "0", 1397: "0", 1398: "0", 1399: "0", 1400: "0", 1401: "0", 1402: "0", 1403: "0", 1404: "0", 1406: "0", 1407: "0", 1408: "0", 1409: "0", 1410: "0", 1411: "0", 1412: "0", 1413: "0", 1414: "0", 1415: "0", 1416: "0", 1417: "0", 1418: "0", 1419: "0", 1420: "0", 1421: "0", 1422: "0", 1442: "1", 956: "1", 957: "1", 1423: "0", 1424: "0", 963: "1", 962: "1", 1691: "1", 1692: "1", 1693: "1", 1801: "1", 1276: "2", 1278: "2", 1280: "2", 1281: "2", 1282: "2", 1660: "2", 1661: "2", 1662: "2", 1663: "2", 1664: "2", 1665: "2", 1284: "2", 1285: "2", 1287: "2", 1288: "2", 1289: "2", 1290: "2", 1291: "2", 1292: "2", 1294: "2", 1295: "2", 1296: "2", 1298: "1", 1299: "1", 1300: "1", 1301: "1", 1302: "1", 1303: "1", 1304: "1", 1305: "1", 1306: "1", 1307: "1", 1308: "1", 1309: "1", 1310: "1", 1311: "1", 1312: "1", 1313: "1", 1334: "2", 1335: "2", 1336: "2", 1337: "2", 1338: "2", 1339: "2", 1340: "2", 1341: "2", 1342: "2", 1343: "2", 1344: "2", 1345: "2", 1364: "3", 1365: "1", 1366: "1", 1367: "1", 1368: "1", 1369: "1", 1443: "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", 1456: "1", 1457: "1", 1458: "1", 1459: "1", 1460: "1", 1461: "1", 1462: "1", 1463: "1", 1464: "1", 1465: "1", 1466: "1", 1467: "1", 1468: "1", 1469: "1", 1470: "1", 1471: "1", 1472: "1", 1473: "2", 1474: "1", 1475: "1", 1476: "1", 1477: "1", 1478: "1", 1479: "1", 1480: "1", 1481: "1", 1482: "1", 1762: "1", 1763: "1", 1764: "1", 1765: "1", 1766: "1", 1767: "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", 1780: "1", 1781: "1", 1782: "1", 1783: "1", 1784: "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", 1578: "1", 1579: "1", 1580: "1", 1581: "1", 1582: "1", 1583: "1", 1584: "1", 1585: "1", 1586: "1", 1587: "1", 1588: "1", 1589: "1", 1590: "1", 1592: "1", 1593: "1", 1594: "1", 1595: "1", 1596: "1", 1702: "1", 1703: "1", 1704: "1", 1705: "1", 1706: "1", 1707: "1", 1708: "1", 1709: "1", 1710: "1", 1711: "1", 761: "1", 765: "1", 769: "1", 771: "1", 774: "1", 795: "1", 796: "1", 800: "1", 801: "1", 802: "1", 804: "1", 805: "1", 807: "1", 809: "1", 812: "1", 816: "1", 821: "1", 824: "1", 825: "1", 826: "1", 828: "1", 829: "1", 830: "1", 832: "1", 833: "1", 834: "1", 835: "1", 837: "1", 843: "1", 844: "1", 846: "1", 847: "1", 848: "1", 849: "1", 851: "1", 857: "1", 858: "1", 861: "1", 870: "1", 874: "1", 879: "1", 1147: "1", 1148: "1", 1149: "1", 1155: "1", 1156: "1", 1157: "1", 1158: "1", 1162: "1", 1164: "1", 1168: "1", 1169: "1", 1173: "1", 1178: "1", 1179: "1", 1180: "1", 1181: "1", 1183: "1", 1184: "1", 1271: "1", 1273: "1", 1274: "1", 1496: "1", 1497: "1", 1498: "1", 1499: "1", 1500: "1", 1501: "1", 1502: "1", 1503: "1", 1504: "1", 1507: "1", 1508: "1", 1548: "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", 1562: "1", 1563: "1", 1564: "1", 1565: "1", 1566: "1", 1567: "1", 1568: "1", 1569: "1", 1570: "1", 1571: "1", 1572: "1", 1573: "1", 1712: "1", 1713: "1", 1714: "1", 1715: "1", 1716: "1", 1717: "1", 1718: "1", 1719: "1", 1720: "1", 1721: "1", 1722: "1", 1723: "1", 1724: "1", 1725: "1", 1726: "1", 1727: "1", 1728: "1", 1729: "1", 1730: "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", 1748: "1", 1749: "2", 1750: "2", 1751: "2", 1752: "2", 1753: "2", 1754: "2", 1354: "1", 1492: "1", 1666: "1", 1672: "1", 1674: "1", 1355: "1", 1356: "1", 1493: "1", 1668: "1", 1669: "1", 1357: "1", 1358: "1", 1359: "1", 1800: "1", 1494: "1", 1360: "1", 1361: "1", 1362: "1", 1363: "1", 1441: "1", 1440: "1", 1670: "1", 1671: "1", 884: "1", 887: "1", 889: "1", 892: "1", 893: "1", 894: "1", 895: "1", 897: "1", 899: "1", 1651: "1", 905: "1", 906: "1", 912: "1", 913: "1", 914: "1", 915: "1", 1525: "1", 1526: "1", 1539: "1", 920: "1", 921: "1", 922: "1", 946: "1", 1523: "1", 947: "1", 948: "1", 1544: "1", 1545: "1", 1520: "1", 1546: "1", 1521: "1", 1547: "1", 1522: "1", 949: "1", 950: "1", 951: "1", 1225: "1", 952: "1", 953: "1", 1538: "1", 1659: "1", 1223: "1", 1224: "1", 1518: "1", 1519: "1", 1802: "1", 1803: "1", 1804: "1", 1805: "1", 1806: "1", 1807: "1", 735: "1", 1808: "1", 1809: "1", 1810: "1", 1811: "1", 1812: "1", 1813: "1", 1814: "1", 1815: "1", 1816: "1", 1817: "1", 1818: "1", 1819: "1", 1820: "1", 1821: "1", 1822: "1", 1823: "1", 1824: "1", 1825: "1", 1831: "1", 1832: "1", 1833: "1", 1834: "1", 1835: "1", 1836: "1", 1841: "1", 1844: "1", 1845: "1", 1846: "1", 1847: "1", 1848: "1", 1861: "1", };var opt_list = [39,76,28,89,90,27,56,59,83,84,47,98,85,86,87,88,91,103,48,54,49,50,51,53,55,77,94,108,109,111,114]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '110'; var gwpurl = 'https://gwp.brweb.pl/i/index.php?path=/i/110/'; var imgLimit = '3'; var moreLabel = 'pokaż więcej: '; var lessLabel = 'zwiń: '; 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 oClick(e,type) { if (type == 'S') { selectClick(e); } else { radioClick(e); } setTimeout(showGWP,500); } function selectClick(e) { var id = e.id; var aId = id.split('__'); var optId = aId[0].replace('option_',''); 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_'+optId)) document.getElementById('gwp_div_title_'+optId).innerHTML = e.title; } else { document.getElementById(aId[0]).selectedIndex = '0'; if (document.getElementById('gwp_div_title_'+optId)) document.getElementById('gwp_div_title_'+optId).innerHTML = ''; id = aId[0] + '__' + document.getElementById(aId[0]).value; } 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.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'; } } optTmpVal[aId[0].replace('option_','')] = document.getElementById(aId[0]).value; } 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.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 sr = document.getElementsByName('option_'+opt_id); if (sr.length == 0) { return; } var optValue = ''; if (sr[0].id == sr[0].name ) { var optType = 'S'; var s = sr[0]; var c = s.getElementsByTagName('option'); var optValue = s.value; } else { var optType = 'R'; var s = sr[0].parentElement.parentElement; var c = sr; for( var j = 0; j < c.length; j++){ if (c[j].checked == true) { optValue = c[j].value; } } } var svalues = Array.from(s.querySelectorAll('input[type="radio"], select option')).map(el => el.value).join('|'); isDiff = (!optTmp[opt_id] || optTmp[opt_id] != svalues || optTmpVal[opt_id] != optValue) ? 1 : 0; var eStock = (optType == 'S') ? s.parentElement.className : sr[0].parentElement.className; if (eStock.indexOf('option_truestock ') != -1 && eStock.indexOf('loading') != -1) { isLoading++; } if (isDiff == 1 || changeStock == 1) { if (optType == 'R') { s.style.visibility = 'hidden'; s.style.width = '0px'; s.style.height = '0px'; s.style.position = 'absolute'; s.style.bottom = '0px'; } else { s.style.display = 'none'; } var sOptions = '', sPreview = '', sTitle = ''; var imgNo = 0; var optCnt = (optType == 'S') ? c.length - 1 : c.length; if (optType == 'R') { for( var j = 0; j < c.length; j++){ if (c[j].parentElement.className == 'radio-wrap none') { optCnt--; } } var rlabels = s.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; } } 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' && (s.options[s.selectedIndex].value == c[j].value || s.value == 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() : rDict[c[j].id].trim(); oId = (optType == 'S') ? s.id : 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)) { 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'); 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; } else { var div4title = s.parentElement; } div4title.prepend(div_title); if (optType == 'S') { s.parentElement.parentElement.parentElement.appendChild(div_prev); s.parentElement.parentElement.parentElement.appendChild(div_list); } else { s.parentElement.parentElement.appendChild(div_prev); s.parentElement.parentElement.appendChild(div_list); } } optTmp[opt_id] = Array.from(s.querySelectorAll('input[type="radio"], select option')).map(el => el.value).join('|'); optTmpVal[opt_id] = optValue; } }); changeStock = 0; if (isLoading > 0 || isDiff == 1) { setTimeout(showGWP,1000); } } window.onload = function(){ showGWP(); }; showGWP(); setTimeout(showGWP,1000);