var pmaWidgetInstance63eca6714218328905a6625c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3a08229e1cb169fb685503c3e2b15fb9:ede610e746ddabb2a347cbaf004ab44960487995cc22af48e65074e28814b39eb2b6cc8597c4e8a00ba5e93acf7a8edc832a751079152ca3241f4f946c80d3ee41fea90cfd3e169cd374ba20ac0c28791f6745a84313cd565f93d42bf5c0eb2c557193f52843adb2843148bcc1f1efb0ed3e15e902601857cf7a766fceb3248db3a5fa82f2ddb4e8cf3c1eea4949afb6f2a402631d13aca58f20967eac6e8f97dfaa0d01f9512b822728fa93648a1644ffdd3f66d4e85110511c7090673dc430", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "249,54 €", product_shipping: "34,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(){ pmaWidgetInstance63eca6714218328905a6625c.initWidget("63eca6714218328905a6625c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }