HTTP/1.1 200 OK
Content-Type: text/javascript


var langLab = {
	langHttp:null,
	selectedLang : 0,
	put : function(lbl)
	{
		if(langLab.langLbl[lbl.toLowerCase()] != undefined)
		{
			if (langLab.langLbl[lbl.toLowerCase()][langLab.selectedLang] !="")
				document.write(langLab.langLbl[lbl.toLowerCase()][langLab.selectedLang]);
			else
				document.write("------");
		}
		else
			document.write("??????");
	},
	get : function(lbl)
	{
		if(langLab.langLbl[lbl.toLowerCase()] != undefined)
		{
			if (langLab.langLbl[lbl.toLowerCase()][langLab.selectedLang] != "")
				return langLab.langLbl[lbl.toLowerCase()][langLab.selectedLang];
			else
				return "------";
		}
		else
			return "??????";
	},
	langLbl : {
		"login":["Login","Anmelden"],
		"log in":["Log in","Einloggen"],
		"password":["Password","Passwort"],
		"alarms":["ALARMS","Alarme"],
		"no active alarms":["No active alarms","Keine aktiven Alarme"],
		"no alarm history":["No alarm history","Kein Alarmverlauf"],
		"active alarms":["ACTIVE ALARMS","Aktiver Alarm"],
		"alarms history":["ALARMS HISTORY","Alarm Historie"],
		"menu":["MENU","Menue"],
		"visualisation":["VISUALISATION","Visualisierung"],
		"main pages":["MAIN PAGES","Hauptmenue"],
		"hmi menu":["HMI MENU","HMI Menue"],
		"settings":["SETTINGS","Einstellungen"],
		"http access":["HTTP Access","HTTP Zugriff"],
		"ip configuration":["IP Configuration","IP Konfiguration"],
		"rs-485 configuration":["RS-485 Configuration","RS-485 Konfiguration"],
		"modbus over ip (to master)":["Modbus over IP (to master)","Modbus über IP (to master)"],
		"modbus over ip (to slave)":["Modbus over IP (to slave)","Modbus über IP (to slave)"],
		"bacnet":["BACnet","BACnet"],
		"system":["System","System"],
		"logout":["LOGOUT","Abmelden"],
		"device":["DEVICE","Geraet"],
		"click for alarm confirmation.":["Click for alarm confirmation.","Klick für Alarmbestaetigung"],
		"current password":["CURRENT PASSWORD","Aktuelles Passwort"],
		"admin settings":["ADMIN SETTINGS","Administrator Einstellungen"],
		"set new login(could be empty)":["SET NEW LOGIN (COULD BE EMPTY)","Neues Login setzen"],
		"set new password":["SET NEW PASSWORD","Neues Passwort setzen"],
		"confirm new password":["CONFIRM NEW PASSWORD","Neues Passwort bestätigen"],
		"http port":["HTTP PORT","HTTP Port"],
		"change":["Change","Ändern"],
		"mode":["MODE","Modus"],
		"port":["PORT","Anschluss"],
		"static":["Static","Statisch"],
		"ip address":["IP ADDRESS","IP Adresse"],
		"net mask":["NET MASK","Netzmaske"],
		"default gateway":["DEFAULT GATEWAY","Standard - Gateway"],
		"protocol":["PROTOCOL","Protokoll"],
		"baud rate (bauds)":["BAUD RATE (BAUDS)","Baudrate (BAUDS)"],
		"stop bits":["STOP BITS","Stop BITS"],
		"parity":["PARITY","Parität"],
		"modbus encapsulation":["MODBUS ENCAPSULATION","Modbus Datenkapselung"],
		"bacnet instance":["BACNET INSTANCE","BACnet Auswahl"],
		"bacnet ms/tp network number":["BACNET MS/TP NETWORK NUMBER","BACnet MS/TP Netwerkadresse"],
		"bacnet/ip port":["BACNET/IP PORT","BACnet IP Port"],
		"bacnet/ip broadcast ip":["BACNET/IP BROADCAST IP","BaCNET/IP Senden IP"],
		"mac address":["MAC ADDRESS","MAC Adresse"],
		"firmware version":["FIRMWARE VERSION","Firmware Version"],
		"mac setting":["MAC setting","MAC Einstellungen"],
		"default mac":["DEFAULT MAC","Voreinstellungen MAC"],
		"mapped mac":["MAPPED MAC","Abbild MAC"],
		"on":["ON","Ein"],
		"off":["OFF","Aus"],
		"trend logs period ( min. )":["TREND LOGS PERIOD ( MIN. )","Trendprotokolle (min)"],
		"elp online setting":["ELP ONLINE SETTING","ELP Online Einstellungen"],
		"device id":["DEVICE ID","Geräte ID"],
		"device name":["DEVICE NAME","Geräte Name"],
		"error description":["ERROR DESCRIPTION","Fehlerbeschreibung"],
		"disabled":["Disabled","Behindert"],
		"tcp server":["TCP Server","TCP Server"],
		"tcp client":["TCP Client","TCP Client"],
		"remote host":["Remote host","Fernadresse"],
		"modbus routing":["Modbus routing","Modbus routing"],
		"none":["None","Keiner"],
		"even":["Even","Sogar"],
		"odd":["Odd","Ungerade"]
	},
	put2class : function (){
		//document.querySelectorAll(".langLabel").forEach(function f(o){o.innerHTML = langLab.get(o.dataset.lbl)});
		Array.prototype.slice.call(document.querySelectorAll(".langLabel")).forEach(function f(o){o.innerHTML = langLab.get(o.dataset.lbl)});
		//document.querySelectorAll(".actuator-container").forEach(function f(o){o.dataset.title = langLab.get(o.dataset.title)});
		Array.prototype.slice.call(document.querySelectorAll(".actuator-container")).forEach(function f(o){o.dataset.title = langLab.get(o.dataset.title)});
	},
	getDeviceLang : function (){
		langLab.langHttp = new XMLHttpRequest();
		langLab.langHttp.onreadystatechange=function()
		{
			if(langLab.langHttp.readyState==4)
			{
				if (langLab.langHttp.responseText.length > 20)
				{
					document.getElementById('flag').style.display='none';
					return;
				}
				var l = "EN";
				var indx = parseInt(langLab.langHttp.responseText);
				switch(indx)
				{
					case 1:
						l = "DE";
						langLab.selectedLang = indx;
						break;
					default:
						l = "EN";
						langLab.selectedLang = 0;
						break;
				}
				langLab.put2class();
				var x=document.getElementById('c_flag');
				if (x)
				{
					document.getElementById("c_flag").src = document.getElementById("img_"+l).src;
				}
			}
		}
		langLab.langHttp.open('GET', 'lang.html', true);
		langLab.langHttp.send();
	},
	setDeviceLang : function (indx){
		langLab.langHttp = new XMLHttpRequest();
		langLab.langHttp.onreadystatechange=function()
		{
			if(langLab.langHttp.readyState==4)
				location.reload();
		}
		langLab.langHttp.open('GET', 'lang.html?lang=' + indx, true);
		langLab.langHttp.send();
	}
};

langLab.getDeviceLang();

var loadedFileLang = true;