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