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