var pmaWidgetInstance6075913fd9685ed272852327 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=157d45b789935cc4ac936169a3f75d33:87ef47e7170bbfe51d3049110f6ffa1233cd86651dc0d51f59c29041d639acc8ec6b8e74a60126824d904ae6e2896be643aa6740e6ab6a7505c073358f9cf71b79dc0d21bf7e6067d1ebaf92f9bda8a2aca7f72cb87b40c0f77ac0e4f1327a29022729fcea45b43b2087193f8d11e7863fbdc42288b08bbc24c957bd4adf9023997e0879e0ad410a1ae40a269d33c175970ee15f9368db3cfe22c9736321e57313b65944d0c7475e59b33d22c25848246b88f1e110f1070613fc4efbf3c575c652dd0e537bb79b7d0a10932178dd5dff", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "300,19 €", 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(){ pmaWidgetInstance6075913fd9685ed272852327.initWidget("6075913fd9685ed272852327"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }