var pmaWidgetInstance600af078d9685ed2725a4ef5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=32db05fce7ffde79638faf679a2aee55:32a75b21dc601f64531f35b3cf98fc4373056a78577661ff0c884184e52d33de0425c0b31722aa2e4aa46d0b0868a0a06c7de3a02ec7cc28bc8422f22b5df4e6deb426d1da236c6242ca9c9e5b6236e688b679cf89be05b465644c706be85966c88f56fd6b56ae05e564774d6ca90e8bac1548956193cec99f7f0986cd44ab68cb0e9403f1c51b5c72bdf4a6977f7988b73eacfaad05b3068835946c689f6504f65cac6d1d602c23d6e9e77a52d83eec745c1ba6e2415cff4faf1c1cc22213e8", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "359,00 €", 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(){ pmaWidgetInstance600af078d9685ed2725a4ef5.initWidget("600af078d9685ed2725a4ef5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }