var pmaWidgetInstance608bfba23975337b9ef8e3af = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d32f248b0dcad392795ebd38bbdba6e9:0134f32ccca34757ff016eb2364605b99276b28f2fde94bacef647347c0efca7a4da553b8f66573548eb6e158e6f9075d8a2857f5236a5dfc2e35b848f324eeb0bd28a68cb65c0f7ad9560780cc575d541061cb5b4398abe3dd04d67d80d8b27b21686d8f887b6c5d2cbdcd0db664e4c25018e73a5bfda0d39c5565bbea7097ac282a87550938b1bb133155d9f9b1738a4789cecf7abc407e023978cf169b270fe77d4f73d7d8f2c6e23528492c94f4514acd61b3da988cfde01709e5d8cb71c97d8b08546e3cc9247d99877cca0d832", shop_name: "predomyazahrady.sk", shop_logo: "https://y1.sk/t/s/130x50/47035.jpg", product_price: "344,87 €", 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(){ pmaWidgetInstance608bfba23975337b9ef8e3af.initWidget("608bfba23975337b9ef8e3af"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }