var pmaWidgetInstance60cc16bd0067a2ef59d7e821 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2d335dd0934f708057c5245c9ffdf9fc:ba151b9f682a92c983f76884598ad359c3edb48f8cc1c1ae8a1b3aaba7eee4ffbef9f37b062d6bd8fd40ddd591e4f2cfdae51ae3fa065d905b11a7c76fcb6ce52cf486f388a8423dbbe90c23496e1b60fc551b01b4affcd7fb7e4ec0dc3eb075eaec8043eb896b2bab36e820dbf21faa30fe57a1f9fc86b22a0c26d7584a2bdda13ff9e2858ec3d457abd9a4882d6fb9dfe327e79a87fa1347a6e5ae7332a5b89258f903eea12b2453a97b081858b034a331b48a5ef0c0be473123cd443133586610ff42c781f5e47601861edb633ca6", shop_name: "biet.sk", shop_logo: "https://y1.sk/t/s/130x50/48619.jpg", product_price: "339,00 €", 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(){ pmaWidgetInstance60cc16bd0067a2ef59d7e821.initWidget("60cc16bd0067a2ef59d7e821"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }