<!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>[Sonnen Auf- und Untergang]</title>
		
		<!-- Browser speichert keine Seite im Cache -->
		<!-- Browser does not store a page in the cache -->
		<meta http-equiv='cache-control' content='no-cache'>
		<meta http-equiv='expires' content='0'>
		<meta http-equiv='pragma' content='no-cache'>
		
		<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="https://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) {
			
					/* **************************** Externe Quelldateien Laden *********************************************** */	

					// Funktion zum Einfügen der einzelnen Javascript Dateien.
					// Function to insert the individual Javascript files.
					function include(file) { 
					  
					  var script  = document.createElement('script'); 
					  script.src  = file; 
					  script.type = 'text/javascript'; 
					  script.defer = true; 
					  
					  document.getElementsByTagName('head').item(0).appendChild(script); 
					  
					}
					
					// Variablendefinitionen und Deklarationen ...
					// definitions of variables and declarations ...
					include('./Globale-This.js');
					
					// Keyboard Event Funktionen, die von den Listenern benutzt werden
					// Datei muss hier lokal liegen, da andere Kontrollelemente verwendet werden
					include('./Keyboard.js');
					
					// Keyboard Eventlistener
					// Datei muss hier lokal liegen, da andere Kontrollelemente verwendet werden
					include('./Keyboard-Listener.js');
					
					// Nützliche Funktionen wie Sommerzeit/Winterzeit, Popup Öffnen ...
					// Useful functions like Daylight Savings Time, open popups ...
					include('../../Bibliotheken/Utilities.js');

					// Funktionen zur Berechnungen/Konvertierung des Julianischen Datum
					// Functions for calculations/conversion of the Julian date
					include('../../Bibliotheken/calculateJD.js');

					// Konvertierung von Uhrzeiten
					// Conversion of times
					include('../../Bibliotheken/decTime.js');
					
					// Funktionen für die Mondpositionen
					// Functions for the moon positions
					include('../../Bibliotheken/Moonpositions.js');
					
					// Funktionen für die Sonnenpositionen
					// Functions for the sun positions
					include('../../Bibliotheken/Sunpositions.js');
					
					// Funktionen für die Sternzeit/Lokale Zeit
					// Functions for the siderial/local time
					include('../../Bibliotheken/SiderialTime.js');
					
					// Funktionen für Sonnen Auf- und Untergang
					// Functions for the sunrise and sunset
					include('../../Bibliotheken/SunRiseSet.js');
					
					// Funktionen für Mond Auf- und Untergang
					// Functions for the moonrise and moonset
					include('../../Bibliotheken/MoonRiseSet.js');
					
					// Funktionen für die Berechnung der Objekthöhe über dem Horizont
					// Functions for calculating the object height above the horizon
					include('../../Bibliotheken/ObjectHeight.js');

				// 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(){
				
				
				/* ***************************************************Füllen der Eingabefelder******************************************************* */
					/* ******************************************************Fill the input fields************************************************************ */
					
						//Füllen der Datumsfelder mit dem aktuellen Datum.
						//Fill the date fields with the current date.
						objDay.value = d.getDate();				// Tag - Day
						objMonth.value = d.getMonth() + 1;	// Monat - Month
						objYear.value = d.getFullYear();		// Jahr - Year

						/* ********************** 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(objYear.value, objMonth.value, objDay.value, 0, 0, 0, 0));
						// ... 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;
						
					/* ***************************************************GeoPosition******************************************************* */
					
						// Hole Dir die Positionsdaten des Rechners und übergebe dabei die
						// Ergebnisfelder für Längengrad, Breitengrad und Genauigkeit.
						// Get the position data of the computer and hand over the
						// Result fields for longitude, latitude.
						// In Utilities.js
						startGeoPosition(objLongitude, objLatitude, 0);
					
					/* ********************** Verwendete/Used Event Listener ************************ */
	
						// Erstellt einen neuen Kommuikationskanal an dem alle Hören und damit
						// Senden können.
						// Creates a new communication channel where all listening and thus
						// Can send.
						var objChannel = new BroadcastChannel("com");
					
						// Wenn das SiderialTime Program beendet wird, dann Sende auf dem Kanal
						// diese Info, damit in Wordpress die Fenstervariable wieder zurückgesetzt
						// wird und das Programm wieder starten kann.
						// If the SiderialTime Program is terminated, then send on the channel
						// this info, so that in Wordpress the window variable is reset
						// and the program can start again.
						window.addEventListener("beforeunload", function(event){
							objChannel.postMessage("sunriseset is closed");
						});
		
						// 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();
						});
						
						// Klick auf die Auswahlliste "Dämmerung" ... Programm startet hier ...
						// Click on the drodown menue "Twilight" . . . Program starts here . . .
						objTwilightkind.addEventListener("change", function() {
							// Startet die Berechnung
							// Starts the calculation
							start();
						});

					/* ********************************* Programm / Program ******************************* */
					
					// Berechnungsstart - Start the calculation
					function start(){
					
						// Prüfe vor dem Berechnungsbeginn noch einmal, ob nicht eine falsche Eingabe des Tages,
						// in Hinblick auf ein Schaltjahr und den Monat Februar, vorgenommen wurde. Dazu kann man
						// die Callback Funktion des Eventlisteners des Tages für die Änderung benutzen.
						// Check again before the calculation starts, if there is a wrong entry of the day, 
						// with regard to a leap year and the month February. To do this, you can use
						// the callback function of the event listener of the day for the change.
						keydownChangeDay(objDay, objMonth, objLeapYear);
						keydownChangeMonth(objMonth);
						keydownChangeYear(objYear, objLeapYear);
						keydownChangeDST(objDST);
						keydownChangeTZ(objTZ);
						keydownChangeLongitude(objLongitude);
						keydownChangeLatitude(objLatitude);
					
						// 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";
						
						// Mit der Funktion wird die Plausibilität von Zeitzone und Längengrad überprüft. Beide
						// müssen korrespondieren. Z.B. muss die TZ = 1 mit einem Längengrad von 0° - 15° Ost
						// übereinstimmen. TZ = -1 mit 0° bis -15° .... usw. Wir haben von 0° = Grennwich Meridian
						// bis +180° und -180° in der Länge und Zeitzone von 0 = Grennwich bis +12 und -12.
						if (testTimezoneAndLongitude(objTZ.value , objLongitude.value)== false ){
							// Gebe Meldung über fehlerhalte Zeitzone + Längengrad ...
							// Error message for a mistake in time zone and longitude ...
							alert("Fehler bei Zeitzone und Längengrad des Standortes!\nKeine Berechnung");
							// ... und beende das Programm.
							// ... exit of the program
							return(false);
						}
						// ********************************* Sunrise/Set / SonnenAuf- und Untergang *******************************
						//
						// Wenn der aktuelle Berechnungstag verschieden vom schon berechneten Tag ist,
						// dann berechne die Daten neu ...
						// If the current calculation day is different from the already calculated day,
						// then recalculate the data ...
						if ((saveSunRiseSetDay != objDay.value) || (saveSunRiseSetMonth != objMonth.value) ||
								(saveSunRiseSetYear != objYear.value)||  (saveSunRiseSetDST != objDST.value)||
								(saveSunRiseSetTZ != objTZ.value)||  (saveSunRiseSetLong != objLongitude.value)||  
								(saveSunRiseSetLat != objLatitude.value) || (saveTwilightKind != objTwilightkind.value)){
							//
							// **********************************  Sonnenaufgang / Sun rise  ********************************************
							//
							// ... und speichere zuerst den neu berechneten Tag/Monat/Jahr/DST/TZ/Längengrad/Breitengrad ...
							// . . . and first save the newly calculated day/month/year/DST/TZ/Longitude/Latitude . . .
							saveSunRiseSetDay = objDay.value;
							saveSunRiseSetMonth= objMonth.value;
							saveSunRiseSetYear = objYear.value;
							saveSunRiseSetDST = objDST.value;
							saveSunRiseSetTZ= objTZ.value;
							saveSunRiseSetLong = objLongitude.value;
							saveSunRiseSetLat = objLatitude.value;
							saveTwilightKind  = objTwilightkind.value;
							
							// ******************************** Sonnenaufgang - Sun rise *****************************
							
							// ... und berechne dann den Sonnenaufgang ...
							// . . . and then work out the moon up . . .
							LCT = sunriseLocalTime(objDay.value, objMonth.value, objYear.value, 
																		  objDST.value, objTZ.value, objLongitude.value, objLatitude.value);
							LCT[0]  = LCT[0] + 0.0083333	;								  
							// ********************************* Sonnenuntergang - Sun set ****************************
							
							// ... und berechne dann den Sonnenuntergang ...
							// . . . and then work out the sun down . . .
							LCTS = sunsetLocalTime(objDay.value, objMonth.value, objYear.value, 
																		  objDST.value, objTZ.value, objLongitude.value, objLatitude.value);	
							LCTS[0]  = LCTS[0] + 0.0083333	;	

							// *********************** Berechne die Dämmerungsdaten *************************
							// ************************** Calculate data of twilight ***************************	
							
							// Dämmerung Morgens bis zum Sonnenaufgang in einem Array mit Index 0 - 3 ...
							// Twilight  Morning until sunrise in an array with index 0 – 3 ...
							arrTwilightRise = twilightLCT(objDay.value, objMonth.value,  objYear.value, objDST.value, objTZ.value, objLongitude.value, objLatitude.value, objTwilightkind.value,"am");
							// Dämmerung Abends nach dem Sonnenuntergang in einem Array mit Index 0 - 3 ...
							// Twilight  Morning until sunset in an array with index 0 – 3 ...
							arrTwilightSet = twilightLCT(objDay.value, objMonth.value,  objYear.value, objDST.value, objTZ.value, objLongitude.value, objLatitude.value, objTwilightkind.value,"pm");
							
							// ********* Statusinformationen auswerten - Evaluate status information **************	
							
							// Ausgabe des Status des Sonnenaufgangs
							// Output of the status of sunrise
							objStateSunRise.value = LCT[1] + ":" + LCT[2];
							// Ausgabe des Status des Sonnenuntergangs
							// Output of the status of sunset
							objStateSunSet.value = LCTS[1] + ":" + LCTS[2];
							// ... in Index 1 ist der Status der Konvertierung von GST nach UT. Werte sind "Warnung" + "OK ...
							// --- in Index 2 ist der Status des Mondaufgangs und -Untergangs enthalten. Werte sind "OK",
							// "Nie Sichtbar" und "Immer Sichtbar" ...
							// . . . in Index 1 is the conversion status from GST to UT. Values are “Warning” + “OK . . .
							// --- Index 2 includes the status of the moon’sun rise and set. Values are “OK”,
							// “Never Visible” and “Always Visible” . . .
							// Sonnenaufgang - Sun rise
							statGSTUT_LCT = LCT[1].toLowerCase();
							statRise_LCT = LCT[2].toLowerCase();
							// Sonnenuntergang - Sun set
							statGSTUT_LCTS = LCTS[1].toLowerCase();
							statRise_LCTS = LCTS[2].toLowerCase();
							
							// Den Status der Dämmerungberechnung Morgens ermitteln ...
							//  Determine the status of the twilight calculation in the morning ...
							statGSTUTRise_TwilightLCT = arrTwilightRise[1];
							statRise_TwilightLCT = arrTwilightRise[2];
							
							// Den Status der Dämmerungberechnung Abends ermitteln ...
							// Determine the status of the twilight calculation in the evening ...
							statGSTUTSet_TwilightLCT = arrTwilightSet[1];
							statSet_TwilightLCT = arrTwilightSet[2];
							
							// ************ Aufgang und Untergang Azimut und Höhe und Status **************	
							// ******************** Rise and fall Azimuth and Height and Status *****************
							
							// ... hier berechne Azimuth und Höhe der Sonne über dem Horizont Sonnenaufgang...
							// ... here calculate azimuth and altitude of the Sun above the horizon sunrise ...
							sunriseAzH = sunriseAZ(objDay.value, objMonth.value, objYear.value, 
																		objDST.value, objTZ.value, objLongitude.value, objLatitude.value);
							// ... Status String der Konvertierung von GST zu UT beim Azimut und Höhe, OK oder Warning ...
							//  ... Convert string status from GST to UT at azimuth and altitude, OK or Warning ...
							statGSTUT_AzH_Rise = sunriseAzH[3].toLowerCase();
							// ... Status der Sichtbarkeit beim Azimut und Höhe OK, Immer sichtbar, Nie sichtbar ...
							//  ... Visibility status at azimuth and altitude OK, Always visible, Never visible ...
							statVISI_AzH_Rise = sunriseAzH[4].toLowerCase();
							// ... hier berechne Azimuth und Höhe der Sonne über dem Horizont Sonnenuntergang...
							// ... here calculate azimuth and altitude of the Sun above the horizon sunset ...
							sunsetAzH  = sunsetAZ(objDay.value, objMonth.value, objYear.value, 
																		objDST.value, objTZ.value, objLongitude.value, objLatitude.value);
							// ... Status String der Konvertierung von GST zu UT beim Azimut und Höhe, OK oder Warning ...
							//  ... Convert string status from GST to UT at azimuth and altitude, OK or Warning ...
							statGSTUT_AzH_Set = sunsetAzH[3].toLowerCase();
							// ... Status der Sichtbarkeit beim Azimut und Höhe OK, Immer sichtbar, Nie sichtbar ...
							//  ... Visibility status at azimuth and altitude OK, Always visible, Never visible ...
							statVISI_AzH_Set = sunsetAzH[4].toLowerCase();
							
							// ********** Ausgabe der Auf/Untergangsdaten - Output of sun rise/set data *********************	
							
							// Ausgabe des Sonnenaufgangs/Untergangs Datum und Uhrzeit, Azimut und Höhe ...
							// Ist der Status bei allem "OK" ...
							// Output of sunrise/set Date and time, azimuth and height  ...
 							//  Is the status of everything “OK” ...
							if ( ((statGSTUT_LCT == "ok" &&  statRise_LCT  == "ok") && (statGSTUT_AzH_Rise  == "ok" &&  statVISI_AzH_Rise == "ok")) && 
									((statGSTUT_LCTS == "ok" &&  statRise_LCTS  == "ok") && (statGSTUT_AzH_Set  == "ok" &&  statVISI_AzH_Set == "ok"))  /*&&
									((statGSTUTRise_TwilightLCT == "OK" && statRise_TwilightLCT == "OK") && (statGSTUTSet_TwilightLCT == "OK" && statSet_TwilightLCT == "OK")) */ ){
								// ... dann gebe Datum und Uhrzeit des Sonnenaufgangs aus ...
								//  ... then give the date and time of sunrise ...
								objTimeSunRise.value = objDay.value + "." + objMonth.value + "." + objYear.value + " - " + dectime2Time(LCT[0] , "String");
								// ... hier den Azimut des Sonnenaufgangs ... Im Süden beginnt der Azimut, daher - 180°
								// . . . here the azimuth of the sunrise . . . m  South begins the azimuth, so -  180°
								objAZSunRise.value = sunriseAzH[0] - 180.0;
								// ... hier die Höhe des Sonnenaufgangs über dem Horizont...
								//  ... here the height of the sunrise above the horizon...
								objHSunRise.value = sunriseAzH[1];
								// ... dann gebe Datum und Uhrzeit des Sonnenuntergangs aus ...
								//  ... then give the date and time of sunset ...
								objTimeSunSet.value = objDay.value + "." + objMonth.value + "." + objYear.value + " - " + dectime2Time(LCTS[0] , "String");
								// ... hier den Azimut des Sonnenaufgangs ... m Süden beginnt der Azimut, daher - 180°
								// . . . here the azimuth of the sunrise . . .m  South begins the azimuth, so -  180°
								objAZSunSet.value = sunsetAzH[0] - 180.0 ;
								// ... hier die Höhe des Sonnenaufgangs über dem Horizont...
								//  ... here the height of the sunrise above the horizon...
								objHSunSet.value = sunsetAzH[1];
								
								// *********************** Ausgabe des Sonnenhöchststands *************************	
								//  ************************* Output of the sun’s maximum  ****************************
								
								// ... nun das Julianisches Datum des Sonnenaufgangs ermitteln ...
								// . . . now determine the Julian date of sunrise . . .
								jdSunRise = calcJD(objDay.value, objMonth.value , objYear.value, LCT[0] , 0, 0, 0,  0, 0);
								// ... nun das Julianisches Datum des Sonnenuntergangs in Greenwich ermitteln ...
								// . . . now determine the Julian date of the sunset in Greenwich . . .
								jdSunSet = calcJD(objDay.value, objMonth.value , objYear.value, LCTS[0] , 0, 0, 0,  0, 0);
								
								// ... danach die Differenz zwischen dem JD von Set und Rise ...
								// . . . then the difference between the JD of Set and Rise . . .
								jdSunRiseSetDiff = (jdSunSet - jdSunRise);
								// ... die Differnez / 2 ergibt das JD des Sonnenstandes am höchsten Punkt, genau
								// in der Mitte der Sichtbarkeit ...
								// . . . the Differnez / 2 gives the JD of the sun's position at the highest point, exactly 
								// in the middle of the visibility . . .
								jdSunRiseSetHalf = jdSunRiseSetDiff / 2 ;
								// ... und das JD des Sonnenaufgangs + die Hälfte ergibt das JD der Mitte der Sichtbarkeit
								// am höchsten Punkt der Sonne am Himmel ...
								// . . . and the JD of sunrise + half gives the JD of the center of visibility 
								// at the highest point of the sun in the sky . . .
								jdSunRiseSetHalfDate = jdSunRise + jdSunRiseSetHalf ;
								// ... dann aus dem JD des höchsten Punkts am Himmel wieder ein Datum berechnen ...
								// . . . then calculate a date again from the JD of the highest point in the sky . . .
								arrjdSunRiseSetHalfDate = julianDate2Date(jdSunRiseSetHalfDate);
								// ... Datum und Uhrzeit des höchsten Sonnenstandes am Himmel ...
								//  ... date and time of the highest sun position in the sky ...								
								objSunHighDate.value = Math.floor(arrjdSunRiseSetHalfDate[0]) + "." + arrjdSunRiseSetHalfDate[1] + "." + arrjdSunRiseSetHalfDate[2] +
																										"  -  " +  percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "string");
								// ... Azimut des höchsten Sonnenstandes am Himmel ...
								//  ... Azimuth of the highest sun position in the sky ...
								objSunHighAz.value = (Number(objAZSunRise.value ) + ((Number(objAZSunSet .value) -  Number(objAZSunRise.value)) / 2 ));
								// ... Uhrzeit des Sonnenhöchststand am Himmel in einem Array Index 0 - 3 ...
								// ... 0 = h, 1=m, 2=s
								//  ... time of the sun’s highest position in the sky in an array index  0 – 3 ...
 								//  ...  0 = h, 1=m, 2=s
								var noonTime = percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "array");
								// ... Azimut und Höhe der Sonne berechnen ...
								// ...  Calculate the azimuth and altitude of the sun ...
								var highSunPos = precSunHorAZHeight(noonTime[0], noonTime[1], noonTime[2], objDST.value, objTZ.value, objDay.value, objMonth.value, objYear.value, objLongitude.value, objLatitude.value);
								// ... und die Höhe ausgeben ...
								// ... and output the height ...
								objSunHighDeg.value = highSunPos[1];
								// ... wenn der neu berechnete Azimuth der Sonnenhöhe unterschiedlich zur vorher berechneten Höhe ist, dann updaten ...
								//  ... if the newly calculated azimuth of the sun’s altitude is different from the previously calculated altitude, then update ...
								if (highSunPos[0] !=  objSunHighAz.value) objSunHighAz.value = highSunPos[0];	
								
								// Wenn der Status der Dämmerung in allen Fällen "OK" ist ...
								//  If the status of twilight is “OK” in all cases ...
								if ((statGSTUTRise_TwilightLCT == "OK" && statRise_TwilightLCT == "OK") && (statGSTUTSet_TwilightLCT == "OK" && statSet_TwilightLCT == "OK")){
									// Dämmerung Morgens und Abends ausgeben..
									// Twilight  Spend in the morning and evening..
									objTwilightRise.value = dectime2Time(arrTwilightRise[0], "string");
									objTwilightSet.value = dectime2Time(arrTwilightSet [0], "string");
								// ... hier ist nicht alles Ok ...
								// ... everything is not okay
								}else{
									// Wenn es in der Nacht immer etwas gämmerig bleibt ... Monate 5 + 6 ...
									// bei astonomischer Dämmerung ...
									// ... if she always stays a little twilight during the night . . . Months 5 and 6 
									// . . . at astronomical twilight
									objTwilightRise.value = "Dämmerung die ganze Nacht";;
									objTwilightSet.value = "Dämmerung die ganze Nacht";
								}
								// ... und Dämmerungsstatus Morgens vor Sonnenaufgang ausgeben ...
								// ... and output twilight status in the morning before sunrise ...
								objTwilightStateRise.value = statGSTUTRise_TwilightLCT + ":" + statRise_TwilightLCT;
								// ... und Dämmerungsstatus Abends nach Sonnenuntergang ausgeben ...
								// ... and output twilight status in the evening after sunset ...
								objTwilightStateSet.value = statGSTUTSet_TwilightLCT + ":" + statSet_TwilightLCT;
								
								// ... stimmt bei einem etwas nicht ...
								//  ... something is wrong with one ...
							}else{
								// ... dann gebe nur das Datum und den Status der Sichtbarkeit aus ...
								// . . . then just display the date and the status of visibility . . .
								objTimeSunRise.value = objDay.value + "." + objMonth.value + "." + objYear.value + " - " + LCT[2];
								objTimeSunSet.value = objDay.value + "." + objMonth.value + "." + objYear.value + " - " + LCTS[2];
								// ... und schreibe in den Azimut und die Höhe die Sichtbarkeit ...
								// ... and write in the azimuth and the altitude the visibility ...
								objAZSunRise.value = LCT[2];
								objHSunRise.value = LCT[2];
								objAZSunSet.value = LCTS[2];
								objHSunSet.value = LCTS[2];
								objSunHighDate.value  = LCT[2];
								objSunHighAz.value = LCT[2];
								// ... Uhrzeit des Sonnenhöchststand am Himmel in einem Array Index 0 - 3 ...
								// ... 0 = h, 1=m, 2=s
								//  ... time of the sun’s highest position in the sky in an array index  0 – 3 ...
 								//  ...  0 = h, 1=m, 2=s
								var noonTime = percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "array");
								// ... Azimut und Höhe der Sonne berechnen ...
								// ...  Calculate the azimuth and altitude of the sun ...
								var highSunPos = precSunHorAZHeight(noonTime[0], noonTime[1], noonTime[2], objDST.value, objTZ.value, objDay.value, objMonth.value, objYear.value, objLongitude.value, objLatitude.value);
								// ... und die Höhe ausgeben ...
								// ... and output the height ...
								objSunHighDeg.value = highSunPos[1];
								// Dämmerungsstatus wenn etwas nicht OK ist ausgeben ...
								// Twilight status when something is not  OK is to spend ...
								if (arrTwilightRise[3] != "OK"){
									objTwilightStateRise.value = arrTwilightRise[3];
									objTwilightStateSet.value = arrTwilightRise[3];
									objTwilightRise.value = arrTwilightRise[3];
									objTwilightSet.value = arrTwilightRise[3];
								}
								
							}// Ende bei der Berechnung der Daten stimmt etwas nicht.
							 // End of the calculation of the data something is wrong.
							
							// Berechnung der Entfernung der Sonne und Winkelgröße am Himmel.
							// Calculation of the distance of the Sun and angular magnitude in the sky.
							sunDiameter = calcSunDistanceAndDiameter(objDay.value, objMonth.value,  objYear.value, noonTime[0], noonTime[1], noonTime[2], objDST.value, objTZ.value);
							// Entfernung Sonne-Erde in Array 0
							// Distance sun-earth in array 0
							objSunDistance.value = sunDiameter [0];
							// Winkeldurchmesser der Sonne in Array 1
							// Angular size in array 1
							objSunAngularSize.value = sunDiameter [1];
							
							// Winkeldurchmesser der Sonne in Array 1
							// Angular size in array 1
							objSunAngularSize2.value = decDegrees2AngleOfHours(sunDiameter [1]);

						}
						
					}// End of start()

				}); // 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>Sonnen Auf- und Untergang</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="7"></input>
				</td>

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

				<td id="label">
					Jahr:
				</td>
				
				<td id="value">
					<input id="year" type="text" maxlength="4" value="1979"></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">
					<label title="Daylight Saving Time (Sommerzeit = 1 / Winterzeit = 0)">DST:</label>
				</td>
				
				<td  id="value">
					<input title="Daylight Saving Time (Sommerzeit = 1 / Winterzeit = 0)" id="dst" type="text" maxlength="1" value="0" ></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="3" 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="1" ></input>
				</td>
				
				<td id="label">
					<label title="Der aktuelle Breitengrad (Nördlich +, Südlich -), an dem man gerade steht">β<sub>[°]</sub>:</label>
				</td>
				
				<td id="value">
					<input  title="Der aktuelle Breitengrad (Nördlich +, Südlich -), an dem man gerade steht" id="latitude" type="text" value="1" ></input>
				</td>

			</tr>
			
			<tr>
			
				<td id="label">
					<label title="Welche Dämmerungsart möchten Sie berechnen?">Dämmerung:</label>
				</td>
				
				<td id="value">
					<select id="twilightkind" title="Welche Dämmerungsart möchten Sie berechnen?">
						<option value="A" >Astronomisch</option>
						<option value="N" >Nautisch</option>
						<option value="C" selected>Bürgerlich</option>
					</select>
				</td>
			
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
			<tr>
				<td colspan="8">
					<center><button id="calc" class="calc" ><u>B</u>erechnen</button></center>
				</td>
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>
			
			<tr>
				<td id="label" colspan="8">
					<center>Sonnen Auf- und Untergang nach Peter Duffett-Smith und Jonathan Zwart - Practical Astronomy with your Calculator and Spreadsheet
					und "Physik für Alle" - https://physik.cosmos-indirekt.de/Physik-Schule/Sonnenstand.</center>
				</td>
			</tr>
			
			<tr>
				<td colspan="8">
					 
				</td>
			</tr>

			<!-- ******************** Rise, Set und Status der Sonne *********************** -->
			
			<tr>
			
				<td id="label">
					<label title="Datum und lokale Uhrzeit des Sonnenaufgangs am Längengrad des Standorts">Rise:<sub>[Datum]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Datum und lokale Uhrzeit des Sonnenaufgangs am Längengrad des Standorts" id="timesunrise" type="text" value="dd.mm.yyy - hh:mm:ss" disabled="disabled" ></input>
				</td>
			
				<td id="label">
					<label title="Status des Sonnenaufgangs: OK:OK besagt das Sternzeitkonvertierung und Sonneaufgang OK ist.">Status:</label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Status des Sonnenaufgangs: 'OK:OK' besagt das Greenwich Sternzeitkonvertierung zu UT OK : Sonneaufgang OK ist." id="statesunrise" type="text" value="X : Y" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Datum und lokale Uhrzeit des Sonnenuntergangs am Längengrad des Standorts">Set:<sub>[Datum]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Datum und lokale Uhrzeit des Sonnenuntergangs am Längengrad des Standorts" id="timesunset" type="text" value="dd.mm.yyy - hh:mm:ss" disabled="disabled" ></input>
				</td>
			
				<td id="label">
					<label title="Status des Sonneuntergangs: OK:OK besagt das Sternzeitkonvertierung und Sonneuntergang OK ist.">Status:</label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Status des Sonnenuntergangs: 'OK:OK' besagt das Greenwich Sternzeitkonvertierung zu UT OK : Sonnenuntergang OK ist." id="statesunset" type="text" value="X : Y" disabled="disabled" ></input>
				</td>
				
			</tr>
			
			<!-- ********************* Twilight der Sonne *********************** -->
			
			<tr>
			
				<td id="label">
					<label title="Dämmerungsbeginn vor dem Sonnenaufgang">Twilight:<sub>[Morgen]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Dämmerungsbeginn vor dem Sonnenaufgang" id="twilightrise" type="text" value="hh:mm" disabled="disabled" ></input>
				</td>
			
				<td id="label">
					<label title="Status der Dämmerung: 'OK:OK' - besagt das Greenwich Sternzeitkonvertierung zu UT OK : Dämmerung Morgens OK ist.">Status:</label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Status der Dämmerung: 'OK:OK' - besagt das Greenwich Sternzeitkonvertierung zu UT OK : Dämmerung Morgens OK ist." id="statetwilightrise" type="text" value="X:Y" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Dämmerungsende nach dem Sonnenuntergang">Twilight:<sub>[Abend]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Dämmerungsende nach dem Sonnenuntergang" id="twilightset" type="text" value="hh:mm" disabled="disabled" ></input>
				</td>
			
				<td id="label">
					<label title="Status der Dämmerung: 'OK:OK' - besagt das Greenwich Sternzeitkonvertierung zu UT OK : Dämmerung Abends OK ist.">Status:</label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Status der Dämmerung: 'OK:OK' - besagt das Greenwich Sternzeitkonvertierung zu UT OK : Dämmerung Abends OK ist." id="statetwilightset" type="text" value="X:Y" disabled="disabled" ></input>
				</td>
				
			</tr>
		
			<tr>
			
				<td id="label">
					<label title="Azimuth des Sonnenaufgangs - Negativ = Östlich 0° = Süden">Azimuth:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Azimuth des Sonneaufgangs - Negativ = Östlich 0° = Süden" id="sunriseaz" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Höhe der Sonne über dem Horizont beim Aufgang">Höhe:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Höhe der Sonne über dem Horizont beim Aufgang" id="sunriseh" type="text" value="0° 0' 0''" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Azimuth des Sonnenuntergangs - Positiv = Westlich 0° = Süden">Azimuth:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Azimuth des Sonnenuntergangs - Positiv = Westlich 0° = Süden" id="sunsetaz" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Höhe der Sonne über dem Horizont beim Untergang">Höhe:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Höhe der Sonne über dem Horizont beim Untergang" id="sunseth" type="text" value="0° 0' 0''" disabled="disabled" ></input>
				</td>
				
			</tr>
			
			<tr>
			
				<td id="label">
					<label title="Azimuth des Sonnen Höchststands - Negativ = Östlich - 0° = Süden - Positiv = Westlich">Azimuth:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Azimuth des Sonnen Höchststands- Negativ = Östlich - 0° = Süden - Positiv = Westlich"" id="sunhighaz" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Datum und lokale Uhrzeit des Sonnen Höchstands am Längengrad des Standorts">Höchst:<sub>[Datum]</sub></label>
				</td>
				
				<td  id="value">
					<input  style="color:darkgreen" class="color"  title="Datum und lokale Uhrzeit des Sonnen Höchstands am Längengrad des Standorts" id="sunhighdate" type="text" value="dd.mm.yyyy - hh:mm:ss" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Die Höhe der Sonne bei Höchststand in dez. Grad">Höhe:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Die Höhe der Sonne  bei Höchststand in dez. Grad" id="sunhighdeg" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
			</tr>
			
			<tr>
			
				<td id="label">
					<label title="Abstand der Sonne von der Erde um 00:00:00.000 Uhr des Tages">Abstand:<sub>[Km]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen"  class="color"  title="Abstand der Sonne von der Erde um 00:00:00.000 Uhr des Tages" id="sundistance" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Winkeldurchmesser des Sonne am Himmel in Grad">Durchm.:<sub>[Grad]</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen" class="color"  title="Winkeldurchmesser des Sonne am Himmel in Grad" id="sundiameter" type="text" value="0.0" disabled="disabled" ></input>
				</td>
				
				<td id="label">
					<label title="Winkeldurchmesser des Sonne am Himmel in °, ', ''">Durchm.:<sub>[°, ', '']</sub></label>
				</td>
				
				<td  id="value">
					<input style="color:darkgreen" class="color"  title="Winkeldurchmesser des Sonne am Himmel in °, ', ''" id="sundiameter2" type="text" value="0° 0' 0''" disabled="disabled" ></input>
				</td>
			
			</tr>
		
		</table>

	</body>

</html>