var pmaWidgetInstance650d34f54218328905066f5b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=66f67a0ec793425adc27354f4cb797b3:350e9dfe2e0dc974e87f25e7db160c381d5dc4809d128107e80a20bdbee0eb246c81f2c4896c5c037ec3efccfc0be5fc425f2f9a07aa6464426797c000734c0415ddd556fd58b45154d76b50563473ca8e5f7d988f43c7678d4b001497f666d3209658154b88d1fadb499919187f34dbac10030f9ff54f478f40fe030a13d7f2d38d2f1f71c205a8261f136786603c412ac3a6b9236d81c1288c5f626161d95d946a6a6ded0fcb313782602a8780082fc821e37b6027b0c65d723906419c750ee56607f69621eb3568a65f2f85b01b1b", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "16,10 €", product_shipping: "4,90 €", product_availability: "Skladom", 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(){ pmaWidgetInstance650d34f54218328905066f5b.initWidget("650d34f54218328905066f5b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }