var pmaWidgetInstance6038e8c0d9685ed272529fe9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=33cc3064e848216a67da24853c685b7b:7d7c1907850814ff26f0e544bf3ac85802461edcec1629c4c861917491fa55b1afd3fffb48894400673854546ea92bc7d7b600deb0520a81b69256e8fd8c8ba1e7541424e2714094b32f605fe883ecbb33b35d1c94d3e7673a8b2fee1e195d87e24e1c1e5670d60193cee7aa074c850bc42213414dd0f73c3b8089b8dde1fca64a53ecae2fa6a0a48133b98ba814be1cc534a4029dbe480a206fe94dcc096b76544292856c03fe025af5f84805e07734e5f6b1ddf5ee392b3bf2bbc28873958f104948a9d4f4f43fe2e8305b717193d7", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "339,90 €", 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(){ pmaWidgetInstance6038e8c0d9685ed272529fe9.initWidget("6038e8c0d9685ed272529fe9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }