function setCookie(name,value,expires,path,domain,secure,samesite){name='skycms_'+name if(location.protocol==='https:'){secure=true} 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){cookieName='skycms_'+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((!e.shiftKey&&e.keyCode===9)||e.keyCode===39||e.keyCode===40){e.preventDefault();}} function blockFocusBack(e){if((e.shiftKey&&e.keyCode===9)||e.keyCode===37||e.keyCode===38){e.preventDefault();}} function createPolicyFile(){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",URL_CLIENT_REQUEST,true);xhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');xhttp.responseType='blob';xhttp.send(data);} function acceptCookie(){const days=12,infoPageLayer=document.getElementById('infoPageLayerModal'),dialog=document.getElementById('cookieDialog');setCookie('cookie_modal',1,days,'/','',0,'Lax');setCookie('cookie_modal_expiration',+new Date()+days*864e5,days,'/','',0,'Lax');if(infoPageLayer){infoPageLayer.setAttribute('aria-hidden','false');infoPageLayer.setAttribute('tabindex','0');infoPageLayer.focus();} if(typeof dialog.close==='function'){dialog.close();}else{dialog.removeAttribute('open');}} function acceptCookieEnter(e){if(e.key==='13'){acceptCookie();}} function ajaxErrorResponse(response){if(response.status===419){document.open();document.write(response.responseText);document.close();}} function showCookieModal(){const dialog=document.getElementById('cookieDialog');let date=+new Date(),expiration=ReadCookie('cookie_modal_expiration');if(typeof expiration==='undefined'){setCookie('cookie_modal',0,-1,'/','',0,'Lax');}else if(date>expiration){setCookie('cookie_modal',0,-1,'/','',0,'Lax');setCookie('cookie_modal_expiration',0,-1,'/','',0,'Lax');} if(ReadCookie('cookie_modal')==='1'){if(typeof dialog.close==='function'){dialog.close();}else{dialog.removeAttribute('open');} document.getElementById('cookiePolicy').removeEventListener('click',createPolicyFile) document.getElementById('cookieAccept').removeEventListener('click',acceptCookie) document.getElementById('cookieAccept').removeEventListener('keydown',acceptCookieEnter);}else{if(typeof dialog.showModal==='function'){dialog.showModal();}else{dialog.setAttribute('open','');} document.getElementById('cookiePolicy').addEventListener('click',createPolicyFile) document.getElementById('cookieAccept').addEventListener('click',acceptCookie) document.getElementById('cookieAccept').addEventListener('keydown',acceptCookieEnter);}} function acceptBipCookie(){const days=12,infoPageLayer=document.getElementById('infoPageLayerModal'),dialog=document.getElementById('bipCookieDialog');setCookie('bip_cookie_modal',1,days,'/','',0,'Lax');setCookie('bip_cookie_modal_expiration',+new Date()+days*864e5,days,'/','',0,'Lax');if(infoPageLayer){infoPageLayer.setAttribute('aria-hidden','false');infoPageLayer.setAttribute('tabindex','0');infoPageLayer.focus();} if(typeof dialog.close==='function'){dialog.close();}else{dialog.removeAttribute('open');}} function acceptBipCookieEnter(e){if(e.key==='13'){acceptBipCookie();}} function showBipCookieModal(){const dialog=document.getElementById('bipCookieDialog');let date=+new Date(),expiration=ReadCookie('bip_cookie_modal_expiration');if(typeof expiration==='undefined'){setCookie('bip_cookie_modal',0,-1,'/','',0,'Lax');}else if(date>expiration){setCookie('bip_cookie_modal',0,-1,'/','',0,'Lax');setCookie('bip_cookie_modal_expiration',0,-1,'/','',0,'Lax');} if(ReadCookie('bip_cookie_modal')==='1'){if(typeof dialog.close==='function'){dialog.close();}else{dialog.removeAttribute('open');} document.getElementById('bipCookiePolicy').removeEventListener('click',createPolicyFile) document.getElementById('bipCookieAccept').removeEventListener('click',acceptBipCookie) document.getElementById('bipCookieAccept').removeEventListener('keydown',acceptBipCookieEnter);}else{if(typeof dialog.showModal==='function'){dialog.showModal();}else{dialog.setAttribute('open','');} document.getElementById('bipCookiePolicy').addEventListener('click',createPolicyFile) document.getElementById('bipCookieAccept').addEventListener('click',acceptBipCookie) document.getElementById('bipCookieAccept').addEventListener('keydown',acceptBipCookieEnter)}} 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 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(typeof fullCode!=='undefined'&&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 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 bindTargetBlankConfirmation(message){document.querySelectorAll('a[target=_blank]').forEach(function(item){item.addEventListener('click',function(event){if(!confirm(message)){event.preventDefault();return false;}})})} function redirect(url){window.location.href=url;} function getCsrfTokenJs(){let csrf='' let meta=document.querySelector("meta[name='csrf-token']").getAttribute("content") if(typeof meta!=="undefined"&&meta.length>0){csrf=meta} return csrf} 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,'/','',0,'Lax');window.location.reload();})}) document.querySelectorAll('.disable-wcag').forEach(function(item){item.addEventListener('click',function(event){event.preventDefault();setCookie('wcag_contrast_type','',-1,'/','',0,'Lax');window.location.reload();})}) document.querySelectorAll('#printArea table:not(.table-static)').forEach(function(item){item.outerHTML='