var pmaWidgetInstance605374fed9685ed272925037 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d7c4fce401de365e1d3c52f713539046:24f41b1191163d2440bf2cd9b1cb23b6de0a7c30cdcb46305fd9b5c4ecb7f743d71111cdd696282edab40f367cfca8948510e5245aa51612f081520414597c2b36bfad5b0f3c5569f260d180c212a765dcc4ffe255c90404db57afbeb5962d3ec8ff695aa4cb1684ddfa02c3cd173d2f2852beef314a108d4cb25a8c74bcc3b5ea0dfbb6d02a7c3f6a0ee69ec5bd51efd18008cff64c7baa68311cceb2cff759c05d224655b3411709652e0b6543d04593336f7571df7b3ff728507e8ca92dfd4ed893dfbd4b4c1e8bb18f1232a86bc6", shop_name: "cykloabc.sk", shop_logo: "https://y1.sk/t/s/130x50/5842.jpg", product_price: "339,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance605374fed9685ed272925037.initWidget("605374fed9685ed272925037"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }