var pmaWidgetInstance6006b1b5d9685ed27244ade9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ef03035a2c7db66c56e0ff8199bb1214:40be543b473ab3ab0b1fd4c55381055bae86ef1d808d55c1b1a7b45c0ade4890ac85889501b679d967047117c319e816d2d7d0ebad1603f3102edb503c64f589cbe0e0a4e5f72f378822ded2a507d5a6933f1d9c515f15b4cd2287fbbb09a48169f932d71eba0056dee0b93f47a3216054a8c239b7550963f0ad812ab960e2ab574cd1d630c2336afb11ff0688822f3cffa8a99b69a21d5eac36c6f1bee906337476dfa08d20df0472afa5cf84f411d84857d92b4ed49a9277aff28ea0b852b8", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "62,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(){ pmaWidgetInstance6006b1b5d9685ed27244ade9.initWidget("6006b1b5d9685ed27244ade9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }