var pmaWidgetInstance60436030d9685ed2722dafe1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3a2daff0500e45dd11d00f69ca70db20:7432ae3b3085a1c1eb056fe57d2884eb92416cf8ebd32a743f53a24b41160206f8b4ba0b6a74de621fea525b052dc84b14b9cf5a5eb2d264c5c04dd808ef00a22b0cb1e9db5f37c3b677492d2c6756e26180ef7b1eb48422a15a154275c364d2493dea08ba65e60999fc58b4757211be363048f4af82dc012a4f6818fd6cd165665d28b33b9bf719b1c9dddf407e99b811cb0a6995c31f2ab606bd2cbfa1dbed535ccc172baedff5da642a5f9f31aa685b36242377b775dc77fcfce6321e62e9e75be97fdeb1e9b513aef46c9342ea7b", 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(){ pmaWidgetInstance60436030d9685ed2722dafe1.initWidget("60436030d9685ed2722dafe1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }