var pmaWidgetInstance64d9bd294218328905815806 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7ebfcead9795eae0a73c0d4b7c91869c:0968ae0e046c0da9ff5be53055d04efab6cc7fd226d9166de7ea74dcd0a549a5cf244cc317d74f661d685b854bb301a50be17abb7545911b5733e65f46b693a2bb9b5b4e9695aef6ef8381b0a97b6fea4a9670cab9e9d23ca522ef0cef36fb3caaccefd019934380b0b7358bb6ac2f6d61275a3e712f8db32c341bbda809eeb22973526e15e9fe86cc90089b4fffd7a09ca84e2218075e9b328bae3e924bd24fdeaa6b18cfb36d2510c1aadbc537b8c975a82ce05635e9ad769d7a533e6120652504f78fc18fae8f03901001c851e91e", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "109,99 €", product_shipping: "0,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(){ pmaWidgetInstance64d9bd294218328905815806.initWidget("64d9bd294218328905815806"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }