var pmaWidgetInstance650994d84218328905fe39c1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d2a8a083a166912348b12872b9d8b8f3:4fbc6fb9a6d7e0f9d27740d254100831e3df48e1cfc575c337c95c5a5dc9283d2e893f77d2eb1514646b9b29602b115b6028db929aa4db37a2f283d3af3709c119da607acbf7943921a9b0e3aab7203fa497d2a75c86fa34831649322af9a87ec8e614f94caf25108661e5866f997ed8247c4b00b6af542ea8b4f041b1bc7ba7a38dcefaeab569a734dd8bec5da8942feff69ab0bcc2f8d80a9e769c60b74e02f9ae8141ac04957491569466435e8117bf5c128ea9d820bc2fae68fe1696af0bc46d8861cfed28de332544b7cb3bd961", shop_name: "kotollacno.sk", shop_logo: "https://y1.sk/t/s/130x50/52905.jpg", product_price: "1146 €", product_shipping: "0,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(){ pmaWidgetInstance650994d84218328905fe39c1.initWidget("650994d84218328905fe39c1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }