var pmaWidgetInstance5fcde97ed9685ed272162750 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3ab538f43c6eea47fabb1d0d79c6973b:8f52aa395863df2f16f88d47b8238f1bded9463ca0e6626a40a1289a6b28e8146c2ccac30e50dfd6df8bb13c471e87d171459342d2f0bd70ccd9c4664b5fa10eb46347713b6f1e6f3a621f3ec89e55019f0cd42d758a591b59046ff79203cea165e5b10a7123b27991c58f9f0a461ee7f81ea5214efe8d15d7e46d8f0f6613663e83125460be905a04e8cfd865f543a19cf35f56cc2d4b0bee6e1aad1991c6ce367b81a54fa5f621c6a1b0b138d2784d7964ba7d70a493a75cb4091e9b096eca", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "38,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(){ pmaWidgetInstance5fcde97ed9685ed272162750.initWidget("5fcde97ed9685ed272162750"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }