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