<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">

	<head>

		<title>[Siderische Zeit / Lokale Zeit - Siderial Time / Local Time]</title>
		
		<style>
		
			/* ******************************
			 * ID des Body Tag Schriftfarbe
			 * und Hintergrundfarbe.
			* ID of the body tag font color
			* and background color.
			 *******************************/
			#b {
				background-color: #293133;
				color: #eadebd;
				border: 0px solid red;
			}
			
			/* ******************************
			 * Tabellenspalten Beschreibung.
			 * Table Columns Description.
			 *******************************/
			#label {
				width: 120px;
				text-align: right;
				font-family: Tahoma,Arial,Helvetica;
				font-size: 14 px;
				font-weight: 500;
			}
			
			/* ******************************
			 * Tabellenspalten Werte.
			 * Table column values.
			 *******************************/
			#value {
				width: 100px;
				text-align: right;
				font-family: Tahoma,Arial,Helvetica;
				font-size: 14 px;
				font-weight: 500;
			}
			
			/* ******************************
			 * Wichtige Werte markieren.
			 * Mark important values.
			 *******************************/
			.color {
				color: red;
			}

			/* ******************************
			 * HTML input-Tag.
			 * HTML-Eingabe-Tag.
			 *******************************/
			input {
				font-family: Tahoma,Arial,Helvetica;
				font-size: 14 px;
				font-weight: 500;
			}
			
		</style>
		<!-- Muss demarkiert werden, wenn jQuery verwendet werden soll -->
		<!-- Must be demarcated if jQuery is to be used -->
		<!-- script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script -->
		<script>
		
			// Mit der Ausführung warten bis DOM geladen ist.
			// With the execution wait until DOM is loaded.
			document.addEventListener("DOMContentLoaded", function(event) {
				
				// Alles geladen inklusive Bilder.
				// Funktioniert nicht alleine: DOM muss vorher geleden sein und danach erst
				// der Windows Event Load.
				// All loaded including pictures. // Does not work alone: DOM must be leden before and after
				// the Windows Event Load.
				window.addEventListener("load", function(){
				
					/* ***************** Variablen Deklarationen - Variable declarations ************************ */
				
					var JD = 0.0;						// Das Julianische Datum eines Gregorianischen Datums
																// The Julian date of a Gregorian date
					var Century = [];				// Leeres Array das die Daten des Jahrhunderts aufnimmt
																// Empty array that records the data of the century
					var decUT = 0.0;				// Dezimalwert der Weltzeit (UT)
																// Decimal value of world time (UT)
					var decEpsilon = 0.0;		// Dezimalwert der ekliptischen Schiefe
																// Decimal value of the ecliptic slope
					var ISDST;						// Zeigt an, ob Daylight Saving Time
																// Indicates whether Daylight Saving Time
					var TZ = 0;						// Nimmt die Zeitzone auf
																// Accepts the time zone
					// Die Funktionen sin(), cos() ... benötigen die Werte in Radiant, also
					// Wert / RAD
					// The functions sin () cos ()... need the values in radiant, i.e.
					// Value / RAD
					// Die Funktionen asin(), acos() ... benötigt die Werte dimensionslos.
					// Das Ergebnis ist in Radiant und muß mit RAD multipliziert werden
					// The functions asin () acos ()... need the values dimensionless, i.e.
					// After that you must multiple the resolution Value with RAD
					//
					// The functions sin (), cos (). . . require the values in radiant, i. e.
					// Value / RAD
					// The functions sin () cos (). . . need the values in radiant, i. e.
					// Value / RAD
					// The functions asin (), acos (). . . requires the values dimensionless.
					// The result is in radian and must be multiplied by RAD
					// The functions asin () acos (). . . need the values dimensionless, i. e.
					// After that you must multiple the resolution Value with RAD
					var RAD = 180.0 / Math.PI;
					
					/* ***************** Verwendete Objekte - Used objects ************************ */
					
					// Objekt des Berechnen Buttons
					// Object of the calculation button
					var objCalc = document.getElementById("calc");

					// Objekte der EingabeTextfelder Uhrzeiten
					// Objects of the inputText fields Time
					var objHH = document.getElementById("hour");
					var objMM = document.getElementById("minute");
					var objSS = document.getElementById("second");
					var objMS = document.getElementById("msecond");
					
					// Objekt der Eingabe des zu berechnenden Jahres
					// Object of entry of the year to be calculated
					var objYear = document.getElementById("year");
					// Objekt der Eingabe des zu berechnenden Monats
					// Object of the input of the month to be calculated
					var objMonth = document.getElementById("month");
					// Objekt der Eingabe des zu berechnenden Tages
					// Object of the input of the day to be calculated
					var objDay = document.getElementById("day");
					// Objekte der Ausgabefelder
					// Objects of the output fields
					//
					// Objekt der Ausgabe des Julianisches Datum der Epoche 
					// 2010 zum 0.1. 00:00:00:000
					// Object of the issue of the Julian Date of the Epoch
					// 2010 to 0. 1. 00:00:00:000
					var objJD = document.getElementById("jd");
					// Objekt der Ausgabe des Schaltjahres
					// Object of the output of the leap year
					var objLeapYear = document.getElementById("leapyear");
					// Objekt der Eingabe/Ausgabe der Daylight Saving Time und Timezone
					// DST = 1 = Sommerzeit
					// Tz = 1 = MEZ
					//
					// Object of input/output of the Daylight Saving Time and Timezone
					// DST = 1 = summer time
					// Tz = 1 = MEZ
					var objDST = document.getElementById("dst");
					var objTZ = document.getElementById("tz");
					// Objekt der Ausgabe des Jahrhunderts
					// Object of the edition of the century
					var objCentury = document.getElementById("century");
					// Objekt der Ausgabe der mittleren Greenwich Sternzeit 0h
					// Object of the output of the middle Greenwich stardate 0h
					var objTheta = document.getElementById("theta");
					// Objekt der Ausgabe Julianischen Datums um 0h Weltzeit
					// Object of the edition Julian date at 0h world time
					var objJD0 = document.getElementById("jd0");
					// Objekt der Ausgabe der Weltzeit (UT) des aktuellen Datums
					// Object of the output of the Universal Time (UT) of the current date
					var objUT = document.getElementById("ut");
					// Objekt der Ausgabe mittlere ekliptische Schiefe zum Berechnungszeitpunkt
					// Object of the output middle ecliptic skew at the time of calculation
					var objEpsilon= document.getElementById("epsilon");
					// Objekt der Ausgabe des neuen Längengrads nach der Zeit
					// Object of the output of the new longitude according to time
					var objLambda= document.getElementById("longitude");
					// Objekt der Ausgabe der Länge des mittleren Frühlingspunkts zum
					// Berechnungszeitraum
					// Object of the output of the length of the mean vernal equinox to
					// Calculation period
					var objDeltaPsi= document.getElementById("deltapsi");
					// Objekt der Ausgabe der Differenz zwischen mittlerer- und wahrer Greenwich Sternzeit
					// Object of the output of the difference between the mean and true Greenwich Stardate
					var objDeltaPsiMalEpsilon= document.getElementById("deltapsimalepsilon");
					// Objekt der Ausgabe der wahren Greenwich Sternzeit
					// Object of the edition of the true Greenwich Stardate
					var objThetaApp= document.getElementById("thetaapp");
					// Objekt der Ausgabe der lokalen mittleren Greenwich Sternzeit dezimal
					// Object of the output of the local middle Greenwich Stardate decimal
					var objThetaMeanLocal= document.getElementById("thetameanlocal");
					// Objekt der Eingabe des lokalen Längengrades
					// Object of the input of the local longitude
					var objLambda =  document.getElementById("longitude");
					// Die Ausgabe der wahren lokalen Sternzeit
					// The output of the true local stardate
					var objThetaAppLocal = document.getElementById("thetaapplocal");
					// Die Ausgabe der lokalen Zeit an entsprechendem Längengrad
					// The output of the local time at the appropriate longitude
					var objLT= document.getElementById("lt");
					
					/* ***************** Funktions Definitionen - Function definitions ************************ */
					
					
					
					/* *********************************************************************
						Die Funktion ermittelt die Zeitzone nach dem
						Datum des Rechners. Von -1 bis - 12 und
						von 1 bis 12, je nach Himmelsrichtung entlang
						der Längengrade.
									
						Übergabewert:
						Keiner
											
						Rückgabewert:
						Die Zeitzone als Integer.
						Nach Osten als negativer Wert .
						Nach Westen als positiver Wert			
						----------------------------------------------------
						The function determines the time zone after the
						Date of the computer. from -1 to -12 and
						from 1 to 12, depending on the direction of the sky
						of the lengths.
						
						Transfer value:
						None

						Return value:
						The time zone as an integer. To the east as a negative value.
						To the West as a positive value
					 ********************************************************************** */
					function getTZ(){
						// Aktuelles Datum ermitteln
						// Get the actual date
						d = new Date();
						// Das Datum vom 1. Januar des aktuellen Jahres
						// The date of 1. January of the current year
						jan = new Date(d.getFullYear(), 0, 1);
						
						// Das Datum vom 1. Juli des aktuellen Jahres
						// The date of the 1st July of the current year
						jul = new Date(d.getFullYear(), 6, 1);
						
						// Zeitzonenwert = Timezone + DST
						// Standard ist Winterzeit, also GMT + 1 h 
						//
						// Time zone value = Timezone + DST
						// Standard is winter time, i. e. GMT + 1 h
						TIMEZONE = 0;
						
						// Differenz zwischen Juli und Januar. Wenn DST dann ist die Differnz 1,
						// ansonsten 0
						//
						// Difference between July and January. If DST is then the Differnce 1,
						// otherwise 0
						diff = 0;
						
						// Differnz zwischen Juli und Januar des Jahres ermitteln ...
						// Determine the difference between July and January of the year . . .
						diff = jul.getTimezoneOffset()/60 - jan.getTimezoneOffset()/60;
						
						// ... und an den Aufrufer zurückgeben.
						// ... and back to the caller.
						return(diff);
					}
					
					
					
					/* ************************************************************************************
					 *	Die Funktion berechnet aus dem zu übergebenden Julianischen 
					 * Datum als Gleitkommazahl das dazugehörige Datum und Uhrzeit.
					 *	Der Algorithmus funktioniert zuverlässig von 1600 - XXXX. 
					 *	Datum v. Chr. liegt oder danach. Es werden auch die Übergänge 
					 * bei den Monaten bzw. Jahren berücksichtigt. Dies kommt ja oft vor, 
					 * wenn Datum und Uhrzeit am Anfang des Monats
					 *	oder Jahres liegen und eine hohe Zeitzone vorhanden ist. In dem 
					 * Falle fällt das Datum	der UT gegenüber der LT ja in den Vormonat 
					 * oder das Vorjahr. Siehe Beispiel.
					 *
					 *	Die Übergabewerte werden nicht auf Plausibilität überprüft. Bitte vor dem Aufruf
					 *	der Funktion selber überprüfen. Der Datentyp sollte ebenfalls eine 
					 * Gleitkommazahl sein.
					 *
					 *	Übergabeparameter:
					 *
					 *	jd	= Julianisches Datum aus dem das Gregorianische Datum berechnet wird
					 *
					 *
					 *	Returnwert:
					 
					 *	Ein Array mit 3 Werten an den Indizes 0 - 2
					 *	verwendete Jahrhundert, das ja als JXXXX bezeichnet wird.
					 *	
					 *	Array[0] = Der Tag des Datums als Gleitkommazahl.
					 * Nachkommastellen sind die Uhrzeit. 
					 *	Array[1] = Der Monat des Datums als Ganzzahl.
					 *	Array[2] = Das Jahr des Datums als Ganzzahl.
					 *
					 *	Quelle: Grundlagen der Ephemeridenberechnung - von Oliver Montenbruck
					 * ------------------------------------------------------------------------------------------------------------------
					* The function is calculated from the Julian to be handed over
					* Date as floating point number the corresponding date and time. 
					* The algorithm works reliably from 1600 – XXXX. 
					* Date B. C. or thereafter. There will also be the transitions
					* for the months or Years taken into account. This often happens,
					* if date and time at the beginning of the month
					* or year and a high time zone is present. In the
					* Fall falls the date of the UT compared to the LT yes in the previous month
					* or the previous year. See example. *
					* The transfer values are not checked for plausibility. Please before the call
					* check the function itself. The data type should also be a
					* to be floating point number. 
					*
					* handover parameters:
					*
					* jd = Julian date from which the Gregorian date is calculated
					*
					* Return value:
					*
					* An array with 3 values at the indices 0 - 2
					* used century, which is referred to as JXXXX. 
					*
					* Array[0] = The date as floating point number. 
					* Decimal places are the time. 
					* Array[1] = The month of the date as an integer. 
					* Array[2] = The year of the date as an integer. 
					*
					* Source: Fundamentals of Ephemeris Calculation - by Oliver Montenbruck
					
					 *********************************************************************************** */
					function calcJD2Date(jd){
						// Variablendeklarationen
						// Variablendeklarationen
						var DATE = [];
						var a = 0;
						var b = 0;
						var c = 0;
						var d = 0;
						var e = 0;
						var f = 0;
						
						// Das Julianische Datum um 12 h erhöhen ...
						// Increase the Julian date by 12 h . . .
						a = Math.floor(Number(jd) + 0.5);
						
						// ... und die Hilfsvariablen berechnen
						// . . . and calculate the auxiliary variables
						if (a < 2299161){
							c = a + 1524;
						}else if (a >= 2299161){
							b = Math.floor((a - 1867216.25)/36524.25);
							c = a + b - Math.floor(b/4) + 1525;
						}
						
						d = Math.floor((c - 122.1)/365.25);
						e = Math.floor(365.25 * d);
						f = Math.floor((c - e)/30.6001);
						
						// ... Tag, Monat und Jahr berechnen. Der Tag beinhaltet als
						// Nachkommaanteil die Uhrzeit ...
						//. . . Calculate day, month and year. The day includes as
						// Percentage of decimal places the time . . .
						var day = c - e - Math.floor( 30.60001 * f) + (jd + 0.5 - a);
						var month = f - 1 - 12 * Math.floor(f/14);
						var year = d - 4715 - Math.floor((7+month)/10);
						
						// und in einem Array mit dem Index 0 - 2 speichern ...
						// and save in an array with the index 0 - 2 . . .
						DATE.push(day);
						DATE.push(month);
						DATE.push(year);
						
						// ... und zurück zum Caller.
						// ... bach to the caller.
						return(DATE);
					}
					
					
				/* ******************************************************
					Die Funktion ermittelt ob ein Jahr ein Schaltjahr ist.
					Ein Schaltjahr liegt vor, wenn das Jahr durch 4 und nicht
					durch 100 teilbar ist.
					Ist ein Jahr durch 4 und durch 100 teilbar, dann muss es
					durch 400 teilbar sein, um ein Schaltjahr zu sein.
								
					Übergabewert:
					year = Ganzzahl, z.B. 1988
										
					Rückgabewert:
					true 	= Schaltjahr
					false 	= Kein Schaltjahr
										
					----------------------------------------------------
										
					The function determines whether a year is a leap year.
					A leap year is given if the year by 4 and not
					is divisible by 100. If a year is divisible by 4 and by 100,
					then it must be divisible by 400 to add one leap year.
										
					Transfer value:
					year = integer, e. g. B. 1988

					Return value:
					true = leap year
					false = No leap year
				*************************************************** */				
				function isLeapYear(year){
					ret = false;
					var fourhundred = Math.floor(year / 400.0); 	// Ganzzahl der 400 - Entire number of 400
					var yearFourhundred = year / 400.0						// Dezimalzahl der 400 - Decimal number of 400
					var four = Math.floor(year / 4.0);						// Ganzahl der 4 - Integer of the 4
					var yearFour = year / 4.0;										// Dezimalzahl der 4 - Decimal number of 4
					var hundred = Math.floor(year / 100.0);			// Ganzzahl 100  - Integer of the 100
					var yearHundred = year / 100.0;							// Dezimalzahl 100 - Decimal number of 100
								
					// Ist das Jahr durch 4 und nicht durch 100 teilbar, dann
					// Schaltjahr ...
					// If the year is divisible by 4 and not by 100, then
					// Leap year. . .
					if ( ((yearHundred - hundred) != 0) &&  ( (yearFour - four) == 0) ){
						ret = true;
					// Ist es durch 4 und durch 100 teilbar, muss es durch
					// 400 teilbar sein.
					// If it is divisible by 4 and by 100, it must be
					// be divisible.
					} else if ( (yearFourhundred - fourhundred) == 0 ) {
						ret = true;
					}
					
					// ... und zurück zum Caller.
					// ... and back to the caller.
					return(ret);
				}
					
					
					
					/* ******************************************************
						Die Funktion Konvertiert dezimale Grad zu 
						einem String als Grad ° Minute ' Sekunde ".
						Z.B. 134° 34' 56.7"
											
						Übergabewert:
						decdegrees			= 	Grad in dezimalem 
															Format z.B. 134.238157 als Number
												
						Rückgabewert:
						strDegrees				= 	Der Ergebnisstring im
															oben beschriebenen Format
						--------------------------------------------------------------
						The function Converts decimal degrees to
						a string as a degree ° minute' second. 
						E. g. 134° 34’56. 7.

						Transfer value:
						decdegrees 			= 	Grad in decimal
															Format e. g. B. 134. 238 157 as number

						Return value:
						strDegrees 			= The result string in
															above described format
						
						*************************************************** */					
					function convertDecdegreesToString(decdegrees){
						var DECDEGREES = Number(decdegrees);	// Übergabewert zu Number
																											// Tranfer value to Number
						var rest = 0.0;															// Variable des Dezimalanteils
																											// Variable of the decimal part
						var strDegrees = "";													// Ergebnisstring Initialisieren
																											// Initialize result string
						// Bei negativen Graden muss ceil()verwendet werden, das das
						// Ergebnis ansonsten um 1 kleiner ist ...
						// In case of negative grades, ceil () must be used, which
						// Otherwise the result is 1 smaller. . .
						if (DECDEGREES  <  0.0){
							// ... und holen den ganzen Anteil des Grades ...
							// . . . and get the whole part of the degree . . .
							strDegrees = strDegrees + Math.ceil(DECDEGREES) + "° ";
							// ... und den dezimalen Anteil in rest speichern ...		
							//. . . and save the decimal share in rest. . .
							rest = (DECDEGREES - Math.ceil(DECDEGREES)) * -1;
						// Bei positiven Graden benutze floor(), ansonsten ist das Ergebnis
						// um 1 größer ...
						// For positive grades use floor (), otherwise the result is
						// by 1 larger . . .
						}else{
							// ... und holen den ganzen Anteil des Grades ...
							// . . . and get the whole part of the degree . . .
							strDegrees = strDegrees + Math.floor(DECDEGREES) + "° ";
							// ... und den dezimalen Anteil in rest speichern ...	
							//. . . and save the decimal share in rest. . .
							rest = DECDEGREES - Math.floor(DECDEGREES);
						}
						// ... die ganzen Minuten aus dem Rest der Grade berechnen 
						// und im Ergebnisstring speichern ...
						//. . . calculate the whole minutes from the rest of the grades
						// and save in the result string. . .
						strDegrees = strDegrees + Math.floor(rest * 60.0) + "' ";
						// ... dann Nachkommaanteil der Minuten ermitteln ...
						//. . . then determine decimal part of the minutes. . .
						rest = (rest * 60.0)- Math.floor(rest * 60.0);
						// ... und die Sekunden aus dem Rest der Minuten ermitteln ...
						// . . . and determine the seconds from the rest of the minutes . . .
						strDegrees = strDegrees + Math.floor(rest * 60.0 ) + "\"";
						// ...	und zurück an den Caller.		
						//. . . and back to the caller.
						return(strDegrees);
					}
					
					
					/* ******************************************************
						Die Funktion füllt eine Zeichenketten mit Zahl vorne
						mit n-Zeichen auf.
						Z.B. 1 -> 01
						izahl = 		Die Zahl ohne führende Nullen
						ianzStellen = 	Die gewünschte Anzahl von Stellen
						sFuelzeichen =	Das gewünschet führende Zeichen
											
						Rückgabewert =	Z.B. "01" oder "0001"
											
						----------------------------------------------------
											
						The function fills a string with number at the front
						with n-signs.
						E. g. 1 -> 01
											
						izahl = The number without leading zeros
						ianzStellen = The desired number of digits
						sFuel character = The desired leading character

						Return value = E. g. "01" or "0001"
					   *************************************************** */
					function LPad( iZahl, iAnzStellen, sFuellzeichen ){
						// Die aufzufüllende Zahl als Zeichenkette Deklarieren.
						// Declare the number to be filled as a string.
						var sZahl = iZahl + "";
						
						// Vorne immer ein Füllzeichen anfügen.
						// Always add a fill character to the front.
						while( sZahl.length < iAnzStellen )
							sZahl = sFuellzeichen + sZahl;
							
						// ... und zurück zum Caller.
						// ... and back to the caller.
						return sZahl;
					}

									
					/* *******************************************************
						Die Funktion konvertiert eine dezimale Stundenangabe,
						wie z.B. 18,5421666, also eine Dezimalzahl > 0.0  in
						eine Stundenangabe hh:mm.ss.ms oder
						ein Array mit den einzelnen Werten.
						Die Funktion percentageOfDecimal2Time(dect, what)arbeitet
						ähnlich, nimmt aber als Wert eine Dezimalzahl < 0.0.
						
						Die einzelnen Werte des Rückgabewertes werden links
						mit ein "0" aufgefüllt, wenn der Wert < 10 ist.
										
						Übergabewert:					
						dectime 				= Stundenwert als Dezimalzahl
						what    				= Was zurückgegeben werden soll, ein String = "hh:mm:ss.ms"
														oder ein Array mit Index von 0 - 4 der einzelnen Werte.
														Wert: "array" oder "string"
									
						Returnwert:
						String z.B. als 18:01:45:005 oder
						Array mit 4 Werten an den einzelnen Indexen von 0 - 4 für
						hh mm ss ms
										
						-------------------------------------------------------

						The function converts a decimal hour,
						e. g. B. 18,5421666, i. e. one decimal > 0. 0 in
						an hour reference hh:mm. ss. ms or
						an array with the individual values. The function percentageOfDecimal2Time (dect, what) works
						similar, but takes as a value a decimal number < 0. 0.
										
						Transfer value:
						dectime = hour value as decimal number
						what = What should be returned, a string = “hh:mm:ss.ms”
						or an array with an index of 0-4 of the individual values.
						Value: “array” or “string”

						Return value:
						String z. e. g. as 18:01:45:005 or
						Array with 4 values on the individual indexes from 0-4 for
						hh mm ss ms.
									
					  ****************************************************** */
					function dectime2Time(dectime, what){
						// Deklaration und Definition der Variablen.
						// Declaration and definition of the variables.	
						var rest = 0.0;
						var hour = 0;
						var minute = 0;
						var second = 0;
						var msecond = 0;
						
						// Ermittle was der Rückgabewert sein soll? ...
						// Determine what the return value should be? ...
						var WHAT = what.toLowerCase();
						// ... ein Array mit den einzelnen Werten von h, m, s, ms ...
						// ... an array with the individual values of h, m, s, ms ...
						if (WHAT == "array")
							var time = [];
						// ... oder eine zusammengesetzte Zeichenkette wie hh:mm:ss.ms.
						// . . . or a compound string like hh:mm:ss. ms.
						else
							var time = "";
						// Stunden berechnen ...
						// Calculate hours...
						hour = Math.floor(dectime );
						// ... und die Nachkommawerte ...
						// ... and the decimals ...
						rest = dectime  -  hour;
						// ... und Stunden zum Ergebnis hinzufügen ...
						// ... and add hours to the result ...
						if (WHAT == "array")
							time.push(LPad(hour, 2, "0"));
						else
							time += LPad(hour, 2, "0") + ":";				
						// Die Minuten berechnen ...
						// Calculate the minutes ...
						minute = Math.floor(rest * 60.0);
						// ... und deren Nachkommastellen ...
						// ... and their decimal places ...
						rest = (rest * 60.0) - minute;	
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							time.push(LPad(minute, 2, "0"));
						else
							time += LPad(minute, 2, "0") + ":";			
						// Die Sekunden berechnen
						// Calculate the seconds ...
						second = Math.floor(rest * 60.0);
						// ... und deren Nachkommastellen ...
						// ... and their decimal places ...
						rest = (rest * 60.0) - second;			
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							time.push(LPad(second, 2, "0"));
						else
							time += LPad(second, 2, "0") + ".";				
						// für die Milli-Sekundenberechnung ist ...
						// for the milli-second calculation is . . .
						msecond = Math.trunc(rest * 1000.0);			
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							time.push(LPad(msecond, 3, "0"));
						else
							time += LPad(msecond, 3, "0");
						// ...	und zurück an den Caller.		
						//. . . and back to the caller.
						return(time);
					}
										
					
					 /* *********************************************************************************
						Die Funktion arbeitet ähnlich dectime2Time()und konvertiert 
						eine dezimale Stundenangabe von Nachkommastellen,
						wie z.B. 0,5421666 in eine Stundenangabe hh:mm.ss.ms oder
						ein Array mit den einzelnen Werten.
						Es muss eine 0,1..... Dezimalzahl sein. Es gibt ja auch die
						Dezimalen Stunden als 18,4782156.
						Die einzelnen Werte des Rückgabewertes werden links
						mit ein "0" aufgefüllt, wenn der Wert < 10 ist.
										
						Übergabewert:					
						dectime 			= Stundenwert als Dezimalzahl
						what    			= Was zurückgegeben werden soll, ein String = "hh:mm:ss.ms"
													oder ein Array mit Index von 0 - 4 der einzelnen Werte.
													Wert: "array" oder "string"
									
						Returnwert:
						String z.B. als 18:01:45:005 oder
						Array mit 4 Werten an den einzelnen Indexen von 0 - 4 für
						hh mm ss ms
										
						---------------------------------------------------------------------------------------------------
						The function works similarly to dectime2Time () and converts
						a decimal hour of decimal places,
						e. g. B. 0,5421666 in an hourly rate hh:mm. ss. ms or
						an array with the individual values. It's got to be a 0. 1. . . decimal. There are also the
						Decimal hours as 18,4782156. The individual values of the return value are displayed on the left
						replenished with a "0" if the value is < 10.
										
						Transfer value:
						dectime = hour value as decimal number
						what = What should be returned, a string = “hh:mm:ss.ms”
						or an array with an index of 0-4 of the individual values.
						Value: “array” or “string”

						Return value:
						String z. e. g. as 18:01:45:005 or
						Array with 4 values on the individual indexes from 0-4 for
						hh mm ss ms.
									
					  *************************************************************************************** */
					 function percentageOfDecimal2Time(dect, what){
						var DECT = Number(dect);		// Sicherheitshalber nach Number konvertieren
						var rest = 0.0;
						var hour = 0;
						var minute = 0;
						var second = 0;
						var msecond = 0;
						
						// Ermittle was der Rückgabewert sein soll? ...
						// Determine what the return value should be? ...
						var WHAT = what.toLowerCase();
						// ... ein Array mit den einzelnen Werten von h, m, s, ms ...
						// ... an array with the individual values of h, m, s, ms ...
						if (WHAT == "array")
							var RETTIME = [];
						// ... oder eine zusammengesetzte Zeichenkette wie hh:mm:ss.ms.
						// . . . or a compound string like hh:mm:ss. ms.
						else
							var RETTIME = "";
						// Stunden berechnen ...
						// Calculate hours...
						hour = Math.floor(DECT * 24.0 );
						// ... und die Nachkommawerte ...
						// ... and the decimals ...
						rest = (DECT * 24) -  hour;
						// ... und Stunden zum Ergebnis hinzufügen ...
						// ... and add hours to the result ...
						if (WHAT == "array")
							RETTIME.push(LPad(hour, 2, "0"));
						else
							RETTIME += LPad(hour, 2, "0") + ":";				
						// Die Minuten berechnen ...
						// Calculate the minutes ...
						minute = Math.floor(rest * 60.0);
						// ... und deren Nachkommastellen ...
						// ... and their decimal places ...
						rest = (rest * 60.0) - minute;	
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							RETTIME.push(LPad(minute, 2, "0"));
						else
							RETTIME += LPad(minute, 2, "0") + ":";			
						// Die Sekunden berechnen
						// Calculate the seconds ...
						second = Math.floor(rest * 60.0);
						// ... und deren Nachkommastellen ...
						// ... and their decimal places ...
						rest = (rest * 60.0) - second;			
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							RETTIME.push(LPad(second, 2, "0"));
						else
							RETTIME += LPad(second, 2, "0") + ".";				
						// für die Milli-Sekundenberechnung ist ...
						// for the milli-second calculation is . . .
						msecond = Math.trunc(rest * 1000.0);			
						// ... und zum Ergebnis hinzufügen ...
						// ... and add to the result ...
						if (WHAT == "array")
							RETTIME.push(LPad(msecond, 3, "0"));
						else
							RETTIME += LPad(msecond, 3, "0");
						// und Wert an den Caller zurückgeben.
						// and return the value to the caller.
						return(RETTIME);
					 }
					
					
					/* ************************************************************************************
					 *	Die Funktion berechnet aus dem zu übergebenden Julianischen Datum als Gleitkomma-
					 *	zahl das dazugehörige Datum und Uhrzeit.
					 *	Der Algorithmus funktioniert zuverlässig von 1600 - XXXX. 
					 *	Datum v. Chr. liegt oder danach. Es werden auch die Übergänge bei den Monaten bzw. Jahren
					 * 	berücksichtigt. Dies kommt ja oft vor, wenn Datum und Uhrzeit am Anfang des Monats
					 *	oder Jahres liegen und eine hohe Zeitzone vorhanden ist. In dem Falle fällt das Datum
					 *	der UT gegenüber der LT ja in den Vormonat oder das Vorjahr. Siehe Beispiel.
					 *
					 *	Die Übergabewerte werden nicht auf Plausibilität überprüft. Bitte vor dem Aufruf
					 *	der Funktion selber überprüfen. Der Datentyp sollte ebenfalls eine Gleitkommazahl sein.
					 *
					 *	Übergabeparameter:
					 *
					 *	jd	= Julianisches Datum aus dem das Gregorianische Datum berechnet wird
					 *
					 *
					 *	Returnwert:
					 *
					 *	Ein Array mit 3 Werten an den Indizes 0 - 2
					 *	verwendete Jahrhundert, das ja als JXXXX bezeichnet wird.
					 *	
					 *	Array[0] = Der Tag des Datums als Gleitkommazahl. Nachkommastellen sind die Uhrzeit. 
					 *	Array[1] = Der Monat des Datums als Ganzzahl.
					 *	Array[2] = Das Jahr des Datums als Ganzzahl.
					 *	
					 *	Quelle:
					 *	https://de.wikipedia.org/wiki/Umrechnung_zwischen_julianischem_Datum_und_gregorianischem_Kalender
					 *
					 *	--------------------------------------------------------------------------------
					 *
					 * The function calculates from the Julian date to be passed as floating point
					 * pay the corresponding date and time. * The algorithm works reliably from 1600 - XXXX. *
					 * Date B. C. or after. There will also be transitions in the months and months. years
					 * taken into account. This often happens when the date and time at the beginning of the month
					 * or year and a high time zone is present. In this case, the date falls
					 * the UT compared to the LT in the previous month or the previous year. See example. *
					 * The transfer values are not checked for plausibility. Please before the call
					 * check the function itself. The data type should also be a floating-point number. *
					 * Transfer parameters:
					 *
					 * jd = Julian date from which the Gregorian date is calculated
					 *
					 *
					 * Return value:
					 *
					 * An array with 3 values at the indices 0 - 2
					 * used century, which is referred to as JXXXX.
					 *
					 * Array[0] = The date as floating point number. Decimal places are the time.
					 * Array[1] = The month of the date as an integer.
					 * Array[2] = The year of the date as an integer.
					 *
					 * Source:
					 * https://de. wikipedia. org/wiki/Umrechnung_zwischen_julianischem_Datum_und_gregorianischem_Kalender
					 *
					 *********************************************************************************** */
					function julianDate2Date(jd){
						// Definition und Deklaration der Variablen ...
						// Definition and declaration of variables ...
						var DATE = [];
						var Z = 0.0
						var F = 0.0;
						var a = 0.0;
						var A = 0.0;
						var Z = 0.0;
						var B = 0.0;
						var C = 0.0;
						var D = 0.0;
						var E = 0.0;
						var day = 0.0;
						var month = 0;
						var year = 0;
												
						// Ganzahliger Anteil von JD ...
						// Integer fraction of JD ...
						Z = Math.floor(jd + 0.5);
						
						// ... und hier der Nachkommaanteil ...
						// ... and here the decimal part ...
						F = (jd + 0.5) - Z;
												
						if (Z < 2299161.0)
							a = Z;
						else if (Z > 2299161.0)
							a = Math.floor((Z - 1867216.25)/36524.25);
												
						// Hilfsvariablen berechnen	...
						// Calculate auxiliary variables ...	
						A = Z + 1 + a - Math.floor(a/4.0);
						B = A + 1524;
						C = Math.floor((B - 122.1)/365.25);
						D = Math.floor(365.25 * C);
						E = Math.floor((B-D)/30.6001);
						
						// ... und den Tag berechnen ...
						// ... and calculate the day ...
						day = B - D - Math.floor(30.6001 * E) + F;
						
						// ... sowie den Monat ...
						// ... as well as the month ...
						if ( E < 14)
							month = E - 1;
						else if ((E == 14) || (E == 15))
							month = E - 13;

						// ... und das Jahr ...
						// ... and the year ...
						if (month > 2)
							year = C -4716;
						else if ((month == 1) || (month == 2))
							year = C -4715;
													
						// Werte im Array Speichern ...
						// Values in the Save Array	...
						DATE.push(day);
						DATE.push(month);
						DATE.push(year);
						
						// ... und zurück zum Caller.
						// ... and back to the caller.
						return(DATE);
					}
					
					
					
					/* ************************************************************************************
					 *	Berechnung des julianischen Datums.
					 *	Am 0.5 Januar -4712 ist das JD = 0 aber nach den Formeln ist dies am 24.4 November 
					 *	-4713 der Fall und am eigentlichen Datum 0.5 Januar -4712 sind schon 37 Tage vergangen.
					 *	Das ist ein Fehler von 0,015% auf die gesamten Tage Zeit seit Begin bis 2020 und
					 *	2,3 * 10 e-6 für ein Jahr.
					 * 
					 *	Berücksichtigt werden Schaltjahre und die Zeit des Übergangs vom Julianischen- 
					 *	zum Gregorianischen kalender, sowie die Zeitzone und Daylight Savings Time.
					 *
					 *	Soll das julianische Datum des aktuellen Datums berechnet werden, dann muss man
					 *	die UTC Zeit angeben, also die Zeit der Uhren/PC-Datum usw. . Die Übergabeparameter
					 * 	DST und TZ müssen dabei 0 sein.
					 *
					 *	Soll die UT bzw. GMT berechnet werden, dann muss man DST und TZ mit angeben.
					 *
					 *	Es wird keine Plausibiliätsprüfung der einzelnen Übergabeparameter vorgenommen.
					 *	Bitte vor Aufruf überprüfen.
					 *
					 *	Übergabeparameter:
					 *
					 *	Getrennt Datum mit Uhrzeit des zu berechnenden Datums und DST mit TZ
					 *	Der Tag day als Int, wird aber noch konvertiert
					 *	Der Monat month als Int, wird aber noch konvertiert
					 *	Das Jahr year als Int, wird aber noch konvertiert
					 *	Die Stunde hour als Number, wird aber noch konvertiert
					 *	Die Minute minute als Number, wird aber noch konvertiert
					 *	Die Sekunde second als Number, wird aber noch konvertiert
					 *	Die Millisekunde misecond als Number, wird aber noch konvertiert
					 *	Die TZ und DST als Int, wird aber noch konvertiert
					 * 	TZ -12 < 0 < 12
					 *  DST = 1 Sommerzeit
					 *	DST = 0 Winterzeit
					 *
					 *	Returnwert:
					 *	Das Julianische Datum als Number
					 *
					 *	Quelle: Grundlagen der Ephemeridenberechnung - von Oliver Montenbruck
					 *
					 * --------------------------------------------------------------------------------
					 *
					 * Calculating the Julian date. * On 0. 5 January -4712 the JD = 0 but according to the formulas this is on 24. 4 November
					 * -4713 and on the actual date 0. 5 January -4712 37 days have passed. * This is an error of 0. 015% on the total day time since the beginning until 2020 and
					 * 2. 3 * 10 e-6 for one year. *
					 * Leap years and the time of transition from the Julian
					 * to the Gregorian calendar, as well as the time zone and Daylight Savings Time.
					 *
					 * If you want to calculate the Julian date of the current date, you have to
					 * Specify the UTC time, i. e. the time of the clocks/PC date, etc. The transfer parameters
					 * DST and TZ must be 0. *
					 * Should the UT or the UT GMT, then you have to specify DST and TZ.
					 *
					 * No plausibility check of the individual transfer parameters is performed.
					 * Please check before calling.
					 *
					 * Transfer parameters:
					 *
					 * Separate date with time of the date to be calculated and DST with TZ
					 * The tag day as Int, but is still being converted
					 * The month month as Int, but is still being converted
					 * The year year as Int, but is still being converted
					 * The hour hour as number, but is still being converted
					 * The minute minute as number, but is still being converted
					 * The second second as number, but is still being converted
					 * The millisecond misecond as number, but is still being converted
					 * The TZ and DST as Int, but is still being converted
					 * TC -12 < 0 < 12
					 * DST = 1 daylight saving time
					 * DST = 0 winter time
					 *
					 * Return value:
					 * The Julian date as number
					 *
					 * Source: Basics of Ephemerid Calculation – by Oliver Montenbruck
					 *
					 *********************************************************************************** */
					function calcJD(day, month, year, hour, minute, second, msecond,  dst, tz){

						// Variablen der Hilfsgrößen
						// Variables of auxiliary variables
						var y = 0; var m = 0; var B = 0;
						var ret = 0.0;
						var DAY = Number(day);
						var MONTH = Number(month);
						var YEAR = Number(year);
						var DST = parseInt(dst);
						var TZ = parseInt(tz);
						var HOUR = parseInt(hour);
						
						// Alles östlich Greenwich, wenn die Timezone positiv ist ...
						// All east of Greenwich when the timezone is positive ...
						if (TZ > 0)
							HOUR = HOUR - (DST + TZ);
						// Alles westlich Greenwich, wenn die Timezone negativ ist ...
						// All west of Greenwich, if the timezone is negative ...
						else if (TZ < 0)
							HOUR = HOUR + (DST - TZ);
						
						// Beginn ist 0.5 Januar -4712. Bei kleineren Werten das Jahr auf -4712 setzen ...
						// Start is 0. 5 January -4712. At smaller values, set the year to -4712 ...
						if (parseInt(YEAR) < -4712){
							YEAR = String(-4712);
						}

						// Universal Time = GMT als Gleitkommazahl ...
						// Weltzeit = GMT als Gleitkommazahl ...
						UT = Number(HOUR) + (Number(minute)/60.) + (Number(second)/3600.) +  (Number(msecond)/1000./3600.);
						
						// Date Objekte für die Umstellung von Julianischen- auf
						// Gregorianischen Kalender aktuelles Datum holen ...
						// Date objects for the conversion from Julian to
						// Gregorian calendar get current date ...
						var date = new Date();						
						var date1 = new Date("1582", "10", "4");
						var date2 = new Date("1582", "10", "15")
						// Hilfsgrößen berechnen
						// Calculate auxiliary sizes
						if (MONTH <= 2) {
							y = YEAR - 1;
							m = MONTH + 12; 
						}else{
							y = YEAR;
							m = MONTH;
						}
						/* **************************************************
						 * Beschränkt man sich bei den Berechnungen nur auf den
						 * Zeitraum vom 01.03.1900 - 28.02.2100, dann kann man
						 * B = -15 setzen.
						 * The calculations are limited only to the
						 * Period from 01. 03. 1900 – 28. 02. 2100, then you can
						 * B = -15 set.
						 * **************************************************/
						// Übergebenes Datum liegt im Julianischen Bereich ...
						// Passed date is in the Julian area ...
						if (date <= date1){
							B = -2;
						// Übergebenes Datum liegt im Gregorianischen Bereich ...
						// Date passed is in the Gregorian range ...
						}else if (date >= date2){
							B = Math.floor(y/400) - Math.floor(y/100);
						}
						
						// Julianisches Datum berechnen anhand des siderischen Jahres ...
						// Calculate Julian date using the sidereal year ...
						ret = Number(Math.floor(365.25 * y) + Math.floor(30.6001 * (m + 1)) + B + 1720996.5 + DAY + (UT/24));

						// Und zurück zum Caller.
						// And back to the caller.
						return(ret);
						
					}
					
					
					/* *********************************************************************************
						Die Funktion ermittelt die Daylight Savings Time und gibt True bei
						Sommerzeit und False bei Winterzeit an den Aufrufer zurück.
						
						Übergabewert:
						d						= Objekt des aktuellen Datums als Date()Objekt
						
						Returnwert:
						Sommerzeit	= true
						Winterzeit		= false
						---------------------------------------------------------------------------------------------------
						The function determines the Daylight Savings Time and returns True at
						Daylight Saving Time and False at winter time back to the caller.

						Transfer value:
						d 						= object of the current date as Date () object

						Return value:
						DST 				= true
						Winter time 	= false
					  *************************************************************************************** */
					function isDST (d) {
						var ret = false;
						var JAN = 0; JUL = 0;
						// Das Datum vom 1. Januar des aktuellen Jahres ...
						// The date from 1. January of the current year . . .
						var jan = new Date(d.getFullYear(), 0, 1);
						// Das Datum vom 1. Juli des aktuellen Jahres ...
						// The date of 1. July of the current year . . .
						var jul = new Date(d.getFullYear(), 6, 1);
						// ... und jetzt für die Monate den Offset mit dem aktuellen Jahr
						// ermitteln ...
						// . . . and now determine the offset for the months with the current year . . .
						JAN = jan.getTimezoneOffset();
						JUL = jul.getTimezoneOffset();
																
						// ... die Zeitzone nach Osten ...
						// . . . the time zone to the east . . .
						if (JAN < 0 && JUL < 0){
							// ... Im Juli kleinerer Wert, also Sommerzeit ...
							// . . . in July smaller value, i. e. summer time ...
							if (JUL < JAN)
								ret = true;
							// ... Winterzeit ...
							// ... Winter time ...
							else if (JUL == JAN)
								ret = false;
						// ... Zeitzone nach Westen ...
						// ... Time zone to the west ...
						} else if (JAN > 0 && JUL > 0){
								// ... Im Juli kleinerer Wert, also Sommerzeit ...
								// . . . in July smaller value, i. e. summer time ...
								if (JUL < JAN){
									ret = true;
								// ... Winterzeit ...
								// ... Winter time ...
								}else if (JUL == JAN){
									ret = false;
								// ... Zeitzone Greenwich ...
								// ... Timezone Greenwich ...
								}else if (JAN == 0 && JUL == 0){
									ret = false;
								// ... Nicht logischer Wert.
								// ... Non logical value.
								}else{
									ret = false;
								}
						}
						// ... und zurück zum Aurufer .
						// . . . and back to the caller.	
						return (ret);
					}

					/* ************************************************************************************
					 *	Ermittelt den vergangenen Teil des Jahrhunderts, anhand des Datums,
					 * und berechnet daraus den schon vergangenen Teil des Jagrhunderts 
					 * vom 0.5 Januar des Datums bis zum Datum. Werte von 0.5 < T < 1 
					 * oder -0.5 < T < -1 sind möglich, jenachdem ob das Datum v. Chr. liegt 
					 * oder danach.
					 *
					 *	Die Übergabewerte werden nicht auf Plausibilität überprüft. Bitte vor dem Aufruf
					 *	der Funktion selber überprüfen.
					 *
					 *	Übergabeparameter:
					 *
					 *	year	= Jahr des zu berechneten Datums
					 *	jd		= Julianisches Datum des zu berechnenden Datums
					 *
					 *
					 *	Returnwert:
					 
					 *	Der Teil des vergangenen Jahrhunderts ab dem 0.5 Januar XXXX
					 * 	als Number und das	verwendete Jahrhundert, das ja als JXXXX 
					 *  bezeichnet wird.
					 *	
					 *	Array[0] = Das verwendete Jahrhunder, also z.B. 1900.
					 *	Array[1] = Das vergangene Jahrhundert.
					 *
					 * --------------------------------------------------------------------------------------------------
					* Determines the last part of the century, based on the date,
					* and calculates from it the already past part of the Jagrhundert
					* from 0. 5 January of the date to the date. Values of 0. 5 < T < 1
					* or -0. 5 < T < -1 are possible, depending on whether the date B. C. is located
					* or later. *
					* The transfer values are not checked for plausibility. Please before the call
					* check the function itself. 
					*
					* Handover parameters:
					*
					*year = year of the date to be calculated
					* jd = Julian date of the date to be calculated
					*
					*
					* Return value:

					* The part of the last century from 0. 5 January XXXX
					* as number and the century used, which is called JXXXX
					* is designated. *
					* Array[0] = The used century, i. e. B. 1900. * Array[1] = The past century.
					 *
					 *********************************************************************************** */
					function partOfTheCentury(year, jd){
						var YEAR = String(year);
						var JD = Number(jd);
						var CENTURY = [];
						
						// Beginn ist 0.5 Januar -4712. Bei kleineren Werten das Jahr 
						// auf -4712 setzen ...
						// Start is 0. 5 January -4712. For smaller values set the 
						// year to -4712 . . .
						if (parseInt(YEAR) < -4712){
							YEAR = String(-4712);
						}

						// ... Bei neagtiven jahren ...
						//. . . With neagtive jahren. . .
						if (parseInt(YEAR) < 0){
							// ... Jahrhundert aus den ersten 3 Zahlen extrahieren
							// und mit 100 zum Jahrhundert multiplizieren und ab
							// ins Array  an Index 0 ...
							//
							//. . . Extract century from the first 3 numbers
							// and multiply by 100 to the century and from
							// into the array at Index 0. . .
							CENTURY.push(parseInt(YEAR.substring(0, 3)) * 100);
						// Jahr ist = 0
						// Year is 0
						}else if (parseInt(YEAR) == 0){
							// ... und alles mit 0 auffüllen, also "0000"
							// . . . and fill everything with 0, so "0000"
							CENTURY.push(LPad(YEAR, 4, "0"));
						// Jahreszahl > 0
						// Year > 0
						}else{
							// Ersten zwei Zahlen als Jahrhunder extrahieren und * 100
							// und ab ins Array an Index 0
							//
							// extract the first two numbers as centuries and * 100
							// and off to the array at index 0
							CENTURY.push(parseInt(YEAR.substring(0, 2)) * 100);
						}
						
						// Aus JD und JD zum 0.5 Januar des Jahrhunderts T berechnen
						// und ab ins Array an Index 1
						//
						// Calculate from JD and JD to 0. 5 January of the century T
						// and off into the array to Index 1
						CENTURY.push((JD - calcJD(0, 1, CENTURY[0], 12, 0, 0, 0, 0)) / 36525);
						// ... und zurück zum Aufrufer.
						// ... and back to the caller.						
						return(CENTURY);
					}
					
					
					
					// Berechne die lokale Sternzeit  Stunden als Dezimalwert	
					// Calculate the local stardate hours as a decimal value					
					function localDate(lambda, st){
						var ST = Number(st);						// Die  Sternzeit	mittlere/wahre
																						// Stardate mean/true
						var LT = 0.0;											// Returnwert
																						// return value
						var LAMBDA = Number(lambda);	// Die geografische Länge des Ortes
																						// The geographical length of the place
						// Berechne Lokale Zeit und speichere sie in LT ...
						// Calculate local time and save it in LT. ..
						LT = ST + (LAMBDA *(1.0/15.0));
						// Ist die Zeit größer gleich 24.0, dann sind wir über 00:00:00.000 hinaus
						// und müssen die 24 entfernen und durch 00 ersetzen. Somit elemenieren
						// wir die 24 Uhr ...
						//
						// If the time is greater than 24. 0, then we are beyond 00:00:00. 000
						// and must remove the 24 and replace it with 00. Thus elemenate
						// we the 24 o’clock . . .
						if (LT >= 24.0) {
							// ... indem wird 0.0 + den dezimalen Nachkommaanteil berechnen ...
							//. . . by calculating 0. 0 + the decimal decimal percentage. . .
							LT = 0.0 + (LT - Math.floor(LT));
						}
						// ... und an den Aufrufer zurück.
						// ... and back to the caller.
						return(LT);
					}
					
					
					// Berechne die Länge des mittleren Frühlingspunktes bezogen auf den
					// wahren Frühlingspunkt
					// Calculate the length of the mean vernal equinox in relation to the
					// true vernal equinox
					function lengthMeanEquinox(t){
						var T = Number(t);															// Teil des Jahrhunderts seit 1.1.2000 12:00 Uhr
																														// Part of the century since 1. 1. 2000 12:00
						var L = Number(357.525 + 35999.049 * T);					// Mittlere Anomalie der Sonne	
																														// Medium anomaly of the Sun
						var F = Number(93.273 + 483202.019 * T);					// Mittlerer Knotenabstand des Mondes
																														// Mean nodal distance of the moon
						var D = Number(297.850 + 445267.111 * T);				// Mittlerer Abstand Mond - Sonne
																														// Medium distance Moon – Sun
						var Omega = Number(125.045 - (1934.136 * T));	// Mittlere Knotenlänge des Mondes
																														// Mean node length of the moon
						return( (-17.200 * Math.sin(Omega/RAD)) +  ( 0.206 * Math.sin((2 * Omega) / RAD )) - 
										( 1.319 * Math.sin ( (2 * (F-D+Omega))/RAD ) )+
										(0.143 * Math.sin (L/RAD) ) - ( 0.227 * Math.sin ((2 * (F+Omega))/RAD) )  );
					}
					
					
					
					// Berechne die mittlere Greenwich Sternzeit  Stunden als Dezimalwert
					// Calculate the mean Greenwich Stardate hours as a decimal value
					function meanGreenwichStardate(ut,  jd0){
						var UT = Number(ut);
						var JD0 = Number(jd0);
						return(6.664520 + 0.0657098244 * (JD0 - 2451544.5) + (1.0027379093 * UT));
					}
					
					
					// Berechne die ekliptische Schiefe in dezimalen Graden
					// Calculate the ecliptic skew in decimal degrees
					function meanEclipticInclination(t){
						var T = Number(t);
						return(23.439291 - (0.013004 * T));
					}
					
					
					/* ********************** Funktionen die beim Laden ausgeführt werden ************************ */
					/* ******************************** Functions performed at loading ******************************** */
					
					
					// Teste, ob der Rechner auf Sommer- o. Winterzeit steht ...
					// Test whether the computer is set to summer or winter time . . .
					ISDST = isDST(new Date(objDay.value, objMonth.value, objYear.value, 
												objHH.value, objMM.value, objSS.value,
												objMS.value));
					// ... und stelle das Ausgabefeld so ein. Sommerzeit = 1, Winterzeit = 0
					// . . . and set the output field like this. DST = 1, winter time = 0
					if (ISDST)objDST.value = 1;	else	objDST.value = 0;
					
					// Ermittle die Zeitzone aus dem Datum des Rechners ...
					// Identify the time zone from the date of the computer.
					TZ = getTZ();
					// ... ist er negativ geht's nach Osten, ansonsten nach Westen und
					// im entsprechenden Ausgabefeld eintragen.
					//
					//. . . is he negative’s going east, otherwise to the west and Enter 
					// in the corresponding output field.
					if (TZ < 0)objTZ.value = Math.abs(TZ);else  objTZ.value = TZ;
					
					/* ********************** Verwendete/Used Event Listener ************************ */
					
					// Klick auf den Button "Berechnen" ... Programm startet hier ...
					// Click on the button "Calculate" . . . Program starts here . . .
					objCalc.addEventListener("click", function () {
						// Startet die Berechnung
						// Starts the calculation
						start();
					});

					/* ********************************* Programm / Program ******************************* */
					
					
					// Berechnungsstart - Start the calculation
					function start(){

						// Mit der Funktion isLeapYear() und dem Parameter des
						// Berechnungsjahres (objYear.value) , wird festgestellt ob
						// es sich um ein Schaltjahr handelt und dies Ausgegeben.
						//
						// With the function isLeapYear () and the parameter of the
						// Calculation year (objYear. value), is determined whether
						// it is a leap year and this is output.
						if (isLeapYear(objYear.value))objLeapYear.value = "Ja";	else objLeapYear.value = "Nein";
						
						// Julianisches Datum des Berechnungsdatums mit der Funktion calcJD()und den Werten der Datums- und
						// Zeiteingabefeldern sowie Sommer/Winterzeit (DST) und Zeitzone (TZ)
						// berechnen und Ausgeben.
						//
						// Julian date of the calculation date with the function calcJD () and the values of the date and
						// Time input fields as well as summer/winter time (DST) and time zone (TZ)
						// Calculate and output.
						objJD.value = calcJD(objDay.value, objMonth.value, objYear.value, 
												objHH.value, objMM.value, objSS.value,
												objMS.value, objDST.value, objTZ.value);
												
						// Das Julianische Datum JD0 am 1.1.2000 um 12:00 Uhr mit der Funktion
						// calcJD() und den entsprechenden Werten dieses Referenzdatums berechnen
						// und Ausgeben.
						//
						// The Julianian date JD0 on 1. 1. 2000 at 12:00 o’clock with the function
						// calcJD () and calculate the corresponding values of this reference date
						// and output.
						objJD0.value = calcJD(1, 1, 2000, 12, 0, 0, 0, 0,0);
						
						// Berechnet den Teil des Jahrhunderts seit 1.1.2000 12:00 Uhr mit der
						// Funktion partOfTheCentury() und den Parametern der Epoche (2000)
						// und dem Julianischen Datum des aktuellen Datums. Speicher es in
						// dem Array Century ...
						//
						// Calculates the part of the century since 1. 1. 2000 12:00 with the
						// function partOfTheCentury () and the parameters of the epoch (2000)
						// and the Julian date of the current date. Store it in
						// the Array Century . . .
						Century = partOfTheCentury(2000, objJD.value);
						// ... und im Index 1 steht der Teil des Jahrhunderts als Dezimalwert und
						// gibt ihn aus.
						//
						// . . . and in index 1 is the part of the century as a decimal value and
						// Spends it.
						objCentury.value = Century[1];
						
						// Aktuelles Julianisches Datum imit der Funktion calcJD2Date() und dem
						// Parameter des aktuellen Julianischen Datums	(objJD.value)	in 
						// Datumsformat als Array umwandeln ...
						//
						// Current Julian date imit of the function calcJD2Date () and the
						// Parameters of the current Julian date (objJD. value) in
						// Convert date format as an array . . .
						var jdDate = calcJD2Date(Number(objJD.value));
						// Im Array jdDate[0] steht der Tag mit Dezimalwert als Uhrzeit ...
						// und davon den Dezimalteil erxtrahieren ...
						//
						// In the jdDate[0] array, the day with decimal value as time. . .
						// and extract the decimal part of it. . .
						decUT = jdDate[0] - Math.floor(jdDate[0]);
						// ... und als hh:mm:ss.ms UT ausgeben ...
						//
						// . . . and output as hh:mm:ss. ms UT . . .
						objUT.value = percentageOfDecimal2Time(decUT, "string");
						
						// Mit der Funktion meanGreenwichStardate() und 
						// den Parametern dezimale UT (decUT)
						// und dem Julianischen Datum vom 1.1.2000 
						// 12:00 Uhr(objJD0.value) die mittlere Greenwich
						// Sternzeit berechnen und mit der Funktion dectime2Time()
						// in hh.mm.ss.ms konvertieren und Ausgeben.
						//
						// With the meanGreenwichStardate () function and 
						// the decimal UT (decUT) parameters
						// and the Julian date of 1. 1. 2000 12:00 (objJD0. value)
						// the middle Greenwich
						// Calculate stardate and convert to hh. mm. ss. ms with the 
						// function dectime2Time ()and output.
						objTheta.value = dectime2Time(meanGreenwichStardate(decUT, objJD0.value), "string");
						
						// Berechnet die mittlere ekliptische Schiefe in dezimalen 
						// Grad mit der Funktion meanEclipticInclination()
						// und dem Parameter der Länge des vergangenen 
						// Jahrhunderts seit 2000 objCentury.value berechnen
						// und Ausgeben.
						//
						// Calculates the mean ecliptic inclination in decimal degrees 
						// with the meanEclipticInclination () function
						// and the parameter of the length of the last century since 2000 
						// to calculate objCentury. value and output.
						decEpsilon = meanEclipticInclination(objCentury.value);
						// ... dann mit der Funktion convertDecdegreesToString() 
						// und dem Parameter decEpsilon,
						// berechnet in der Zeile orher, konvertieren und Ausgeben als x° y' z''
						//
						// . . . then with the function convertDecdegreesToString ()
						// 	and the parameter decEpsilon,
						// calculated in the row orher, convert and output as x° y' z "
						objEpsilon.value =  convertDecdegreesToString(decEpsilon);
						
						// Die Länge des mittleren Frühlingspunkts bezogen 
						// auf den wahren Frühlingspunkt in Grad Sekunden
						// mit der Funktion lengthMeanEquinox() und dem 
						// Parameter der Länge des vergangenen Jahrhunderts
						// seit 2000 objCentury.value berechnen und Ausgeben.
						//
						// The length of the mean spring point relative to the true
						// spring point in degrees seconds
						// with the function lengthMeanEquinox () and the parameter 
						// of the length of the last century
						// since 2000 calculate and output objCentury. value.
						objDeltaPsi.value = lengthMeanEquinox(objCentury.value);
						
						// Die Zeitdifferenz zwischen mittlerer Greenwich Sternzeit 
						// und wahrer Greenwich Sternzeit in Sekunden aus
						// cos(Ekliptikschiefe x Längemittlerer Frühlingspunkt
						// / RAD berechnen und als Dezimalwert
						// Ausgeben. RAD ist in Moonpositions.js definiert.
						//
						// The time difference between mean Greenwich Stardate 
						// and true Greenwich Stardate in seconds
						// cos (Ecliptic slide x Longitudinal spring point) / 
						// Calculate RAD and use it as a decimal value
						// Output. RAD is defined in Moonpositions. js.
						objDeltaPsiMalEpsilon.value = Math.cos((Number(decEpsilon)* Number(objDeltaPsi.value))
																									/ RAD);
						
						// Die wahre Greenwich Sternzeit aus mittlere Greenwich Sternzeit  
						// mit der Funktion meanGreenwichStardate(decUT, objJD0.value)
						// + Zeitdifferent aus Mittlere/Wahre Greenwich Sternzeit dividiert durch 
						// 3600.0 s/h berechnen und dann mit der Funktion
						// dectime2Time() in hh:mm.ss.ms umgewandeltn und Ausgeben.
						//
						// The true Greenwich Stardate from mid-Greenwich Stardate with the 
						// meanGreenwichStardate function (decUT, objJD0. value)
						// + Calculate time difference from Middle/True Greenwich Stardate 
						// divided by 3600. 0 s/h and then use the function
						// dectime2Time () convert to hh:mm. ss. ms and output.
						objThetaApp.value = dectime2Time(Number(meanGreenwichStardate(decUT, objJD0.value)) +  
																						Number(objDeltaPsiMalEpsilon.value/3600.0), "string");
						
						//  Die mittlere lokale Sternzeit, berechnet mit der Funktion
						//  localDate() und den Parametern des dezimalen Längengrades objLambda.value und der mittleren
						//  Greenwich Sternzeit  aus der Funktion meanGreenwichStardate() und dessen Parametern 
						//  decUT und objJD0.value in einen dezimalen Wert verwandeln und in objThetaMeanLocal.value  speichern.
						//
						// The mean local star time, calculated with the function
						// localDate () and the parameters of the decimal length degree objLambda. value and the mean
						// Greenwich star time from the function meanGreenwichStardate () and its parameters
						// convert decUT and objJD0. value to a decimal value and save it to objThetaMeanLocal. value.
						objThetaMeanLocal.value = localDate(objLambda.value, meanGreenwichStardate(decUT, objJD0.value));
						
						// Hier wird dann die mittlere Lokale Sternzeit, berechnet in der Zeile vorher,  
						// mit der Funktion dectime2Time() und dessen Paramter
						// objThetaMeanLocal.value und "string" in das Format hh.mm.ss.ms umgewandelt. 
						//
						// Here is then the mean local star time, calculated in the line before,
						// with dectime2Time () and its parameters
						// objThetaMeanLocal. value and “string” converted to the format hh. mm. ss. ms.
						objThetaMeanLocal.value = dectime2Time(objThetaMeanLocal.value, "string");
						
						// Die wahre lokale Sternzeit mit der Funktion localDate()und den Parametern 
						// Längengrad, der mittleren Greenwich Sternzeit der Funktion meanGreenwichStardate(),
						// dessen Paramtern dezimale UT (decUT) und Julianischen Datum 
						// aus dem Ausgabefeld objJD0.value + dem Ausgabefeld objDeltaPsiMalEpsilon.value/3600.0, 
						// berechnen und im Ausgabefeld objThetaAppLocal.value  ausgeben.	
						//
						// The true local star time with the localDate () function and the parameters
						// Longitude, the mean Greenwich star time of the meanGreenwichStardate () function
						// its parameters decimal UT (decUT) and Julian date
						// from the output field objJD0. value + the output field objDeltaPsiMalEpsilon. value/3600. 0,
						// calculate and output objThetaAppLocal. value in the output field.						
						objThetaAppLocal.value = localDate(objLambda.value, Number(meanGreenwichStardate(decUT, objJD0.value)) + 
																						Number(objDeltaPsiMalEpsilon.value/3600.0));
						
						// Die wahre lokale Sternzeit in dezimaler Form aus dem Ausgabefeld 
						// objThetaAppLocal.value in hh.mm.ss.ms, mit der Funktion 
						// dectime2Time(objThetaAppLocal.value, "string"), umwandeln
						// und wieder im Ausgabefeld objThetaAppLocal.value speichern.
						// The true local star time in decimal form from the output field
						// objThetaAppLocal. value in hh. mm. ss. ms, with the function
						// convert dectime2Time (objThetaAppLocal. value, “string”)
						// and again save in the output field objThetaAppLocal. value.
						objThetaAppLocal.value = dectime2Time(objThetaAppLocal.value, "string");
						
						// Das lokale Datum und die Zeit (LT) inklusive des DST, also die 
						// wahre Zeit an dem Breitengrad des Ortes wo man steht.
						// Sie setzt sich zusammen aus Tag, Monat, Jahr aus dem Array 
						// jdDate[], dem berechneten lokalen Datum localDate() 
						// aus dem dezimalen Längengrad und dem dezimalen Wert für UT 
						//(decUT x 24.0 h/Tag ) +  den Wert für Sommer/Winterzeit
						// und dies mit dectime2Time()konvertiert in einen String "dd.mm.yyyy - hh:mm:ss.ms"
						//
						// The local date and time (LT) including the DST, i. e. the
						// true time at the latitude of the place where you stand. // It is composed of day, month, year from the array
						// jdDate[], the calculated local date localDate ()
						// from the decimal longitude and the decimal value for UT
						// (decUT x 24. 0 h/day) + the value for summer/winter time
						// and this with dectime2Time () converted to a string "dd. mm. yyyy - hh:mm:ss. ms"
						objLT.value = Math.floor(jdDate[0] )+  "." + jdDate[1] +  "." + jdDate[2] + " - " +  
						dectime2Time(localDate(objLambda.value,  (decUT * 24.0)) +  parseInt(objDST.value), "string");
						
					}

				}); // Ende alles geladen - End of all things loaded
				
			}); // Ende DOM geladen - End of DOM loaded
			

		</script>
		
	</head>
	
	<body id="b">
	
		<table border="0">
		
			<tr>
				<th id="label" colspan="8">
					<center>Sternzeit [Siderial Time (ST/LST)] & Lokalzeit [LT]</center>
				</th>
			</tr>
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
			<tr>
				<td id="label">
						Tag:
				</td>
				
				<td id="value">
					<input id="day" type="text" maxlength="2" value="23"></input>
				</td>

				<td id="label">
					Monat:
				</td>
				
				<td id="value">
						<input id="month" type="text" maxlength="2" value="10"></input>
				</td>

				<td id="label">
					Jahr:
				</td>
				
				<td id="value">
					<input id="year" type="text" maxlength="4" value="2020"></input>
				</td>

				<td id="label" title="Ernittelt automatisch, ob das Jahr ein Schaltjahr ist">
					Schaltjahr:
				</td>
				
				<td id="value">
					<input id="leapyear" title="Ernittelt automatisch, ob das Jahr ein Schaltjahr ist" type="text" value="" disabled="disabled"></input>
				</td>

			</tr>
			<tr>
				<td id="label" title="Die Stunde nach UTC, also die Stunde die man auf der Uhr abliest" >
					Stunde:
				</td>
				
				<td id="value">
					<input id="hour" title="Die Stunde nach UTC, also die Stunde die man auf der Uhr abliest" maxlength="2" type="text" value="00"></input>
				</td>

				<td id="label" title="Die Minute nach UTC, also die Minute die man auf der Uhr abliest" >
					Minute:
				</td>
				
				<td id="value">
					<input id="minute" title="Die Minute nach UTC, also die Minute die man auf der Uhr abliest" type="text" maxlength="2" value="00"></input>
				</td>

				<td id="label" title="Die Sekunde nach UTC, also die Sekunde die man auf der Uhr abliest">
					Sekunde:
				</td>
				
				<td id="value">
					<input id="second" title="Die Sekunde nach UTC, also die Sekunde die man auf der Uhr abliest" type="text" maxlength="2" value="00"></input>
				</td>

				<td id="label" title="Die Milli-Sekunde nach UTC, also die Milli-Sekunde die man auf der Uhr abliest">
					Millisekunde:
				</td>
				
				<td id="value" title="Die Milli-Sekunde nach UTC, also die Milli-Sekunde die man auf der Uhr abliest">
					<input id="msecond" type="text" maxlength="3" value="000"></input>
				</td>

			</tr>
			
			<tr>
			
				<td id="label">
					<label title="Daylight Saving Time (Sommer/Winterzeit)">DST:</label>
				</td>
				
				<td  id="value">
					<input title="Daylight Saving Time (Sommer/Winterzeit)" id="dst" type="text" maxlength="1" value="1" ></input>
				</td>
				
				<td id="label">
					<label title="Timezone (Westlich -, Östlich +)">TZ:</label>
				</td>
				
				<td  id="value">
					<input title="Timezone (Westlich -, Östlich +)" id="tz" type="text" maxlength="1" value="0" ></input>
				</td>
			
				<td id="label">
					<label title="Der aktuelle Längengrad (Östlich +, Westlich -), an dem man gerade steht">λ<sub>[°]</sub>:</label>
				</td>
				
				<td id="value">
					<input title="Der aktuelle Längengrad (Östlich +, Westlich -), an dem man gerade steht" id="longitude" type="text" value="7.225344" ></input>
				</td>
				
				<td id="label">
					<label title="Die lokale Zeit (LT) am Ort des verwendeten Längengrads inklusive der Sommer/Winterzeit">LT<sub>[hh:mm:ss.ms]</sub>:</label>
				</td>
				
				<td id="value">
					<input class="color" title="Die lokale Zeit (LT) am Ort des verwendeten Längengrads inklusive der Sommer/Winterzeit" id="lt" type="text" value="0.0" ></input>
				</td>

			</tr>
			
				<td id="label">
					<label title="Julianisches Datum des zu berechnenden Datums">JD:</label>
				</td>
				
				<td  id="value">
					<input title="Julianisches Datum des zu berechnenden Datums" id="jd" type="text" value="" disabled="disabled"></input>
				</td>
			
			<td id="label">
					<label title="Julianisches Datum am 1.1.2000 12:00 Uhr Weltzeit (UT) als Referenzdatum">JD<sub>0</sub>:</label>
				</td>
				
				<td  id="value">
					<input title="Julianisches Datum am 1.1.2000 12:00 Uhr Weltzeit (UT) als Referenzdatum" id="jd0" type="text" value="" disabled="disabled"></input>
				</td>
				
				<td id="label">
					<label title="Die Weltzeit (UT) des aktuellen Datums als hh:mm:ss.ms">UT:</label>
				</td>
				
				<td id="value">
					<input class="color"  title="Die Weltzeit (UT) des aktuellen Datums als hh:mm:ss.ms" id="ut" type="text" value="" disabled="disabled"></input>
				</td>
			
				<td id="label">
					<label title="Teil des vergangenen Jahrhunderts der Epoche seit 1.1.2000 12:00 Uhr">T<sub>2000</sub>:</label>
				</td>
				
				<td id="value">
					<input title="Teil des vergangenen Jahrhunderts der Epoche seit 1.1.2000 12:00 Uhr" id="century" type="text" value="" disabled="disabled"></input>
				</td>
			
			<tr>
			
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
			<tr>
				<td colspan="8">
					<center><input id="calc" type="button" value="Berechnen"></input></center>
				</td>
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
			
			<tr>
				<td id="label" colspan="8">
					<center>Nach Oliver Montenbruck - Grundlagen der Ephemeridenberechnung</center>
				</td>
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
		
			<tr>
			
				<td id="label">
					<label title="Die mittlere Geenwich Sternzeit in hh.mm.ss.ms">Θ:</label>
				</td>
				
				<td  id="value">
					<input title="Die mittlere Geenwich Sternzeit in hh.mm.ss.ms" id="theta" type="text" value="0.0" disabled="disabled" ></input>
				</td>
			
				<td id="label">
					<label title="Mittlere Ekliptik Schiefe zum Berechnungszeitpunkt">ε<sub>[°]</sub>:</label>
				</td>
				
				<td  id="value">
					<input title="Mittlere Ekliptik Schiefe zum Berechnungszeitpunkt" id="epsilon" type="text" value="0.0" disabled="disabled"></input>
				</td>
				
				<td id="label">
					<label title="Die Länge des mittleren Frühlingspunktes bezogen auf den wahren Frühlingspunkt in Grad Sekunden">Δψ<sub>['']</sub>:</label>
				</td>
				
				<td id="value">
					<input title="Die Länge des mittleren Frühlingspunktes bezogen auf den wahren Frühlingspunkt in Grad Sekunden" id="deltapsi" type="text" value="0.0" disabled="disabled"></input>
				</td>
				
				<td id="label">
					<label title="Differnz zwischen mittlerer Greenwich Sternzeit und wahrer Greenwich Sternzeit">Δψ x ε <sub>['']</sub>:</label>
				</td>
				
				<td id="value">
					<input title="Differnz zwischen mittlerer Greenwich Sternzeit und wahrer Greenwich Sternzeit"" id="deltapsimalepsilon" type="text" value="0.0" disabled="disabled"></input>
				</td>
				
			</tr>
			
			<tr>
			
				<td id="label">
					<label title="Die wahre Greenwich Sternzeit in hh.mm.ss.ms">θ<sub>app</sub>:</label>
				</td>
				
				<td  id="value">
					<input class="color"  title="Die wahre Greenwich Sternzeit in hh.mm.ss.ms" id="thetaapp" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Die mittlere lokale Sternzeit (LST), in hh:mm:ss.ms">Θ</label>
				</td>
				
				<td  id="value">
					<input title="Die mittlere lokale Sternzeit (MLST), in hh:mm:ss.ms" id="thetameanlocal" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Die wahre lokale Sternzeit (LST), in hh:mm:ss.ms">θ:[app]</label>
				</td>
				
				<td  id="value">
					<input class="color"  title="Die wahre lokale Sternzeit (LST), in hh:mm:ss.ms" id="thetaapplocal" type="text" value="0.0" disabled="disabled" ></input>
				</td>

			</tr>
			
			<tr>

			</tr>
		
		</table>

	</body>

</html>