var pmaWidgetInstance65788000ae16db34668fb0a4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5335076413914510e2b3f73597ff2e48:1e4da138db6ad0411b47403179c033fd39470dc8bd7ec77cdac92cd3d49628f1218fb0afde140e84b0595cdc47542ae399fbd3e907e0486f287f5b6659f685b1a2561291da69dbcc1fc0690cbef461193e053b8cb427fa20e3c55323d26f646d18b040bd122b986f0a540647a2f0aaefb37164f4fc07e1488338532b32c33820c7b0a81281e008e65a9858d7ae8deb66b144c2a8bce67867cfcbb21e0e23acabcee84176a44fb26b20480c0a1071a068fdbbc7a3ee614a7d0117794f8ad9cafbe51f92921d519091f467abb5bffd4d79", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "358,90 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance65788000ae16db34668fb0a4.initWidget("65788000ae16db34668fb0a4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }