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