var pmaWidgetInstance619ba0b1069a975de57c977e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f5b5cb1c4cd0ccec0271116858ae6894:c9e1ea6af88d2ee87d61d98a3060549aba3ea5e4ab9ae9f77ceea9c1f8af761352920de2fbda2f87c793984fcd2c8d3e0347f3fe3d845e6ea6cdede2cfcbf310733067f1cc24b417c19536a0b6aa117eda2158df7dbe31fe2e1db92b75f593837e199ee97a9f9ca53bbfe43d13a8c8b0f6419a9491366071a77b53e86aa833524b7270219424d2b8f299b2754b2a0bd40b8fa048ed93183f5872c1d6cce719145435b046020f263715cf33a0836aaf13c5212686839eef1ab76132435a126d90", shop_name: "vecickypredeticky.sk", shop_logo: "https://y1.sk/t/s/130x50/57272.jpg", product_price: "147,11 €", product_shipping: "4,50 €", 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(){ pmaWidgetInstance619ba0b1069a975de57c977e.initWidget("619ba0b1069a975de57c977e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }