var pmaWidgetInstance6075913fd9685ed272852327 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2a556fc6777e7e4a4a8651372be53e3e:4f7e095d25a4dfa1016cf3d490ba3da875891b76bea18bff3b285f2e1e127ff84689d34c7c6dabfd53121251e4bf217babb4e61b8b318a1d6e6e79707044c79276fa7740d6bffe4df7c8e86e77b0330f18ba8de6f3f9a21085d4d2310d5622fde9378b45efdd9f55942ddc0ef8a0277206d43f5eaccbe362747c9faef86c4de07c94d1a46070b5fa4f19919b01a84fe27afd867daacbd270c01f8651a38b22300dd51bc46d05f6e24a6c9fe94d9b6364a88fa12773125804627ad761e77b2b00bf200858891c1f9fecb78b8cf0c7232c", 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); } }