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