var pmaWidgetInstance5fca7ec9d9685ed2720a99db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b213827885117d651d1f619d3c6da92c:783a0ffd70346d3f6e6e56db16d5982bf751bc52f3237c2297c2242046a33a4a03834b6099ea887f886ab4f15c1ae441f44ade662144f6a3bc43774f8de239b09073ab6ee21cb768bae032a89888a802a5be79a7837e01fbc6af63f098d7cda2ea4b02cbe4da0e025c147cf0e442479ec2a631d79810b00abda6aa18b6f1f711980494c3c2d24c949ab74257429bce6afab035d5719ea43a8e32ec711ce178ff03cfb3ee6302c6fa1549c8dea74e5314dba9fb3c414f859b16480f9c7ed68a1963178f000b42255144d3e69903db37b6", shop_name: "Supermobily.sk", shop_logo: "https://y1.sk/t/s/130x50/10067.jpg", product_price: "125,00 €", product_shipping: "3,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(){ pmaWidgetInstance5fca7ec9d9685ed2720a99db.initWidget("5fca7ec9d9685ed2720a99db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }