function setCookie(name,value,expires,path,domain,secure,samesite){document.cookie=name+"="+escape(value||"")+(expires?";expires="+new Date(+new Date+expires*864e5).toUTCString():"")+(path?";path="+path:"")+(domain?";domain="+domain:"")+(secure?";secure":"")+(samesite?";samesite="+samesite:"")}function ReadCookie(cookieName){let theCookie=" "+document.cookie;let ind=theCookie.indexOf(" "+cookieName+"=");if(ind===-1)ind=theCookie.indexOf(";"+cookieName+"=");if(ind===-1||cookieName==="")return"";let ind1=theCookie.indexOf(";",ind+1);if(ind1===-1)ind1=theCookie.length;return unescape(theCookie.substring(ind+cookieName.length+2,ind1))}function blockFocus(e){if(!event.shiftKey&&event.keyCode===9){e.preventDefault()}}function blockFocusBack(e){if(event.shiftKey&&event.keyCode===9){e.preventDefault()}}function showCookieModal(){let date=+new Date;let expiration=ReadCookie("cookie_modal_expiration");let modal=document.querySelector(".cookie-modal");if(typeof expiration==="undefined"||date>expiration){setCookie("cookie_modal",0,-1,"../index.html","",0,"Lax");setCookie("cookie_modal_expiration",0,-1,"../index.html","",0,"Lax")}if(ReadCookie("cookie_modal")==="1"){if(modal!==null){modal.style.display="none";document.body.classList.remove("cookie-modal-open");document.getElementById("cookieAccept").removeEventListener("keydown",blockFocus);document.getElementById("cookieText").removeEventListener("keydown",blockFocusBack)}}else{if(modal!==null){modal.style.display="flex";document.body.classList.add("cookie-modal-open");document.getElementById("cookieAccept").addEventListener("keydown",blockFocus);document.getElementById("cookieText").addEventListener("keydown",blockFocusBack)}}document.getElementById("cookieAccept").addEventListener("click",function(e){let days=12;modal.style.display="none";document.body.classList.remove("cookie-modal-open");setCookie("cookie_modal",1,days,"../index.html","",0,"Lax");setCookie("cookie_modal_expiration",+new Date+days*864e5,days,"../index.html","",0,"Lax")});document.getElementById("cookiePolicy").addEventListener("click",function(e){let data="Action=GET_PRIVACY_PDF&page_id="+this.getAttribute("data-page-id");let xhttp=new XMLHttpRequest;xhttp.onload=function(){if(parseInt(this.status)===200){let blob=new Blob([this.response],{type:"application/pdf"});let url=URL.createObjectURL(blob);window.open(url,"_blank").focus()}};xhttp.open("POST.html",URL_CLIENT_REQUEST,true);xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhttp.responseType="blob";xhttp.send(data)})}function showBipCookieModal(){let date=+new Date;let expiration=ReadCookie("bip_cookie_modal_expiration");let modal=document.querySelector(".bip-cookie-modal");if(typeof expiration==="undefined"||date>expiration){setCookie("bip_cookie_modal",0,-1,"../index.html","",0,"Lax");setCookie("bip_cookie_modal_expiration",0,-1,"../index.html","",0,"Lax")}if(ReadCookie("bip_cookie_modal")==="1"){if(modal!==null){modal.style.display="none";document.body.classList.remove("bip-cookie-modal-open");document.getElementById("bipCookieAccept").removeEventListener("keydown",blockFocus);document.getElementById("bipCookieText").removeEventListener("keydown",blockFocusBack)}}else{if(modal!==null){modal.style.display="flex";document.body.classList.add("bip-cookie-modal-open");document.getElementById("bipCookieAccept").addEventListener("keydown",blockFocus);document.getElementById("bipCookieText").addEventListener("keydown",blockFocusBack)}}document.getElementById("bipCookieAccept").addEventListener("click",function(){let days=12;modal.style.display="none";document.body.classList.remove("bip-cookie-modal-open");setCookie("bip_cookie_modal",1,days,"../index.html","",0,"Lax");setCookie("bip_cookie_modal_expiration",+new Date+days*864e5,days,"../index.html","",0,"Lax")});document.getElementById("bipCookiePolicy").addEventListener("click",function(e){let data="Action=GET_PRIVACY_PDF&page_id="+this.getAttribute("data-page-id");let xhttp=new XMLHttpRequest;xhttp.onload=function(){if(this.status===200){let blob=new Blob([this.response],{type:"application/pdf"});let url=URL.createObjectURL(blob);window.open(url,"_blank").focus()}};xhttp.open("POST.html",URL_CLIENT_REQUEST,true);xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhttp.responseType="blob";xhttp.send(data)})}function loadScript(url,callback){let head=document.getElementsByTagName("head")[0];let script=document.createElement("script");script.src=url;script.onreadystatechange=callback;script.onload=callback;head.appendChild(script)}function createDatePicker(selector){$.datepicker.setDefaults({dateFormat:"dd-mm-yy"});$(selector).datepicker({})}function createDateTimePicker(selector){initTimepickerLang();$.timepicker.setDefaults({dateFormat:"dd-mm-yy"});$(selector).datetimepicker({})}function createTimePicker(selector,step,minuteMax){initTimepickerLang();$.timepicker.setDefaults({timeFormat:"hh:mm",stepMinute:step,minuteMax:minuteMax});$(selector).timepicker({})}function getLanguageCode(fullCode){const languages=[{id:"1",code:"pl",codeFull:"pl-PL"},{id:"2",code:"en",codeFull:"en-US"},{id:"3",code:"de",codeFull:"de-DE"},{id:"4",code:"fr",codeFull:"fr-FR"},{id:"5",code:"ru",codeFull:"ru-RU"},{id:"6",code:"cs",codeFull:"cs-CZ"},{id:"7",code:"uk",codeFull:"uk-UA"},{id:"8",code:"sk",codeFull:"sk-SR"},{id:"9",code:"zh",codeFull:"zh-CN"},{id:"10",code:"es",codeFull:"es-ES"},{id:"11",code:"ro",codeFull:"ro-RO"},{id:"12",code:"hu",codeFull:"hu-HU"},{id:"13",code:"it",codeFull:"it-IT"},{id:"14",code:"es",codeFull:"es-ES"},{id:"15",code:"bg",codeFull:"bg-BG"}];const langId=ReadCookie("LanguageId");let langItem=languages.filter(function(item){if(item.id===langId){return item}else{return false}})[0];let code;if(fullCode){if(langItem){code=langItem.codeFull}else{code="pl-PL"}}else{if(langItem){code=langItem.code}else{code="pl"}}return code}function initTimepickerLang(){let code=getLanguageCode(false);loadScript("/cms/assets/js/timepicker/jquery-ui-timepicker-"+code+".js",$.timepicker.setDefaults($.timepicker.regional[code]))}function initBootstrapCalendarLang(){let code=getLanguageCode(true);loadScript("/cms/assets/plugins/bootstrap-calendar-master/js/language/"+code+".js")}function clearInput(input,action,defaultValue){let object=$(input);let value=jQuery.trim(object.val());if(action==="focus"){if(value===defaultValue){object.val("")}}else{if(action==="blur"){if(value===""){object.val(defaultValue)}}}}function redirect(url){window.location.href=url}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".enable-wcag").forEach(function(item){item.addEventListener("click",function(event){event.preventDefault();setCookie("wcag_contrast_type","black-yellow",12,"../index.html","",0,"Lax");window.location.reload()})});document.querySelectorAll(".disable-wcag").forEach(function(item){item.addEventListener("click",function(event){event.preventDefault();setCookie("wcag_contrast_type","",-1,"../index.html","",0,"Lax");window.location.reload()})})});