﻿
		/*
 * Copyright (C) 2025 ELB Learning
 */

	
function langUtils(){};var theLang=new langUtils();langUtils.prototype.getDefaultLocale=function(){return "en";};langUtils.prototype.getLocale=function(){var A=this;A.curLocale=A.getCookie('loLocale');if (!A.curLocale) A.curLocale=A.setCookie('loLocale',A.getDefaultLocale());return A.curLocale;};langUtils.prototype.setLocale=function(A){if (this.curLocale!=A){this.setCookie('loLocale',A?A:this.getDefaultLocale());window.top.location=window.top.location.href;}};langUtils.prototype.isLocale=function(A){return (this.curLocale==A);};langUtils.prototype.is={def:function() { return theLang.isLocale(langUtils.prototype.getDefaultLocale());},de:function() { return theLang.isLocale('de');},en:function() { return theLang.isLocale('en');},es:function() { return theLang.isLocale('es');},fr:function() { return theLang.isLocale('fr');},no:function() { return theLang.isLocale('no');},pt:function() { return theLang.isLocale('pt');},sv:function() { return theLang.isLocale('sv');},zh:function() { return theLang.isLocale('zh');}};langUtils.prototype.getLocalePath=function(A,B){var C=this;var D=(A?A:C.curLocale?C.curLocale:C.getLocale());var E=(D==="en"?'':'lang/'+D);B=(B&&B.length>0?(B[0]=='/'?B.substr(1):B):'');E=E+(E&&B?'/':'')+B;return E;};langUtils.prototype.getCookie=function(A){var B=document.cookie.indexOf(A+"=");var C=B+A.length+1;if ((!B)&&(A!=document.cookie.substring(0,A.length))) return null;if (B==-1) return null;var D=document.cookie.indexOf(";",C);if (D==-1) D=document.cookie.length;return unescape(document.cookie.substring(C,D));};langUtils.prototype.setCookie=function(A,B,C,D,E,F){var G=(C?C:21)*(60*60*24*1000);var H=new Date();var I=new Date(H.getTime()+G);if (!D){D=(window.theApp?theApp.getWebRoot(t):location.pathname.substring(0,location.pathname.indexOf('/',1)));D=D.replace(/[\/]*$/,'');};var J=A+'='+escape(B)+(G?';expires='+I.toGMTString():'')+(D?';path='+D:'')+(E?';domain='+E:'')+(F?';secure':'');document.cookie=J;return B;};langUtils.prototype.deleteCookie=function(A,B,C){if (this.getCookie(A)){document.cookie=A+'='+((B)?';path='+B:'')+((C)?';domain='+C:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';}};
