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