var pmaWidgetInstance6040c95cd9685ed272f12a71 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=123b921f41a95369c2b0b5dc9dc855be:01036f28dbad02f1a29bcbd9f80eeed95903a8c5d8e5961bce1b0fa296f42eba80cd1f56230846e40c7fb7f65e54cb0a204196ff2bace8f9b322f3785f591511e7aa6380167090e7a079521fe13e016726ea36e3678985dd72a3ddc3753a0a8442c9bb6bde31ddbaf51d6c37c10295361dea9b8c4c2d4db7dc707bbeeed8ba56ff2fa036dd237e1a19b5234fd6441724acc652e1cf53951f2aedb28c5765791a32e4587c1ff072dec07f286b568bffb8b1d7281cac7a74be626c3129d52ce6ea", shop_name: "Odpudzovače.sk", shop_logo: "https://y1.sk/t/s/130x50/59075.jpg", product_price: "42,80 €", product_shipping: "", 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(){ pmaWidgetInstance6040c95cd9685ed272f12a71.initWidget("6040c95cd9685ed272f12a71"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }