var pmaWidgetInstance64ae74e4421832890530edca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ac5bc41a71b46362ce25d97b68734efa:e26292f692f1808fa2f900b11b1696b52c18471eec58a4a0a352e8314b0d2c0739c69303c13fc207804c03f050d700363e1f5ec8670f098136a712f1a30ac265105b797707b40fc561287d090f6e91b82fe35fae46188b8fb3b6baccc06959534b49df69c9c74aa1e80c2b62f85ce799e6ccf84c95c6074cca65f88c924b29aabfb87c1c30ef76328edb65090cad0893aac7b426d60386a4d527b2ceca51cbedf7d26dc117d802e8e9ab93b905cb211b824aacba58d5c04308c8597b4b02ba309dc874a73e49361afcbc8880900ccedc", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "197,86 €", product_shipping: "4,40 €", 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(){ pmaWidgetInstance64ae74e4421832890530edca.initWidget("64ae74e4421832890530edca"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }