var pmaWidgetInstance6373a0bdac365ae374bd7662 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4150118c2d621f1ef38601dc478691e1:be97d96c946fd0314c3f34b464471cf43a7ed8c16a973f7feeebe6bda8a50e1b8ec06f17bfa0ab20989ed9658bef26d15e9337b9d762cc08a43b506823db4caf6e70c5d849bad1e44f7630a5cfde9851542669974ccf9b16f52d7a639fbeb7a39bfed63a5a706265f8b2cb0124da18351496111c1a77e0b3f1bdf72a11518384f490394835ed87c2235a4013bc83acb896a97236246b929b4f57891a29088b60de0013bf0208d1444c33c21a61100ccc4476d610a2ca702fe7238ce7938da3a8bf53466c1103cbdb5b5b7fa6ce0112dc", shop_name: "tonerpartner.sk", shop_logo: "https://y1.sk/t/s/130x50/53619.jpg", product_price: "281,42 €", 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(){ pmaWidgetInstance6373a0bdac365ae374bd7662.initWidget("6373a0bdac365ae374bd7662"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }