var pmaWidgetInstance63579f46ac365ae37428bf7b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7aba41219bf36c09f372aaeae0f4bb33:f812f63010d8c34db18e091c1a210221385da0d2676d7a5a40eaab03f259a0d478a6c8f2acadb81e3b9cf65355f8a32ebf2d42ab79d80c3afb88080cc8440d2857674d0c62509a8aba64667a7f3f0209bf56a9934dbf43b0b0bce130e88c30b1a67cd146ee42c1b327754510790b5b7e6e47ddba9d856cc759502d6f845d1906963c6cb64bba9be0577c1164729278e247ddb30a829f88d15e1b3043ca38190581102675ff6fe475ff3f52ccfdb52fb6e556d2443c4ecadc10ef8fcf2620ba6f874bab51f0d99434ebd75539146245ef", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "9,37 €", product_shipping: "", 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(){ pmaWidgetInstance63579f46ac365ae37428bf7b.initWidget("63579f46ac365ae37428bf7b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }