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