var pmaWidgetInstance608a72763975337b9e788617 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4a3e1ede4ed3175730dcf3c0bcb5e13d:afb0c6a6967eccef87a02b66ffb1ce7fc56acd4ee9e7ffc47436d5890e550d2a0c4523b7f47ad29e04d9d7e8a623bc970e293da1ca4a692aebdf1a55e6caa71dbcb3866163e76692e2d36b5cd1e8b3c89e255a4fde1f134d6916f2ab92762c3a562588999c34e227b05e4e4b7355092a6f15d8dec15e62d9a1b14709035f67bbc6c0abe39fc9d1a8f1cbdedca1217bd9dc6da53384bbc19d2e2ba215041ee0bb2fdc09b7d561824a607e0f1a9180b73a09362902cdffd92d98dc94fc52d1c880d4c05b3f1f850f632b01839f8d193237", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "27,50 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance608a72763975337b9e788617.initWidget("608a72763975337b9e788617"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }