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