var pmaWidgetInstance603f7e01d9685ed272e4eb52 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7ea71bd023eb7a09d87e9d5dacb56958:635996f8e218ef809c6f849c7e583fe27ef69fa9e2598f7b44dff4a7c9da654c7367476937b3a12008535299f1587abbdb3b6f342da5aeba89b2a17b5bd82ec0e64a19164194d2085a578aa2191b537e88e3ac82c762fe638a5a3f1cce24a0858a5185e5e031fa1ad20b7088fd7efb090f9561f5cd6e31fd5309a6f0f26f66314588f8bcb1e910ec53c9dd914995a7ce7b946e2a5070dac5c21d3cd4c5529b301884aa4c6f2289ce42d98af6c117d9b7004a45c62c5daaf557bd2d34e05365ab", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "220,00 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance603f7e01d9685ed272e4eb52.initWidget("603f7e01d9685ed272e4eb52"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }