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