var pmaWidgetInstance606d6d97d9685ed272bc35db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=41918c607565e84c909c593a7b41a6e2:ab5981a76c2182b43cad9cc2b2840b375d44173c912a514ad1122d5ab5973dd50cf7f48602a21dcda857e810489f6f159faf3efa1c08cc3836ce559762466c9d7509b3bee4ede218b870b6cdfd5fc17fddd9377b3f92afa44a7b9164aa9d9ab23bf12b3b678deb33b1b18a946212481bf00f80cae51a0e89ca619d9fd161d4e111fc2f864fb3ea94cd55a6cf635b0b8b28ceaa1973e931b26ef2711cbeb92b72a9eb8174278afc73febd70f8944c965b7aed2d21d5fbd755d0d359a19c5fd02998c9a978e505de59a1b1e790dfbfd41b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "1069 €", 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(){ pmaWidgetInstance606d6d97d9685ed272bc35db.initWidget("606d6d97d9685ed272bc35db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }