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