var pmaWidgetInstance6033c49ad9685ed2720c53d1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cdd2a279835c0d15e19e1072adf714b6:0abad1638778c20adb1ed4ee49b549cc78eb36d3c14b1963596d966d3b30b54cdffc29a017d2b7ed1ee0d5df4f91fbae424fbe631b43a08a2f9d2f4dcabb22e02a3596cf7a990d795d3306ff44d9189ea63e6bbb89e82d64e0e47ed1c0f7448442dcf0a124e98c7c5b6f3800e082b3186b6e2fd43c535c3abf23be725dbc9900bcdaa8c73acf9597bfd653d70d10f8730583135a91fae276ae2361ebdf39a17cf09db1bbd561c4dc6362fa26acaaee16d31bb002fb589bd5efb524650f83e198", shop_name: "PriemyselnyTovar.sk", shop_logo: "https://y1.sk/t/s/130x50/50813.jpg", product_price: "297,00 €", 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(){ pmaWidgetInstance6033c49ad9685ed2720c53d1.initWidget("6033c49ad9685ed2720c53d1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }