var pmaWidgetInstance6357a7acac365ae374818a8e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=78139d10b4b083a9263a855c3e9b22b2:7d5732533e7d19781b85ee7917fd2823ade9bf3fcf5da7ae73c8514db2fe718927f921a2a51f284cf5a2da134ea705c431b19f0105a755d3028e4e9103bc95b1870fd9f4122d1a26ef871ec72cda1d402630a9b926893b6cb8aab478300d6c9e8373c8d1526bfadc5fe41748193bcfd22a3b763133674bc2d118c886d8853c083c6a111510eb4546ddb89e845c25bd34a3f2ca009822f0783355800034e9a433ffceee707cddcdebb9ef90f4d18f3a09264d5375b8c8ead238aa4990cba84c215c319e5f907c80fc7385d39461338acd", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "12,66 €", 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(){ pmaWidgetInstance6357a7acac365ae374818a8e.initWidget("6357a7acac365ae374818a8e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }