var pmaWidgetInstance6033c49ad9685ed2720c53d1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e4d5f0a0a284515c0a0115490fff1729:1fda7180f4b4ee69fa76c90e96294a384f624ba4354818f58723c23528789a18384c0c2ca908821116e13b0d804f2417fae559c46d0ccda272e1fee79fa34d8e1cdeebd54c6060907a886c100e2708b08e38901d4bd7b9d4c5e1d262adec4c5ec74548ab32a571376094db1fab2a00cd9876685535964e0c302d949373aa8fb89317bfed547984fb65e463d0b88041e45e9440c17a4a3dba8bc6376d82c1982e2e17568983dc7dfb9934e292439e2b2a4756424c1ebbffc76babe0d067b8a51819e8e66c6c56087b5b0a159ab8a94edb", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "258,40 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance6033c49ad9685ed2720c53d1.initWidget("6033c49ad9685ed2720c53d1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }