var pmaWidgetInstance60742adbd9685ed2721cf892 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=59dcd6328c43ac707a7d27b9a873baf5:ba9978ef204fb9c24e4c127e6019dd300e2f38dbbed07351a0db42b52683c28610a9147a4f03813cbc682ad5c61c8fe28177b0cd5825cd92ee65edcf87a620d572e483ebcdd67d471250cccc5faeaa3d5b0f98568f967f409b9f301d387d7c1fc03dddbb92ec8e997e9b5e558b76ca0206398842309d260282c0c6214a3d8147cd16f3757b8dbaf8537667ccc18bf2a91753bf312b4a63b0556c7a736f030e75df21988d237c7b719ed9f1c8f9236821b3b74f09d41530b4680d88a71e50e8b751d6b4bf8d3967209f6cf594a93c6f26", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "238,00 €", product_shipping: "1,00 €", 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(){ pmaWidgetInstance60742adbd9685ed2721cf892.initWidget("60742adbd9685ed2721cf892"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }