var pmaWidgetInstance64dc72d942183289057afb32 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d8318355e6c3e053990cbad4a91b821a:36395d54e171df0303b4398b510bc80e5c98c73b3a82968b3a49fc0381cdf1dc139fca4c2051fb6780cb8a8c23a8e97412e2c6d42a8d8881b7e0fcf3d3928db733e5e4addf9567f6a0fedfbd18f5c8e909fed290ed976fd864b8b04181528de411b0050ecfbfe65810b66b4af145b5f7e266af55688f1336dda9c90d612575a4ff0402535614c8105529e9318ce15aab2c1af721aa441c564ea4bcd571b171d3a39570516fac356e7ff5fe587cc740eb35be6d2ebc1886ed217a8dc41d86743583cde022cb2ae7156ea303efeabc69cd", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "46,95 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64dc72d942183289057afb32.initWidget("64dc72d942183289057afb32"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }