var pmaWidgetInstance654cd13342183289052cf393 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1ea9b0c28772650c46c2ce5ae168569c:0e8ea55d86a4be600b0760adb206c6ff370a45e9d07ab668c64301f2e80cbf0c200a651d9163c15c1190334d4464141764de8cb6c2dec42db7b4591953009f3db8fd389fe8f938991ec63c830bb9f0eb672937309f6f7d52c07281f9963a617cfbc35f5f60a5ce01db66445a0fe16156ed3910fa2a6fd56b453afd05062a31f16980c71bac120fb829edf474fe2ec7abfb68686d4924ea4c7918e10070e7084faed07e56cd227e93e5b0a19e04b1f96968f6ab7a4b9b3cc472125120e57b82c43c94ba183763a19dd56355cc4cfed539", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "9,27 €", 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(){ pmaWidgetInstance654cd13342183289052cf393.initWidget("654cd13342183289052cf393"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }