var pmaWidgetInstance60334254d9685ed272790e4d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=53414eea9d195ea77e4e76203aec1f32:cf479d5affae17162e41af2653e797f3331b694ced535bfaa452a29ba13eb586268012e9b2eee82a18159effc288db4a1181971ffc806077062aa6f2a7191c35fb9f99a86965228a5c86c14d74da245e14939053f0f42241d98f9a6e8757aac77fe32c0ea029c8db554445cef4fc0c13a03bd3cbca9b995ca90bc0e181d6142e7c2890d5b3f14a4eb606f0f54d66bc1c50aa89b60c88a72303c41e2888c4770154020c50eab1acd3a31c130e6287a8e61f6cf87f2e5b4f66a18e515427ef4c6199913e0780ddc07220fdc6fa7250b26f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "69,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(){ pmaWidgetInstance60334254d9685ed272790e4d.initWidget("60334254d9685ed272790e4d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }