var pmaWidgetInstance610289cc0067a2ef5981827a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2f6d2eaa1ee33213a5a97d3211bb7dfa:50232208c89ef62304bc24e95f66174f205755a191064cc5a168a3f63cf219f8c6a9ac384f1558f371978ccfd1482652b2516da4101d9c194dea48a731933226fa28d4b200aa424e33489b8e1056f9d46c9ca7f08009c3aa63dcba08fa7faab31e04fb0c235220f1c8cffc1b22664be2338916f0b4c87a2fb2b487a859a71b1eb5756d2631b096ad23de529a2e3fee86b36b53539ec023c6f9e186d1b0670b320d5c376cda520a7cbce4ef6faa2a3fffe32fbad777494a403ec2f113c630f343091ed4dde778c76a6157f03b13621178", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "219,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(){ pmaWidgetInstance610289cc0067a2ef5981827a.initWidget("610289cc0067a2ef5981827a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }