var pmaWidgetInstance606449cfd9685ed272cbd023 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=362ae06f59eb9801d06e225bed24c91b:42b27359d05d46c59b3f1c2fb4938cc2c4744e78723bfa213735899e95fcad057812ce574286cfebbaf74a7381bbfcbf788797367bd4a69eab2c5b97003617e38a41821e780daa4b6e51f4c08435379d5c3463abb1619f15f1616f59aee6850948b08b6ce82f06f88d16de29371ac7c03daa0c6dfa830254ab5c4c94d3475bca404bae0f957a6b8ae6cf2d5db88c0eef27c30041acc5c54432a940203dddaf55bac594928f7137af9c43d33856349a1a7ee6735573d526998433ea1e5f5673efdc5bdbae4186adcda0c3ecca60bf2f7e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "1099 €", product_shipping: "", 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(){ pmaWidgetInstance606449cfd9685ed272cbd023.initWidget("606449cfd9685ed272cbd023"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }