var pmaWidgetInstance5fd0caafd9685ed272c07e36 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fa1639761de29d4bcb244844e0d15590:33d2bc181e85b5afa8cdafa58b63ad975212813b7c01b4a6ddddaac688de8762454ac64f5a3e3654c3603d6e07b5982f2c49228ff169f08fad429388c80813687cd7099c3ee924328bbc4d50393cf34f9c5dfd6348faa8df4ba7d9f5a5fd089b53c09cb171c9296fe644e40fe0be1712a9d26a020fd0c3a66a71c86d18976b0ff9dd9fc4cc27e01bbdb0f050c1f0b5b6a1c2e4be09b1748c8d8a475858029cddb65a707861768540841f23d3876c767b52fe89d62f42a010395b911a2b0e9719", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "289,90 €", 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(){ pmaWidgetInstance5fd0caafd9685ed272c07e36.initWidget("5fd0caafd9685ed272c07e36"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }