var pmaWidgetInstance64d9bd294218328905815806 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f3b8f94e189237ced6dacfe66916781a:24ef08ede5bcf24a7f2e3078a6672203c232d3fee6844f1502a7050f5435c049d20e250098708467ec04b27e9dd0229e0448ac6f16dabd6f6e0a6bfd63c30d89244e5e83ca65108858e4b3a1a79fc22c31797f632de756aeff8c03c33f17e61f8bfb5d739bb35d0f3ae6598009a8705ed5387f557215d9666d47d2116b0115353a64b017cced9d7ddc351d4276da50ef18f3f6c6ddea9d3fa13aba3fa7fe0918e603fe316619b012161ddf2e5738e9944cfbf756bf939cfec8151fa01c3389788c1ea5f6fb1454cde9e236bfac548148", 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); } }