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