var pmaWidgetInstance5ff478a9d9685ed272675d38 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c0c259c3ea723b780267176184d5b36b:74171c3014a267cf3b133b5e5cb7c930ff546823beb41271dbee6529aa29f8cfc8d37a4b31a972954144e6f49ecfba41bb1c65bcbfc690ad19822cd774052c1e973d25ab0bb61cad331ffe61643ae95bcddcb924efbb0c2d7b241f2e713e3cebe1905b5514ea8659c98e806da260941650dbd33e814546560f813577d299e3823eea13b6f860b44cee04e0ae06201bc376390d6a6154bcd695f204ef7d4aec9a889ba7ab985c3dcea6a315072d36d5957a40566d7c1bb810be61b7b1a19c4a8b", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "28,87 €", product_shipping: "4,00 €", 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(){ pmaWidgetInstance5ff478a9d9685ed272675d38.initWidget("5ff478a9d9685ed272675d38"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }