var pmaWidgetInstance6040d4bdd9685ed2720e0d2e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ec956ec9bd0ca26661917b74e586c998:ba2865bfbb5554f8498a5b5f7c40e83abce42c515b6610d5933bb470d620059a9fbb3b7c410d920340e7a615f9474762fb5afe6a73288c527be82706197f6c5c881f11972117634fa6f5b01cc6abf2bfe09ac53bdb2f0609704eb88b33d25d8d14480491fbb01462f2a71897c27f97b8ae9a1e0c5c75580c10daf00e161f4a368e39026f1824aa979966eb6557a96686759dddf165268c0b7ab6f3c8d8c963600c5651795096d436c60d7b9c6bed2087a9a6ebb57aebcb070816e13a491eda116d3bf8689bb52a5cd30c3b3c0923aeeb", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "754,90 €", product_shipping: "", product_availability: "Skladom", 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(){ pmaWidgetInstance6040d4bdd9685ed2720e0d2e.initWidget("6040d4bdd9685ed2720e0d2e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }