var pmaWidgetInstance600adffad9685ed272f40544 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=83cb5c14bd1a07ebc146960011eff5dd:6ef669b9200bf7169b09149abdc31e26df40fb10042d7171dc68efb9e179e41acb845cc44b723733767b9878c25291de2d0e114cfc8c428213b2b337474821b18f8cdcdaec30f95419f590a8c259c1b8c263aa56ff8fd3fdc73e13130e07f793ce613bc0f0f95fb71c95ab7c6d5d607249c91aa0cb68ba944017a9fee6b7c978e03915e12c93b215f8b9ae77cceb4fee85abf12cddde12e17e51a67705a5229a6dea86f728a281f187564368d698d4f9d07c10b490d3d5db59c952846296d9e5e52a5c9779400cda57453e5bef197c78", shop_name: "biet.sk", shop_logo: "https://y1.sk/t/s/130x50/48619.jpg", product_price: "339,00 €", product_shipping: "0,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(){ pmaWidgetInstance600adffad9685ed272f40544.initWidget("600adffad9685ed272f40544"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }