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