var pmaWidgetInstance6076a2ddd9685ed2723b1198 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ad49347a6b717a621a541f30f399a1d9:c66f9ed39f4faa53a728c20f5f64b768c12a4b7b75e6472f5ab7446a740f3d83c6f00469ff353dbb5d769d0f3fa3b8fa36d480d3efe87af9ca3bdfd70fc872e8d9a98f8b05eea8dc54170df53fa21097413853152987f719222f19a025b8f16abb42c3b6e60455d372517acdfb2b76f7aa94b8844589d4cc6aea26577ce67316edb1e689bed37d98a8971897c84aaad5423bd22cdf772084f650f7354f88827dfaee32d090a3e99222720844788794770aad212cdc9d13531ffb12201f49373154c13afc78d14b283fca4a6b6f94c8d6", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "379,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(){ pmaWidgetInstance6076a2ddd9685ed2723b1198.initWidget("6076a2ddd9685ed2723b1198"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }