var pmaWidgetInstance608a6a013975337b9e4ccec9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1c02b693abc8aa50ed380cabd5eba229:280d77c7c028d30c0aa71d99e168643516ae32333b45ebffb2413bad01d654ec621bf08cdc1cfc4f783d4caa93e0583a1086427811393956640431e02836a3f06f91c22e9087098d555c630de7503227c732fa237159f8d327b35c8e086e08dd2b1b0b7c274b31098225defa0f4467b6e5968945a1e866f95f02312cc42c0b2b6ac819e7590751433628e5d6870e5794a7d787dd3a1a4c0fef948c2f4e149ef57b05c07931d0fa7a103a0268ea1d18dbdfcc03ac35b61f66fcfa93371d1b4491", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "194,00 €", product_shipping: "4,50 €", 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(){ pmaWidgetInstance608a6a013975337b9e4ccec9.initWidget("608a6a013975337b9e4ccec9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }