var pmaWidgetInstance603f6635d9685ed27240136c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c62c8c4638fa02a26b5ba7eea125978d:eadfb94e500171d45fae86c647bb899169293f6c89ba627974026d1cea1d5e46f2484b68303685cb73c10ab1f1be7444150c39016437f20405397aebd887490192757f7691e7452f5d5449c6e6e16eeee54ee453aa1edcef339f24a9b5ac7adbc1da6189608172c197fa188bb3d67cf5c04382bad7b89e8683dd2302d65d86137b4555773c1cb0ebda23bd4e3097e1aa7f650780c15beed3aa6968af23db4392f413a7f53be02cac9f2a33323354f50194fd13c5b800bee0262e9b3ea9a0a8f8", shop_name: "krmiva.sk", shop_logo: "https://y1.sk/t/s/130x50/10049.jpg", product_price: "79,10 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance603f6635d9685ed27240136c.initWidget("603f6635d9685ed27240136c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }