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