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