/*
Parameters for javascript selectable RASP maps.

Copyright (C) 2010 Thomas Pantzer

This program is free software; you can redistribute it and/or modify it under 
the terms of the GNU General Public License as published by the Free Software 
Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with 
this program; if not, see http://www.gnu.org/licenses/.
*/

// debug = 1;
// maintaining = 1;
// recalc = 1;

var upShift = 170;
var leftShift = 65;
var imageWidth = 1185;

var sLn = 6;
var eLn = 22;
var sLt = 47;
var eLt = 55;

var m1x = 126;	// 6°,47°  
var m1y = 951;		

var m2x = 198;	// 6°,55°  
var m2y = 289;		

var m3x = 962;	// 22°,55°  
var m3y = 290;		

var m4x = 1033;	// 22°,47°  
var m4y = 951;

var mapServerURL = "http://rasp.linta.de/GERMANY";		
var sourceDocument = "/index.html";
var mapImagePostfix = "lst.d2.png";
var concatOpChar = ".";

fLat = 83.23798712126573;
fLon = 0.7711233052494313;
rStart = 3554.224124229896;
Pr[0] = 582.2958993165842;
Pr[1] = -3244.3872964941493;
normA[0] = -0.10812371023446661;
normA[1] = 0.9941374468780125;

function mapDayTime(map, day, time)
{
	return ""+map+concatOpChar+day+concatOpChar+time;
}

function soundingPrefix(num)
{
	return "sounding"+num;
}	 

function soundingUri(idx, myDay, myTime, dayPrefix)
{
	return  mapServerURL + "" + dayPrefix + mapDayTime(soundingPrefix(idx+1), myDay, myTime);
}

var timeOptionsLength = new Array(4);
timeOptionsLength[0] = 13;	// yesterday
timeOptionsLength[1] = 13;
timeOptionsLength[2] = 13;
timeOptionsLength[3] = 13;	// day after tomorrow

var timeOptionValue = new Array(timeOptionsLength);
var timeOptionText  = new Array(timeOptionsLength);
var timeOptionYesterday  = new Array(timeOptionsLength);
var timeOptionAfterTomorrow  = new Array(timeOptionsLength);

timeOptionValue[0] = "0700"; 	 timeOptionText[0] = "07:00"; 	timeOptionYesterday[0]  = 1;  timeOptionAfterTomorrow[0]  = 1; 
timeOptionValue[1] = "0800"; 	 timeOptionText[1] = "08:00"; 	timeOptionYesterday[1]  = 1;  timeOptionAfterTomorrow[1]  = 1; 
timeOptionValue[2] = "0900"; 	 timeOptionText[2] = "09:00"; 	timeOptionYesterday[2]  = 1;  timeOptionAfterTomorrow[2]  = 1; 
timeOptionValue[3] = "1000"; 	 timeOptionText[3] = "10:00"; 	timeOptionYesterday[3]  = 1;  timeOptionAfterTomorrow[3]  = 1; 
timeOptionValue[4] = "1100"; 	 timeOptionText[4] = "11:00"; 	timeOptionYesterday[4]  = 1;  timeOptionAfterTomorrow[4]  = 1; 
timeOptionValue[5] = "1200"; 	 timeOptionText[5] = "12:00"; 	timeOptionYesterday[5]  = 1;  timeOptionAfterTomorrow[5]  = 1; 
timeOptionValue[6] = "1300"; 	 timeOptionText[6] = "13:00"; 	timeOptionYesterday[6]  = 1;  timeOptionAfterTomorrow[6]  = 1; 
timeOptionValue[7] = "1400"; 	 timeOptionText[7] = "14:00"; 	timeOptionYesterday[7]  = 1;  timeOptionAfterTomorrow[7]  = 1; 
timeOptionValue[8] = "1500"; 	 timeOptionText[8] = "15:00"; 	timeOptionYesterday[8]  = 1;  timeOptionAfterTomorrow[8]  = 1; 
timeOptionValue[9] = "1600"; 	 timeOptionText[9] = "16:00"; 	timeOptionYesterday[9]  = 1;  timeOptionAfterTomorrow[9]  = 1; 
timeOptionValue[10] = "1700";	 timeOptionText[10] = "17:00";  timeOptionYesterday[10] = 1;  timeOptionAfterTomorrow[10] = 1;
timeOptionValue[11] = "1800";	 timeOptionText[11] = "18:00";  timeOptionYesterday[11] = 1;  timeOptionAfterTomorrow[11] = 1;
timeOptionValue[12] = "1900";	 timeOptionText[12] = "19:00";  timeOptionYesterday[12] = 1;  timeOptionAfterTomorrow[12] = 1;
var timePreselection = 6;



var mapOptionsLength = 10;
var mapOptionValue = new Array(mapOptionsLength);
var mapOptionText  = new Array(mapOptionsLength);
mapOptionValue[0] = "hwcrit"; 		mapOptionText[0] = "Nutzbare Thermikhöhe";
mapOptionValue[1] = "blcloudpct"; 	mapOptionText[1] = "Wolkenbedeckung";
mapOptionValue[2] = "wstar_bsratio"; mapOptionText[2] = "Thermikstärke u. A/S";
mapOptionValue[3] = "sfcwind"; 		mapOptionText[3] = "Bodenwind";
mapOptionValue[4] = "bltopwind"; 	mapOptionText[4] = "Grenzschichtwind";
mapOptionValue[5] = "rain1"; 		mapOptionText[5] = "1h Regen";
mapOptionValue[6] = "zsfclclmask";	mapOptionText[6] = "Cumulus Wolkenbasis";
mapOptionValue[7] = "hbl";			mapOptionText[7] = "Grenzschichthöhe";
mapOptionValue[8] = "zblclmask"; 	mapOptionText[8] = "Basis Überentwicklung";
mapOptionValue[9] = "sfctemp";		mapOptionText[9] = "Bodentemperatur";
var mapPreselection = 0;


var dayOptionsLength = 6;
var dayOptionValue = new Array(dayOptionsLength);
var dayOptionText  = new Array(dayOptionsLength);
var dayOptionPrefix  = new Array(dayOptionsLength);
dayOptionPrefix[0] = "/previous.";	dayOptionValue[0] = "curr"; 	dayOptionText[0] = "gestern";	
dayOptionPrefix[1] = "/";			dayOptionValue[1] = "curr"; 	dayOptionText[1] = "heute"; 	
dayOptionPrefix[2] = "/";			dayOptionValue[2] = "curr+1"; 	dayOptionText[2] = "morgen";	
dayOptionPrefix[3] = "/";			dayOptionValue[3] = "curr+2"; 	dayOptionText[3] = "übermorgen";
dayOptionPrefix[4] = "/previous.";	dayOptionValue[4] = "curr+1"; 	dayOptionText[4] = "heute (alt)"; 	
dayOptionPrefix[5] = "/previous.";	dayOptionValue[5] = "curr+2"; 	dayOptionText[5] = "morgen (alt)"; 	
var dayPreselection = 1;


siteOptionsLength = 37;
var siteOptionValue = new Array(siteOptionsLength);
var siteOptionText  = new Array(siteOptionsLength);
siteWinchOptionsLength = 13;
var siteWinchOption = new Array(siteWinchOptionsLength);
var sitePreselection = 1;

// Winde
addTakeoff("Böhlen"		   		,"51.2131,12.3663"	,1);
addTakeoff("Beilrode"  	   		,"51.5720,13.0558"	,1);
addTakeoff("Leiha" 		   		,"51.2603,11.8800"	,1);
addTakeoff("Cottbus"	   		,"51.7666,14.3028"	,1);
addTakeoff("Altes Lager"   		,"51.9961,12.9838"	,1);
addTakeoff("Hainer See"	   		,"51.1615,12.4601"	,1);
addTakeoff("Spitzer Kalkofen" 	,"51.2021,13.1906"	,1);
addTakeoff("Taucha"		   		,"51.3945,12.5320"	,1);
addTakeoff("Riesa/Canitz"  		,"51.3041,13.2291"	,1);
addTakeoff("Lychen"		   		,"53.2469,13.3631"	,1);
addTakeoff("Liebenau"  	   		,"50.7876,13.8450"	,1);
addTakeoff("Köthen"		   		,"51.7266,11.9529"	,1);
addTakeoff("Drosa"  	   		,"51.8254,11.8945"	,1);


// CZ
addTakeoff("Rana"	,"50.4052,13.7685"	,0);
addTakeoff("Krupka"	,"50.6833,13.8667"	,0);

// Soaring
addTakeoff("Laucha"	   	   ,"51.2467,11.6866"	,0);
addTakeoff("Jenzig"	   	   ,"50.9385,11.6329"	,0);
addTakeoff("Altenbeuthen"  ,"50.5972,11.5977"	,0);
addTakeoff("Kirschberg"    ,"51.1361,13.0795"	,0);
addTakeoff("Knobelsdorf"   ,"50.6068,11.3726"	,0);
addTakeoff("Blankenhain"   ,"50.8466,11.3791"	,0);
addTakeoff("Schwartenberg" ,"50.6596,13.4656"	,0);
addTakeoff("Wichmar"	   ,"51.0418,11.6979"	,0);
addTakeoff("Kipse" 	   	   ,"50.9356,13.7215"	,0);
addTakeoff("Fichtelberg"   ,"50.4224,12.9559"	,0);
addTakeoff("Luftschiff"    ,"51.2527,11.8825"	,0);
addTakeoff("Frauenberg"    ,"51.3755,10.8372"	,0);
addTakeoff("Hartenstein"   ,"50.6723,12.6728"	,0);
addTakeoff("Löhma"	 	   ,"50.5985,11.4433"	,0);
addTakeoff("Boltenhagen"   ,"54.0140, 11.1809"	,0);

// Bayern
addTakeoff("Hochries","47.7460,12.2410"	,0);
addTakeoff("Brauneck","47.6658,11.5175"	,0);

// AT
addTakeoff("Kössen" 		,"47.6319,12.4317"	,0);
addTakeoff("Elfer"  		,"47.1021,11.3262"	,0);
addTakeoff("Hohe Salve"		,"47.4631,12.2003"	,0);
addTakeoff("Rofan"  		,"47.4412,11.7583"	,0);

// SK
addTakeoff("Donovaly"  		,"48.950,19.480"	,0);


soundMapLength = 7;
var soundMapCoords = new Array(soundMapLength);
soundMapCoords[soundMapIdx++]="207,610,10";	// Düsseldorf
soundMapCoords[soundMapIdx++]="228,681,10";	// Mendig
soundMapCoords[soundMapIdx++]="284,447,10";	// Oldenburg
soundMapCoords[soundMapIdx++]="276,765,10";	// Ludwigshafen
soundMapCoords[soundMapIdx++]="578,646,10"; // Pirna
soundMapCoords[soundMapIdx++]="514,549,10";	// Lüsse
soundMapCoords[soundMapIdx++]="248,842,10";	// Offenburg							

