var pmaWidgetInstance654cca3e42183289050b8258 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bce7cb82ea573e260c8e9ea7bd15dc10:2a2cb3c916363eae809780d38d5660f270994bfcac013ad565fcb1d4705b39cda8c376fa63ed59be13b77bcd976919be724711086ac0adabfc1bd08e739c5b1d4a768bf8d6b37394546d5f47b3f9935cc75f3488e624afece9b626e365f197c2c1be64834eab050b999202758976842dd82480c2901a995fcbe32358ce820d1a4ce5300f8ad8730a6ad0f60b743b76ac32417738e01b7aee0fd6cb57a3ceae7cbaa8b2e2b7a6b42bf94b91062ea93f070eab484aefb1e4e2db225077b9c62348eaa908a4c3b0b5e9166028083f726001", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "15,04 €", product_shipping: "", 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(){ pmaWidgetInstance654cca3e42183289050b8258.initWidget("654cca3e42183289050b8258"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }