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