var pmaWidgetInstance654cc9ac421832890507fc57 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fa074b25785b15fdf7efa5435ac6742e:18c32895cf9c4eb033a8b7adc7c2e82e5e6a4ea84b7ef2d942fc3b55611a7a2e066f85712b32efc9829769519309c64b93feb014dcfe1c7b92432538b2916a84fcdd9c2366c74cb43175f1788f9c91a29ee7ae8c3a0afdfacb7ea584ee627bf720845574acb63967ae34a06104c8cb6b0b9e6240d8c1017cf0820ef443cb2669114aea64114a0b266f4e3032cdd345ff5376d3f9117899c20fc21dc3fcb4f232d6f6325ab4392e60a9056d60a94a88435953009fc441c89be147514c8920bec4d2fee3f034158227270d5c626a32b54a", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "7,95 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance654cc9ac421832890507fc57.initWidget("654cc9ac421832890507fc57"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }