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