gwpNo = {49: "4", 50: "6", 199: "6", 268: "2", 269: "1", 270: "1", 267: "4", 271: "3", 265: "1", 272: "1", 53: "2", 55: "2", 273: "2", 93: "3", 94: "3", 274: "1", 284: "2", 285: "3", 286: "3", 287: "2", 288: "1", 289: "1", 290: "3", 291: "2", 292: "1", 293: "2", 294: "2", 295: "1", 296: "3", 297: "3", 298: "1", 299: "5", 300: "4", 301: "4", 302: "4", 311: "1", 318: "1", 319: "1", 320: "1", 321: "2", 322: "2", 323: "1", 324: "3", 325: "3", 328: "1", 329: "1", 330: "1", 331: "1", 332: "1", 326: "1", 327: "1", };var opt_list = [13,77,14,23,80,81,82,83,85,89,92,91,90,93]; var more_txt = [], less_txt = [], optTmp = [], isStock = 0; var sid = '265'; var url = 'https://gwp.brweb.pl/i/265/'; var selcolor = '#2c994a'; var imgLimit = '6'; var moreLabel = '+'; var lessLabel = '-'; var showMLcnt = 1; var prevMopen = ''; function selectClick(e) { var id = e.id; var aId = id.split('__'); 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_'+aId[0].replace('option_',''))) document.getElementById('gwp_div_title_'+aId[0].replace('option_','')).innerHTML = e.title; } else { document.getElementById(aId[0]).selectedIndex = '0'; if (document.getElementById('gwp_div_title_'+aId[0].replace('option_',''))) document.getElementById('gwp_div_title_'+aId[0].replace('option_','')).innerHTML = ''; id = ''; } 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.style.border = '2px solid transparent'; if ( c[i].id == id ) c[i].parentElement.style.border = '2px solid ' + selcolor; } } 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.style.border = '2px solid transparent'; if ( c[i].id == id ) c[i].parentElement.style.border = '2px solid ' + selcolor; } } 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 = type; } document.getElementById('gwp_more'+oid).innerHTML = type == 'block' ? less_txt[oid] : more_txt[oid] ; } function showGWP() { opt_list.forEach(function(opt_id) { var s = document.getElementById('option_'+opt_id); if (s && (!optTmp[opt_id] || optTmp[opt_id] != s.innerHTML)) { s.style.display = 'none'; optTmp[opt_id] = s.innerHTML; var sColors = ''; if (s.parentElement.className.indexOf('option_truestock ') != -1 && isStock == 0) { isStock = 1; const intervalGWP = setInterval(function() { showGWP(); if (s.value == 'wybierz') { var c30 = document.getElementsByClassName('c_option_' + opt_id); for( var i30 = 0; i30 < c30.length; i30++){ if (c30[i30].parentElement.style.border != '2px solid transparent') { selectClick(document.getElementById(c30[i30].id)); } } } }, 500); } sColors += '