var pmaWidgetInstance5ff478a9d9685ed272675d38 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=47c3255c1c8795ca8aedab3314e3db67:036806709abbabca83683e5027325992062f65668cc2303af802e3dfdb7b69b3a70e1faa2557f3fae3954921f4fe1bc7773e6ba0981d2d4ce03d9d389f016832ce6f50ab2aa20b3a5bc0f47c0bbad6f692aa67b920e00dc2ca751b3add0a48051a6343022c7a7f14bf13c4d706feb878f866ed3659bc12c4df98cd1de00af28d8bf4f39ada9b0c56e702cc9cb56fbace13a556882b74dc2bc9068ba54b1045cc2e347c075edfe0493884884653854f007c2cc125b11f88faa9e72ad1ebe05907", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "27,29 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance5ff478a9d9685ed272675d38.initWidget("5ff478a9d9685ed272675d38"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }