/* *****************************************************************************************
 *	Das Modul stellt alle Funktionen zur Berechnung der Sonnenparameter zur
 *	Verfügung.
 *
 *	sunParameter()	Berechnet alle Parameter der Sonne
 *	-------------------------------------------------------------------------------------------------------------
 * The module provides all functions for calculating the solar parameters
 * Available.
 *
 * sunParameter ()	Calculate all parameters of the sun
 ***************************************************************************************** */
 
 var LCT = [];									// Lokale Zeit des Sonnenaufgangs und Status
														// Local time of sunrise and status
var sunriseAzH = [];							// Azimuth des Sonnenaufgangs und Status
														// Azimuth of sunrise and status
var sunsetAzH = [];							// Azimuth des Sonnenuntergangs und Status
														// Azimuth of sunset and status
var arrTWLRise = [];						// Dämmerung des Sonnenaufgangs und Status
														// Sunrise twilight and status
var jdSunRise = 0.0;						// Julianisches Datum des Sonnenaufgangs
														// Julian date of sunrise
var jdSunSet = 0.0;							// Julianisches Datum des Sonnenuntergangs
														// Julian date of sunset
var jdSunRiseSetDiff = 0.0;				// Die Differenz zwischen dem JD von Set und Rise
														// The difference between the JD of Set and Rise
var jdSunRiseSetHalf = 0.0 ;			// Die Differnez / 2 ergibt das JD des Sonnenstandes am höchsten Punkt, genau
														// in der Mitte der Sichtbarkeit
														// The difference / 2 gives the JD of the Sun’s position at the highest point, exactly
														// in the middle of visibility
var arrjdSunRiseSetHalfDate = [];	// Aus dem JD des höchsten Punkts am Himmel wieder ein Datum berechnen
														// Calculate a date from the JD of the highest point in the sky
var arrTWLRise = [];						// Array für Datum und Uhrzeit und Status der Dämmerung vor dem Sonnenaufgang
														// Array for date and time and status of dawn before sunrise
var arrTWLSet = [];							// Array für Datum und Uhrzeit und Status der Dämmerung nach dem Sonnenuntergang
														// Array for date and time and status of dawn after sunset
var SunAngularSize = "";					// Winkeldurchmesser der Sonne am Himmel in °, ', ''
														// Angular diameter of the Sun in the sky in °, ', “ 
var arrHorizon = [];							// Array zur Berechnung von AZ und Höhe im Horizontalsystem
														// Array for calculating AZ and height in the horizontal system
var savedDay = 99;							// Sichert den Tag, da nur 1 x berechnet werden muss
														// Save the day, because only 1 x has to be calculated		
var loopCount = 0;							// Schleifenzähler für die Berechnung der Auf/Untergänge, da nur einmal am Tag
														// Loop counter for the calculation of ups/downs, since only once a day
var ONLYTZ = 0;								// Die Zeitzonen Variable
														// The time zones variable
var ONLYDS = 0;							// Die Sommer/Winterzeit
														// Summer/winter time variable


/* ******************************************************
	Die Funktion berechnet die Sonnenparameter
	des zu übergebenden Datums und Uhrzeit. Die
	Ergebnisse werden im "sendString" angehängt.
	Dieser muss dem Aufrufer zurückgegeben werden.
	Danach wird er von dort in einem Bradcast Channel
	versendet. Hier an das Textausgabefenster.
	
	Übergabewerte:
	--------------------
		DAY						=	Tag der virtuellen Berechnung
		MONTH				=	Monat der virtuellen Berechnung
		YEAR					=	Jahr der virtuellen Berechnung
		hour						=	Stunde der virtuellen Berechnung
		minute					=	Minute der virtuellen Berechnung
		second					=	Sekunde der virtuellen Berechnung
		millisecond			=	Millisekunde der virtuellen Berechnung
		TWILIGHTKIND	=	Dämmerungsart, C, N, A
		sendString			=	ZU sendender String zur Textausgabe
		what						=	Welche Berechnungsart (Mit/Ohne Ende)
		
	Rückgabewert:
	---------------------
		sendstring	=	Der zu sendende String, der in der Funktion 
								vervollständigt wird.
	----------------------------------------------------------------
	The function calculates the solar parameters
	the date and time to be transferred. The
	Results are appended in the “sendString.”
	This must be returned to the caller.
	From there, he will be on a Bradcast Channel.
	dispatched. Here to the text output window.
	
	Transfer values:
	--------------------
		DAY     				= Day of virtual calculation
		MONTH    			= Month of virtual calculation
		YEAR     				= Year of virtual calculation
		hour     				= hour of virtual calculation
		minute     				= minute of virtual calculation
		second    				= Second of virtual calculation
		millisecond   		= millisecond of virtual calculation
		TWILIGHTKIND 	= twilight type, C, N, A
		sendString   		= string to send for text output
		what      				= Which calculation method (with/without end) 
		
	Return value:
	---------------------
		sendstring = The string to send, which is in the function 
							It will be completed.
   *************************************************** */														
function sunParameter(DAY, MONTH, YEAR, hour, minute, second, millisecond, TWILIGHTKIND, sendString, /*moonArray,*/ what){
		// Da die Variablen ONLYTIMEZONE und ONLYDST im Webworker für die viutuelle Zeit global verwendet werden muss ich sie hier 
		// umsetzen, da in diesem Modul ohne negative Werte für die Zeitzonen gerechnet wird. Sie müssen alle Positiv sein ...
		//
		// Since the variables ONLYTIMEZONE and ONLYDST are used globally in the webworker for the future time I have to use them here 
		// because this module calculates without negative values for the time zones. You must all be positive...
		ONLYTZ = Math.abs(ONLYTIMEZONE);
		ONLYDS = Math.abs(ONLYDST);
		// Den Schleifenzähler + 1, da erst ab dem 2-ten Durchlauf berechnet werden soll ... Grund siehe unten ...
		// The loop counter + 1, because only from the 2nd cycle should be calculated ... Reason see below ...
		loopCount++;
		// ... lediglich, wenn der Tag sich ändert und der Schleifenzähler höher ist, muss neu berechnet werden ...
		// dies ist notwendig, da beim ersten Aufruf durch den Worker der Wert von TWILIGHTKIND noch nicht
		// zur Verfügung steht ...
		//
		// ... only if the tag changes and the loop count is higher, must be recalculated ...
		// this is necessary because at the first call by the worker the value of TWILIGHTKIND does not yet show the value of TWILIGHTKIND
		// is available ...
		if ( (DAY != savedDay) && (loopCount >= 1) ){
			// ... und dann sichere zuerst wieder den neuen Tageswert ...
			// ... and then first save the new daily value again ...
			savedDay = DAY;
			// ******************************** Sonnenaufgang - Sunrise *****************************				
			// ... und berechne aus SunRiseSet.js den Sonnenaufgang am lokalen Ort...
			// [0] = Die dezimale Aufgangszeit  als hh:mm:ss.ms
			// [1] = Konvertierung von GST nach UT OK oder nicht
			// [2] = Immer sichtbar oder Nie sichtbar ...
			// [3] = Das Datum des Sonnenaufgangs im Format dd.mm.yyyy
			//
			// ... and then calculate the sunrise at the local location...
			// [0] = The decimal rise time as hh:mm:ss.ms
			// [1] = Conversion from GST to UT OK or not
			// [2] = Always visible or never visible ...	
			// [3] = The date of the sunrise in the format dd.mm.yyyy			
			LCT = sunriseLocalTime(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE);
			LCT[0]  = LCT[0] + 0.0083333	;
			// ... nun das Julianisches Datum des Sonnenaufgangs ermitteln ...
			// . . . now determine the Julian date of sunrise . . .
			jdSunRise = calcJD(DAY, MONTH, YEAR, LCT[0] , 0, 0, 0,  0, 0);
			// Sende den lokalen Sonnenaufgang/Status an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the local sunrise/status to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticSunrise=" +  LCT[3] + "-" + dectime2Time(Number(LCT[0]), "string")   + "~" + jdSunRise);
			sendString += "Sonnenaufgang Datum\t\t: " + LCT[3] + " - " + dectime2Time(Number(LCT[0]), "string") + "\n";
			postMessage("automaticStatSunrise=" + LCT[2]);
			sendString += "Status Sunrise\t\t\t\t: " + LCT[2] + "\n";
			// ********************************* Sonnenuntergang - Sun set ****************************
			// ... und berechne dann aus SunRiseSet.js  den Sonnenuntergang am lokalen Ort ...
			// [0]	=	Lokale Zeit des Sonnenaufgangs als hh:mm:ss.ms
			// [1] = Konvertierung von GST nach UT OK oder nicht
			// [2] = Immer sichtbar oder Nie sichtbar ...
			//
			// ... and then calculate the sunset at the local location ...
			// [0] = Local time of sunset as hh:mm:ss.ms
			// [1] = Conversion from GST to UT OK or not
			// [2] = Always visible or never visible ...
			LCTS = sunsetLocalTime(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE);	
			LCTS[0]  = LCTS[0] + 0.0083333;
			// ... nun das Julianisches Datum des Sonnenuntergangs in Greenwich ermitteln ...
			// . . . now determine the Julian date of the sunset in Greenwich . . .
			jdSunSet = calcJD(DAY, MONTH, YEAR, LCTS[0] , 0, 0, 0,  0, 0);
			// Sende den lokalen Sonnenuntergang/Status an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the local sunset/status to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticSunset=" + LCTS[3] + "-" + dectime2Time(Number(LCTS[0]), "string")  + "~" + jdSunSet);
			sendString += "Sonnenuntergang Datum\t\t: " + LCTS[3] + " - " + dectime2Time(Number(LCTS[0]), "string") + "\n";
			postMessage("automaticStatSunset=" + LCTS[2]);
			sendString += "Status Sunset\t\t\t\t: " + LCT[2] + "\n";
			// *********************** Berechne die Dämmerungsdaten aus SunRiseSet.js *************************
			// ************************** Calculate data of twilight in SunRiseSet.js *********************************	
			// Dämmerung Morgens bis zum Sonnenaufgang in einem Array mit Index 0 - 3 ...
			//	0	=	Die Zeit der Dämmerung beim Sonnenaufgang dezimal
			//	1	=	Die Konvertierung von Greenwich Sternzeit zu UT bei der Morgendämmerung
			//	2	=	Die Sichtbarkeit der Dämmerung - Immer sichtbar - nie sichtbar
			//	3	=	Status der Dämmerung OK, Sonne immer sichtbar, Sonne nie sichtbar
			//	4	=	Das Datum der Dämmerung im Format dd.mm.yyyy
			//
			// Twilight  Morning until sunrise in an array with index 0 – 3 ...
			// 0 = Time of twilight at sunrise decimal
			// 1 = The conversion of Greenwich stardate to UT at dawn
			// 2 = The visibility of the twilight - Always visible – never visible
			// 3 = State of twilight OK, Sun alwaThe date of the dawn
			// 4 = The date of the dawn in format dd.mm.yyyy
			arrTWLRise = twilightLCT(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE, TWILIGHTKIND, "am");
			// Das Datum in arrTWLRise[4] im Format dd.mm.yyyy an den "."-ten aufsplitten ...
			// dateArr[0] = Tag
			// dateArr[1] = Monat
			// dateArr[2] = Jahr
			// The date in arrTWLRise[4] in the format dd.mm.yyyy to the "."-ten split ...
			// dateArr[0] = day
			// dateArr[1] = month
			// dateArr[2] = year
			var dateArr = arrTWLRise[4].split(".");
			// ... und dann die dezimale Zeit, z.B. 12.4567890 in arrTWLRise[0], in ein Array hh mm ss ms konvertieren ...
			// timeArr[0] = Stunde
			// timeArr[1] = Minute
			// timeArr[2] = Sekunde
			// timeArr[3] = Millisekunde
			// ... and then convert the decimal time, e.g. 12.4567890 in arrTWLRise[0], into an array hh mm ss ms ...
			// timeArr[0] = hour
			// timeArr[1] = minute
			// timeArr[2] = second
			// timeArr[3] = millisecond
			var timeArr = dectime2Time(arrTWLRise[0], "array") ;
			// ... und die einzelnen Werte in das Julianische Datum des beginns der Dämmerung bei Sonnenaufgang zu berechnen ...
			// ... and calculate the individual values into the Julian date of the beginning of dawn at sunrise ...
			var jdTWLRise = calcJD(dateArr[0], dateArr[1], dateArr[2], timeArr[0], timeArr[1], timeArr[2], timeArr[3], 0, 0);
			// Sende die lokale  Dämmerung Sonnenaufgang/Status/JD Dämmerung an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the local twilight sunrise/status/jd dawn to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticTwilightSunrise=" + arrTWLRise[4] + "-" + dectime2Time(arrTWLRise[0], "string") + "~" + jdTWLRise );
			sendString += "Twilight Sunrise\t\t\t\t: " + arrTWLRise[4] + "-" + dectime2Time(arrTWLRise[0], "string") + "\n";
			postMessage("automaticTwilightStatSunrise=" + arrTWLRise[2]);
			sendString += "Status Twilight Sunrise\t\t: " + arrTWLRise[2] + "\n";
			// Dämmerung Abends nach dem Sonnenuntergang in einem Array mit Index 0 - 3 ...
			//	0	=	Die Zeit der Dämmerung beim Sonnenaufgang dezimal
			//	1	=	Die Konvertierung von Greenwich Sternzeit zu UT bei der Morgendämmerung
			//	2	=	Die Sichtbarkeit der Dämmerung - Immer sichtbar - nie sichtbar
			//	3	=	Status der Dämmerung OK, Sonne immer sichtbar, Sonne nie sichtbar
			//	4	=	Das Datum der Dämmerung im Format dd.mm.yyyy
			//
			// Twilight  Morning until sunset in an array with index 0 – 3 ...
			// 0 = Time of twilight at sunrise decimal
			// 1 = The conversion of Greenwich stardate to UT at dawn
			// 2 = The visibility of the twilight - Always visible – never visible
			// 3 = State of twilight OK, Sun always visible, Sun never visible
			// 4 = The date of the dawn in format dd.mm.yyyy
			arrTWLSet = twilightLCT(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE, TWILIGHTKIND,"pm");
			var dateArr2 = arrTWLSet[4].split(".");
			// ... und dann die dezimale Zeit, z.B. 12.4567890 in arrTWLSet[0], in ein Array hh mm ss ms konvertieren ...
			// timeArr2[0] = Stunde
			// timeArr2[1] = Minute
			// timeArr2[2] = Sekunde
			// timeArr2[3] = Millisekunde
			// ... and then convert the decimal time, e.g. 12.4567890 in arrTWLSet[0], into an array hh mm ss ms ...
			// timeArr2[0] = hour
			// timeArr2[1] = minute
			// timeArr2[2] = second
			// timeArr2[3] = millisecond
			var timeArr2 = dectime2Time(arrTWLSet[0], "array") ;
			// ... und die einzelnen Werte in das Julianische Datum des endes der Dämmerung bei Sonnenaufgang zu berechnen ...
			// ... and calculate the individual values into the Julian date of the end of dawn at sunset ...
			var jdTWLSet = calcJD(dateArr2[0], dateArr2[1], dateArr2[2], timeArr2[0], timeArr2[1], timeArr2[2], timeArr2[3], 0, 0);
			// Sende die lokale  Dämmerung Sonnenunterfgang/Status an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the local twilight sunset/status to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticTwilightSunset=" + arrTWLSet[4] + "-" + dectime2Time(arrTWLSet[0], "string") + "~" + jdTWLSet);
			sendString += "Twilight Sunset\t\t\t\t: "  + arrTWLSet[4] + "-" + dectime2Time(arrTWLSet[0], "string") + "\n";
			postMessage("automaticTwilightStatSunset=" + arrTWLSet[2]);
			sendString += "Status Twilight Sunset\t\t\t: " + arrTWLSet[2] + "\n";
			// ************ Aufgang und Untergang Azimut und Höhe und Status **************	
			// ******************** Rise and fall Azimuth and Height and Status *****************				
			// ... hier berechne Azimuth (negative = East, positive = west) und Höhe der Sonne über dem Horizont Sonnenaufgang...
			// [0]	=	Der Azimuth in dezimalen Grad
			// [1]	=	Die Höhe der Sonne über dem Horizont in °, ', '' als Horizontal Koordinate
			// [2]	=	die Höhe der Sonne über dem Horizont in dez. Grad als Horizontal Koordinate 
			// [3]	=	Ist die Zeitkonvertierung von GST zu UT OK oder Warnung
			// [4]	=	Status des Sonnenaufgangs, ob OK, Immer sichtbar oder Nie sichtbar
			//
			// ... here calculate azimuth (negative = East, positive = west) and altitude of the Sun above the horizon sunrise ...
			// [0] = Azimuth in decimal degrees
			// [1] = The height of the Sun above the horizon in °, ', “ as a horizontal coordinate
			// [2] = the height of the Sun above the horizon in dec. Degree as Horizontal Coordinate 
			// [3] = Is the time conversion from GST to UT OK or warning
			// [4] = Sunrise status, whether OK, Always Visible or Never Visible
			sunriseAzH = sunriseAZ(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE);
			// Sende den Azimuth des Sonnenaufgangs/Status an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the azimuth sunrise/status to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticAZSunrise=" + (sunriseAzH[0] - 180.0));
			sendString += "AZ Sunrise\t\t\t\t\t: " + (sunriseAzH[0] - 180.0).toFixed(2) + " ° [Negativ  Östlich - Positiv  Westlich]\n";
			postMessage("automaticAZStatSunrise=" + sunriseAzH[4]);
			sendString += "Status AZ Sunrise\t\t\t: " + sunriseAzH[4] + "\n";
			// Dasselbe mit dem AZ des Sonnenuntergangs
			// Same with the AZ of sunset
			sunsetAzH  = sunsetAZ(DAY, MONTH, YEAR, ONLYDS , ONLYTZ , LONGITUDE, LATITUDE);
			// Sende den Azimuth Sonnenuntergang/Status an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the azimuth sunset/status to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("automaticAZSunset=" + (sunsetAzH[0] - 180.0));
			sendString += "AZ Sunset\t\t\t\t\t: " + (sunsetAzH[0] - 180.0).toFixed(2) + " ° [Negativ  Östlich - Positiv  Westlich]\n";
			postMessage("automaticAZStatSunset=" + sunsetAzH[4]);
			sendString += "Status AZ Sunse\t\t\t\t: " + sunsetAzH[4] + "\n";
			// *********************** Berechnung des Sonnenhöchststands *************************	
			//  ************************* Calculate the sun’s maximum  ****************************
			// Sende das julianische Datum des Sonnenaufgangs an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the Julian date of sunrise to the creator Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("jdSunrise=" + jdSunRise);
			sendString += "JD Sunrise\t\t\t\t\t: " + jdSunRise.toFixed(3) + "\n";
			// Sende das julianische Datum des Sonnenuntergangs an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the Julian date of sunset to the creator Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("jdSunset=" + jdSunSet);
			sendString += "JD Sunset\t\t\t\t\t: " + jdSunSet.toFixed(3) + "\n";
			// ... 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 ...
			// arrjdSunRiseSetHalfDate[0]	= Datum + Uhrzeit als Gleitkommazahl = 17.3456789
			// arrjdSunRiseSetHalfDate[1]	= Monat
			// arrjdSunRiseSetHalfDate[2]	= Jahr
			// . . . then calculate a date again from the JD of the highest point in the sky . . .
			// arrjdSunRiseSetHalfDate[0] = date + time as floating point number = 17.3 456 789
			// arrjdSunRiseSetHalfDate[1] = month
			// arrjdSunRiseSetHalfDate[2] = year
			arrjdSunRiseSetHalfDate = julianDate2Date(jdSunRiseSetHalfDate);
			// Sende die Uhrzeit  des Sonnenhöchststandes an die Ersteller Message Queue zur Datenausgabe ...
			// und fülle ebenfalls den Sendestring für das Daten Ausgabefenster ...
			// Send the time of the sun’s maximum to the creators Message queue for data output ...
			// and also fill the transmit string for the data output window ...
			postMessage("highNoonDate=" + LPAD(Math.floor(arrjdSunRiseSetHalfDate[0]), 2, "0") + "." + LPAD(arrjdSunRiseSetHalfDate[1], 2, "0") + "." + LPAD(arrjdSunRiseSetHalfDate[2], 4, "0") +
								"  -  " +  percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "string") );
			sendString += "Zeit Sonnenhöchststand\t\t: " + LPAD(Math.floor(arrjdSunRiseSetHalfDate[0]), 2, "0") + "." + LPAD(arrjdSunRiseSetHalfDate[1], 2, "0") + "." + LPAD(arrjdSunRiseSetHalfDate[2], 4, "0") +
								"  -  " +  percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "string") + "\n";
			// Berechnung der Entfernung der Sonne und Winkelgröße als dezimale Grad am Himmel aus "Sunpositions.js".
			// Calculation of the distance of the Sun and angular magnitude in decimal degrees in the sky from "Sunpositions.js". 
			sunDiameter = calcSunDistanceAndDiameter(DAY, MONTH, YEAR, arrjdSunRiseSetHalfDate[0], arrjdSunRiseSetHalfDate[1], arrjdSunRiseSetHalfDate[2],
																					ONLYDS , ONLYTZ);
			// Abstand Erde - Sonne in Km
			// Distance Earth – Sun in Km
			postMessage("sunDiameter=" + sunDiameter[0]);
			sendString += "Entfernung Erde-Sonne\t\t: " + sunDiameter[0] + " Km\n";
			// Durchmesser der Sonne am Himmel Dezimal
			// Diameter of the Sun in the Sky Decimal
			postMessage("sunDiameterSkyDec=" + sunDiameter[1]);
			sendString += "Größe der Sonne\t\t\t: " + sunDiameter[1] + " °\n";
			// Winkeldurchmesser der Sonne in Grad, Minute, aber senden als dezimalen Wert
			// Angular diameter of the Sun in degrees, minute, but send as decimal value
			postMessage("sunDiameterSkyDeg=" + sunDiameter[1]);
			// Ersatzzeichen für nicht erkannte Zeichen "�"
			// HTML Entity (decimal)	�
			// HTML Entity (hex)	�
			sendString += "Größe der Sonne\t\t\t: " + decDegrees2AngleOfHours(sunDiameter[1]).replace("�", "°") + "\n";
			// ... Azimut des höchsten Sonnenstandes am Himmel ...
			//  ... Azimuth of the highest sun position in the sky ...
			azSunHigh = ((sunriseAzH[0] - 180.0) + (((sunsetAzH[0] - 180.0) -  (sunriseAzH[0] - 180.0)) / 2 ));
			// Dezimale Zeit des Sonnenhöchststandes in Array konvertieren
			// Convert decimal time of solar peak to array
			// Index [0]	=	Stunde - Hour
			// Index [1]	=	Minute - Minute
			// Index [2]	=	Sekunde - Second
			// Index [3]	=	Millisekunde - Millisecond
			var zh = percentageOfDecimal2Time((arrjdSunRiseSetHalfDate[0] - Math.floor(arrjdSunRiseSetHalfDate[0])), "array");
			// ... Azimut und Höhe der Sonne berechnen aus SunRiseSet.js...
			// ...  Calculate the azimuth and altitude of the sun from SunRiseSet.js ...
			// [0]	=	Azimuth in dezimalen Grad
			// [1]	=	Höchststand in dezimalen Grad
			// [2]	=	Rektaszension in dezimalen Grad
			// [3]	=	Deklination in dezimalen Grad
			highSunPos = precSunHorAZHeight(zh[0], zh[1], zh[2],
																	ONLYDS , ONLYTZ, DAY, MONTH, YEAR,  LONGITUDE, LATITUDE);
			// Der Azimuth des Sonnenhöchststand genau in dez. Grad
			// The azimuth of the sun’s elevation exactly in dec. Degree
			postMessage("sunAZHigh=" + highSunPos[0]);
			sendString += "AZ Sonnenhöchststand\t\t: " +highSunPos[0] + " °\n";
			// Sonnenhöchstand im Azimuth in Grad
			// Sun’s elevation in azimuth in degrees
			postMessage("sunHighHigh=" + highSunPos[1]);
			sendString += "Sonnenhöchststand im AZ\t\t: " + highSunPos[1].toFixed(2) + " °\n";
		// Berechnungen innerhalb des Tages, die sich laufend ändern
		// Calculations within the day that change continuously
		} else {
			// ... Azimut und Höhe der Sonne im Horizontal/Äquatorialsystem berechnen aus SunRiseSet.js...
			// [0]	=	Azimuth in dezimalen Grad
			// [1]	=	Höchststand in dezimalen Grad
			// [2]	=	Rektaszension in dezimalen Grad
			// [3]	=	Deklination in dezimalen Grad
			//
			// ...  Calculate the azimuth and altitude of the sun from SunRiseSet.js ...
			// [0] = Azimuth in decimal degrees
			// [1] = Maximum level in decimal degrees
			// [2] = rectascension in decimal degrees
			// [3] = Declination in decimal degrees
			arrHorizon = precSunHorAZHeight(hour, minute, second,ONLYDS, ONLYTZ, DAY, MONTH, YEAR, LONGITUDE, LATITUDE);
			// Der Azimuth des aktuellen Sonnenstandes im Horizontalsystem
			// The azimuth of the current position of the sun in the horizontal system
			postMessage("automaticAZ=" + Number(arrHorizon[0]));
			sendString += "AZ Sonnenstand\t\t\t\t: " + Number(arrHorizon[0]).toFixed(2) + " °\n";
			// Die Höhe des aktuellen Sonnenstandes im Horizontalsystem
			// The level of the current position of the sun in the horizontal system
			postMessage("automaticHigh=" + Number(arrHorizon[1]));
			sendString += "Höhe Sonnenstand im AZ\t\t: " + Number(arrHorizon[1]).toFixed(2) + " °\n";
			// Die Rektaszension des aktuellen Sonnenstandes im Äquatorialsystem
			// The recaszension of the current position of the sun in the equatorial system
			postMessage("automaticRA=" + Number(arrHorizon[2]));
			sendString += "RA Sonnenstand\t\t\t\t: " + Number(arrHorizon[2]).toFixed(2) + " °\n";
			// Die Deklination des aktuellen Sonnenstandes im Äquatorialsystem
			// The declination of the current position of the sun in the equatorial system
			postMessage("automaticDEC=" + Number(arrHorizon[3]));
			sendString += "DEC Sonnenstand\t\t\t: " + Number(arrHorizon[3]).toFixed(2) + " °\n";
		}
		// Hier der Aufruf zur Berechnung der Mondpositionen ...
		// Here is the call to calculate the moon positions ...
		// moonParameters(jdlt, ra, dec, dst, tz, longitude, latitude, sendString)
		var moonArray = moonParameters(calcJD(DAY, MONTH, YEAR, hour, minute, second, millisecond, 0, 0), Number(arrHorizon[2]), Number(arrHorizon[3]) ,
														ONLYDS, ONLYTZ, LONGITUDE, LATITUDE, /*moonArray,*/ what);
		// Das Rückgabe Array den Webworker worker-automatic-actualdate-endless.js,
		// um den Sendestring mit den Mond Parametern zu vervollständigen und die
		// Mond Parameter in den Textfeldern auszugeben ...
		// Index 0 = Sendstring mit den Sonnen Parametern
		// Index 1 = Werte der Mondparameter
		//
		// The return array to the webworker worker-automatic-actualdate-endless.js,
		// to complete the transmitter string with the moon parameters and
		// Moon parameters to be displayed in the text fields ...
		// Index 0 = send string with sun parameters
		// Index 1 = values of the lunar parameters
		var multiArray =[];
		multiArray.push(sendString);
		multiArray.push(moonArray);
		// ... zurück zum Aufrufer 
		// ... back to the caller.
		return(multiArray);

} // End of sumParameter()