var pmaWidgetInstance603e49bad9685ed27274091e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b2c9005627b5653d8dd3004e68d25fad:d00947108c0cb27125faed61326fe7f27d7f1b101f7164fefb97fed91cd09c27d0b92366b8b0039c50e45e29756d64abb037ff0e11ae138b42b8e909a1626eaac146da6bbe98776c494e30342716179c404cd093236b3bb1cea4f433ef7f6c6a63c539e21bd36b5298b0394a4436ec337a6e839efd3f0885a2f1928871d22927dd451ee5697434612b6f2b13dac08db26d76357950036ea4b12907858829d81e5671de41349838c92a6ca4506109cf8faf18ec0640cd994c7b6b587db6cb8539", shop_name: "Gorila.sk", shop_logo: "https://y1.sk/t/s/130x50/107.jpg", product_price: "9,30 €", product_shipping: "2,97 €", product_availability: "", 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(){ pmaWidgetInstance603e49bad9685ed27274091e.initWidget("603e49bad9685ed27274091e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }