var pmaWidgetInstance63f9d9e542183289059c824f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51ab3c7430a6adbe944c43090b84f600:e17947ea2a5606010f90dd97732777508c17694c70a0f86978aec3db6c060b2ead8d8c2d809f34fcd6e46da2413e06f3894c9401b9048616ae39fb3abadee636f5b0d913068cea48f6c20d956ecd57f36aed14ff5dd5f82c7d6604bae4411d5944d65be6e9f125ced3e5021979b3a1bc3f3a159b7e966c4cfe2327a24e2458ecae89eab6ac6334fa94ff005a6769f40ee8a45ba0a57320bae82df83e2cc2256ec8de491ac7fcea51e5987415492ce2b7a1dcedff2eeaccfcc5b3c00e6055d7f66dbd0e9aa120749d6107a8f4f2d89161", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "92,90 €", 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(){ pmaWidgetInstance63f9d9e542183289059c824f.initWidget("63f9d9e542183289059c824f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }