var pmaWidgetInstance604b38b4d9685ed2720ca5c9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a271989cc5708a4f3e6a82f7c746d4f7:db854de494ae2b3f49b58dfeb7fee231085df952e3eff9402bedd41aea3e23ea49d3fe545720dbfc1576497f68c04b9ada81e52f4568207b3a57c0ee8e1adf470170679a321d538239d876c1931a71581423729679342810a5981179bd922c1c59f765dc9eb5449a90a806ae5a5e3b2bf7d171ff6ccbafe165f80522ea276e25c8a1d46479b6f0efdaac7c25ddd0e32697aab4b642acd154cc5c2fffb5f9f176700eaa829ca48c7da573123927f2567a88287376db4210d342732e028eb42f3f", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "78,59 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance604b38b4d9685ed2720ca5c9.initWidget("604b38b4d9685ed2720ca5c9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }