var pmaWidgetInstance6075913fd9685ed272852327 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2621252231ba0cb2075c6e7dbeca613c:02947773eb4bef3756994b5a7057bed6b1227b7f1b21df77e602154d3c08c7d6ffccd9f2d8b69e8364507414d7d29b7c42244eddeac974bc0a3a46fb561a67e63e1fbb67d5477916129092dcafc940dbd9ae03049c855f4c32d91a1f864177a703ade1494538085934f117fa86499d08fc602822cd2ca2877146e64cd9981c7a7f9664f814715ca7517009bbeb8e0545d8b4eade4c82b5cc3c8e39b9bb40c1ef960579d7786f2dec18b82d78ffb7471f0a5019888281a82e11a9413db4386639d5eb2a207330e8032a9514cae1557295", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "300,19 €", 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(){ pmaWidgetInstance6075913fd9685ed272852327.initWidget("6075913fd9685ed272852327"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }