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