var pmaWidgetInstance6144339a0067a2ef596cff68 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4b0ef638cc32cdbcd905e501efac422d:9403b62b9c8c7d6935d5a2f1eaf4e82b5e0c4b62032e744b788dd79bfe004bda424bbcd3ca80df5e61848a42ee13ef976634f7081c1b2fa682c26068856f3c27f85b16be47a6ccd7600697be55b4ca287a900b56830c0cfa8526e228d308c2b1a9d4f6d7978e180a4a36c0621d7f27e90cce7f1c30783ba69a9385f547d00c59763e9663b18eb55ee9907e265748b51e73196139e2c56abad49426a5594aa0b964b59f66e1b1acdf67da3f159d3bd3fcbef98e2ee8805eb4c07216bf29d6c17e338f03b6841c66d3055ed2b0dbf3c49c", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", product_shipping: "0,00 €", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance6144339a0067a2ef596cff68.initWidget("6144339a0067a2ef596cff68"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }