var pmaWidgetInstance5fc9f631d9685ed2726132f8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=acd9211b2178e9530f84d7f8202d0b86:4e08917eef205694670e07a198442b9e0eda5f52d441c7a20f54133b74e9ac52adb39f9627b786f8f8ca7d88426cc9231eb1119981f6028a5ad9b06e2768652c93fff0341a791c55eda660353288972a8d2bd4932a0fab592bdae843a40693ac8ffda15efffac97663a9e2ab78fb9bb1b70f66580da296585ba74d5c322bd5dabe28bd85086ffecdffa70a70d74ecb0a203817067e21de40c83669c64ef89a53429eb5ec8ba4fa238aacaa921265cdff3f09771f7025f44319e28e980c25fb71", shop_name: "madgamer.sk", shop_logo: "https://y1.sk/t/s/130x50/49087.jpg", product_price: "19,60 €", 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(){ pmaWidgetInstance5fc9f631d9685ed2726132f8.initWidget("5fc9f631d9685ed2726132f8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }