var pmaWidgetInstance60c7829b0067a2ef5921bce9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0758c5e8f4ea86cc7e943e634bca147d:aa6bc32d0949546de125b3ecd60dcaa84886a0c4f40b6e7f574c98e5148f2a1c907317cd2868b1fbee2bc4d803025ab7d932fd1763ce00d10fc02bf658218fe00f555a5e640f0f4fa4fe7f7afa9ecf85f39ba444db4b7cf4a7576109e3deea56ca6eec80e804c0a408bcde9cee678aa8b9aaa1bbda68d515d09b95e84e6e580084ca04ec7f55ee5345667acf8e59c56751bcb3ab7c87d71bcb21033bf0b026e1749cec9cc3c3a689e7173714730c1002c4f63ad59cd3e3bd7a4fd191348e983333dc25f244b9c2b1cecf02060a17aec8", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "795,90 €", product_shipping: "", 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(){ pmaWidgetInstance60c7829b0067a2ef5921bce9.initWidget("60c7829b0067a2ef5921bce9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }