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 #000000 !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:-155px; width:150px; 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 = {232: "3", 233: "3", 435: "1", 434: "1", 283: "1", 284: "1", 294: "1", 295: "1", 129: "1", 130: "1", 616: "4", 617: "2", 620: "2", 621: "1", 619: "2", 618: "2", 624: "1", 622: "2", 623: "1", 625: "1", 626: "1", 723: "2", 734: "2", 725: "4", 733: "1", 732: "1", 727: "2", 731: "2", 728: "3", 724: "2", 726: "2", 730: "2", 729: "3", 711: "2", 722: "2", 713: "4", 721: "1", 720: "1", 715: "1", 719: "2", 717: "3", 718: "2", 716: "3", 712: "2", 714: "2", 735: "3", 736: "2", 737: "5", 738: "2", 739: "1", 740: "3", 741: "3", 742: "2", 743: "2", 746: "2", 745: "1", 744: "1", 1154: "1", 1155: "1", 1156: "1", 1157: "1", 1428: "2", 1429: "2", 1430: "2", 1431: "2", 1432: "2", 1433: "2", 1434: "2", 1436: "3", 1435: "2", 1437: "1", 1438: "2", 1439: "2", 1440: "1", 5058: "1", 5059: "1", 5057: "1", 5060: "1", 5054: "1", 5053: "1", 5056: "1", 5052: "2", 5055: "1", 5051: "1", 5094: "1", 5095: "1", 5093: "1", 5087: "1", 5090: "1", 5089: "1", 5092: "1", 5091: "1", 5088: "1", 5086: "1", 5096: "1", 5105: "1", 326: "1", 5113: "1", 5115: "1", 5124: "1", 5126: "1", 5132: "1", 5133: "1", 5134: "1", 5135: "1", 5136: "1", 5137: "1", 5138: "1", 5139: "1", 5140: "1", 5141: "1", 5174: "1", 5175: "1", 5173: "1", 5172: "1", 5166: "1", 5167: "1", 5169: "1", 5168: "1", 5171: "1", 5170: "1", 5155: "1", 5158: "1", 5156: "1", 5157: "1", 5150: "2", 5152: "1", 5151: "1", 5149: "1", 5153: "1", 5154: "1", 5339: "1", 5337: "1", 5338: "1", 5340: "1", 5336: "1", 5335: "1", 5334: "1", 5333: "1", 5332: "1", 5331: "1", 5330: "1", 5357: "1", 5358: "1", 5356: "1", 5350: "1", 5353: "1", 5352: "1", 5355: "1", 5354: "1", 5351: "1", 5359: "1", 5376: "1", 5373: "1", 5371: "1", 5374: "1", 5375: "1", 5372: "1", 5379: "1", 5380: "1", 5377: "1", 5378: "1", 5394: "1", 5390: "1", 5389: "1", 5386: "1", 5388: "1", 5385: "1", 5387: "1", 5392: "1", 5391: "1", 5393: "1", 5412: "1", 5402: "2", 5403: "1", 5406: "1", 5405: "1", 5408: "1", 5407: "1", 5404: "1", 5409: "1", 5410: "1", 5411: "1", 5421: "1", 5420: "1", 1326: "1", 5425: "1", 5426: "1", 5427: "1", 5428: "1", 5422: "1", 5423: "1", 5424: "1", 1272: "1", 1271: "1", 1273: "1", 5439: "1", 5441: "1", 5440: "1", 5436: "1", 5435: "1", 5438: "1", 5437: "1", 5434: "1", 5433: "1", 5470: "1", 5471: "1", 5472: "1", 5474: "1", 5473: "1", 5475: "1", 5476: "1", 5478: "1", 5479: "1", 5477: "1", 5480: "1", 5481: "1", 5458: "1", 5457: "1", 5456: "1", 5463: "1", 5462: "1", 5465: "1", 5467: "1", 5468: "1", 5466: "1", 5459: "1", 5469: "1", 5461: "1", 5460: "1", 5464: "1", 5534: "1", 5545: "1", 5536: "1", 5535: "1", 5532: "1", 5533: "1", 5543: "1", 5539: "1", 5538: "1", 5541: "1", 5540: "1", 5537: "1", 5542: "1", 5544: "1", 5546: "1", 5547: "1", 5548: "1", 5549: "1", 5550: "1", 5551: "1", 5552: "1", 5554: "1", 5553: "1", 5555: "1", 5556: "1", 5557: "1", 5581: "1", 5580: "1", 5590: "1", 5589: "1", 5588: "1", 5587: "1", 5584: "1", 5585: "1", 5586: "1", 5582: "1", 5583: "1", 5577: "1", 5578: "1", 5579: "1", 5591: "1", 5592: "1", 5593: "1", 5594: "1", 5595: "1", 5596: "1", 5597: "1", 5599: "1", 5598: "1", 5602: "1", 5601: "1", 5600: "1", 5646: "1", 5647: "1", 5648: "1", 5649: "1", 5650: "1", 5651: "1", 5652: "1", 5653: "1", 5654: "1", 5655: "1", 5657: "1", 5656: "1", 5635: "1", 5636: "1", 5638: "1", 5637: "1", 5639: "1", 5640: "1", 5641: "1", 5643: "1", 5642: "1", 5644: "1", 5645: "1", 5680: "1", 5681: "1", 5682: "1", 5713: "1", 5712: "1", 5711: "1", 5714: "1", 5720: "1", 5715: "1", 5716: "1", 5717: "1", 5718: "1", 5719: "1", 5721: "1", 5722: "1", 5723: "1", 5724: "1", 5725: "1", 5781: "1", 5782: "1", 5783: "1", 5794: "1", 5795: "1", 5796: "1", 5797: "1", 5798: "1", 5799: "1", 5800: "1", 5801: "1", 5805: "1", 5803: "1", 5804: "1", 5802: "1", 5784: "1", 5785: "1", 5786: "1", 5787: "1", 5788: "1", 5789: "1", 5790: "1", 5791: "1", 5792: "1", 5793: "1", 5806: "1", 5812: "1", 5864: "1", 5890: "1", 5838: "1", 5859: "1", 5885: "1", 5833: "1", 5807: "1", 5808: "1", 5834: "1", 5809: "1", 5835: "1", 5861: "1", 5860: "1", 5886: "1", 5887: "1", 5888: "1", 5862: "1", 5836: "1", 5810: "1", 5813: "1", 5839: "1", 5865: "1", 5891: "1", 5825: "1", 5824: "1", 5850: "1", 5851: "1", 5877: "1", 5876: "1", 5901: "1", 5902: "1", 5907: "1", 5882: "1", 5856: "1", 5830: "1", 5906: "1", 5881: "1", 5880: "1", 5905: "1", 5854: "1", 5855: "1", 5828: "1", 5829: "1", 5816: "1", 5868: "1", 5893: "1", 5892: "1", 5867: "1", 5841: "1", 5815: "1", 5818: "1", 5844: "1", 5831: "1", 5832: "1", 5857: "1", 5883: "1", 5884: "1", 5858: "1", 5870: "1", 5895: "1", 5909: "1", 5908: "1", 5904: "1", 5879: "1", 5853: "1", 5827: "1", 5826: "1", 5852: "1", 5878: "1", 5903: "1", 5889: "1", 5910: "1", 5896: "1", 5897: "1", 5898: "1", 5899: "1", 5900: "1", 5894: "1", 5875: "1", 5869: "1", 5874: "1", 5873: "1", 5872: "1", 5871: "1", 5866: "1", 5843: "2", 5840: "1", 5842: "1", 5849: "1", 5848: "1", 5847: "1", 5846: "1", 5845: "1", 5837: "1", 5811: "1", 5814: "1", 5817: "1", 5819: "1", 5820: "1", 5821: "1", 5822: "1", 5823: "1", 5863: "1", 5911: "1", 5935: "1", 5923: "1", 5912: "1", 5924: "1", 5936: "1", 5925: "1", 5913: "1", 5937: "1", 5938: "1", 5926: "1", 5914: "1", 5915: "1", 5927: "1", 5939: "1", 5940: "1", 5928: "1", 5916: "1", 5917: "1", 5929: "1", 5941: "1", 5930: "1", 5918: "1", 5942: "1", 5919: "1", 5943: "1", 5931: "1", 5920: "1", 5932: "1", 5921: "1", 5944: "1", 5945: "1", 5933: "1", 5946: "1", 5934: "1", 5922: "1", 5970: "1", 5971: "1", 5972: "1", 6228: "1", 6229: "1", 6230: "1", 6231: "1", 6232: "1", 6233: "1", 6234: "1", 6235: "1", 6236: "1", 6237: "1", 6238: "1", 6239: "1", 6227: "1", 6217: "1", 6218: "1", 6219: "1", 6220: "1", 6221: "1", 6222: "1", 6223: "1", 6224: "1", 6225: "1", 6226: "1", 6214: "1", 6215: "1", 6216: "1", 6271: "1", 6272: "1", 6273: "1", 6274: "1", 6275: "1", 6276: "1", 6277: "1", 6278: "1", 6279: "1", 6281: "1", 6280: "1", 6282: "1", 6283: "1", 6284: "1", 6285: "1", 6286: "1", 6287: "1", 6288: "1", 6289: "1", 6290: "1", 6291: "1", 6292: "1", 6293: "1", 6325: "1", 6326: "1", 6327: "1", 6328: "1", 6329: "1", 6330: "1", 6331: "1", 6332: "1", 6333: "1", 6334: "1", 6335: "1", 6322: "1", 6323: "1", 6324: "1", 6336: "1", 6337: "1", 6338: "1", 6339: "1", 6340: "1", 6341: "1", 6342: "1", 6343: "1", 6344: "1", 6345: "1", 6347: "1", 6346: "1", 6357: "1", 6358: "1", 6359: "1", 6360: "1", 6361: "1", 6362: "1", 6363: "1", 6364: "1", 6365: "1", 6366: "1", 6375: "1", 6376: "1", 6377: "1", 6378: "1", 6379: "1", 6380: "1", 6381: "1", 6382: "1", 6383: "1", 6384: "1", 6397: "1", 6398: "1", 6399: "1", 6400: "1", 6401: "1", 6402: "1", 6403: "1", 6404: "1", 6406: "1", 6405: "1", 6419: "1", 6418: "1", 6417: "1", 6409: "1", 6410: "1", 6411: "1", 6412: "1", 6413: "1", 6414: "1", 6415: "1", 6416: "1", 6420: "2", 6421: "2", 6436: "1", 6437: "1", 6438: "2", 6439: "1", 6443: "2", 6444: "1", 6442: "2", 6441: "1", 6440: "1", 6448: "1", 6445: "1", 6446: "1", 6447: "1", 6471: "1", 6467: "1", 6468: "1", 6472: "1", 6469: "1", 6473: "1", 6470: "1", 6474: "1", 6458: "1", 6449: "1", 6450: "1", 6459: "1", 6451: "1", 6460: "1", 6452: "1", 6461: "1", 6453: "1", 6462: "1", 6466: "1", 6457: "1", 6465: "1", 6456: "1", 6454: "1", 6463: "1", 6455: "1", 6464: "1", 6822: "1", 6817: "1", 6818: "1", 6819: "1", 6820: "1", 6821: "1", 6823: "1", 6824: "1", 6825: "1", 6826: "1", 7298: "2", 7297: "2", 7296: "2", 7290: "1", 7293: "2", 7292: "1", 7295: "2", 7294: "2", 7291: "1", 7306: "1", 7305: "1", 7307: "1", 7300: "2", 7299: "2", 7301: "2", 7303: "1", 7302: "1", 7304: "1", 7776: "1", 7668: "2", 7666: "2", 7667: "2", 7662: "1", 7665: "2", 7663: "4", 7664: "3", 7661: "1", 7660: "1", 7786: "1", 7785: "1", 7784: "1", 7783: "1", 7790: "1", 7789: "1", 7788: "1", 7787: "1", 8311: "1", 8144: "1", 8142: "1", 8143: "1", 8141: "1", 8308: "1", 8309: "1", 8310: "1", 8307: "1", 8306: "1", 8305: "1", 8138: "1", 8140: "1", 8139: "1", 8135: "1", 8302: "1", 8303: "1", 8304: "1", 8137: "1", 8136: "1", 8155: "1", 8154: "1", 8145: "1", 8334: "1", 8330: "1", 8321: "1", 8312: "1", 8331: "1", 8335: "1", 8332: "1", 8336: "1", 8333: "1", 8337: "1", 8157: "1", 8156: "1", 8146: "1", 8313: "1", 8322: "1", 8314: "1", 8323: "1", 8147: "1", 8148: "1", 8324: "1", 8315: "1", 8316: "1", 8325: "1", 8149: "1", 8150: "1", 8326: "1", 8317: "1", 8318: "1", 8327: "1", 8151: "1", 8152: "1", 8153: "1", 8329: "2", 8328: "1", 8320: "2", 8319: "1", 8782: "1", 8783: "1", 8784: "1", 8794: "1", 8795: "1", 8796: "1", 9000: "1", 8999: "1", 8998: "1", 9185: "2", 9188: "3", 9186: "1", 9183: "1", 9187: "1", 9184: "1", 9189: "1", 9196: "1", 9195: "2", 9192: "2", 9194: "1", 9193: "2", 9191: "1", 9190: "1", 9209: "2", 9206: "2", 9204: "1", 9205: "1", 9210: "1", 9207: "1", 9208: "1", 9202: "2", 9202: "2", 9203: "1", 9201: "1", 9200: "1", 9199: "2", 9197: "1", 9198: "1", 9220: "2", 9220: "2", 9222: "1", 9221: "1", 9236: "1", 9237: "1", 9235: "1", 9231: "1", 9229: "1", 9230: "1", 9217: "1", 9218: "1", 9219: "1", 9213: "1", 9212: "1", 9211: "1", 9216: "1", 9214: "1", 9215: "1", 9225: "1", 9224: "1", 9223: "1", 9234: "1", 9233: "1", 9232: "1", 9226: "1", 9228: "1", 9227: "1", 9247: "1", 9246: "1", 9248: "1", 9249: "1", 9250: "1", 9251: "1", 9464: "1", 9465: "1", 9463: "1", 9460: "1", 9462: "1", 9459: "1", 9461: "1", 9458: "1", 9457: "1", 9466: "1", 9830: "1", 9831: "1", 9832: "1", };var opt_list = [61,128,70,75,28,171,191,190,192,226,227,269,366,369,372,80,212,85,375,378,381,386,388,390,392,395,397,246,400,403,404,405,411,412,413,423,424,425,437,438,442,447,446,454,455,456,457,458,459,460,461,462,463,467,480,479,478,489,488,498,497,496,502,505,508,510,511,514,515,516,517,518,519,530,545,554,580,571,572,573,581,582,583,584,592,595,600,603,604,606,605,610,615,613,609,607,608,611,614,612,620,621,635,653]; var more_txt = [], less_txt = [], optTmp = [], optTmpVal = [], isStock = 0; var changeStock = 0; var sid = '429'; var gwpurl = 'https://gwp.brweb.pl/i/index.php?path=/i/429/'; var imgLimit = '100'; 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; } 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 += '