	// cholchis.js fuer colchis.html, jg 20090110
	// Global variables 
    var pi = Math.PI;
	var offset  = 2.0;  // value used in calculation
	var offset_A  = +58.00;  // A offset to centre line (km) 
	var offset_B  = -58.00;  // B offset to centre line (km) 
	var bearing = 90.0; // bearing of coordinates
    var lonrad1 = 36.0; // temporary points (in radians)
	var lonrad2 = 36.0; 
    var latrad1 = 36.0;
	var latrad2 = 36.0;
	var map = ""        // set map variable as global.
	var pathctr = []    // Array to be used to hold center path
	var offpts1 = []    // Array to be used for one the Offset lines
	var offpts2 = []    // Array to be used for other Offset line
	var pathcount;      // Number of points in path
    var msg = null 
      var gmarkers = [];
      var htmls = [];
      var i = 0;
      gicons = [];
      function createMarker(point,name,html,icontype) {
        html = '<div style="white-space:nowrap;">' + html + '<\/div>';
        var marker = new GMarker(point, gicons[icontype]);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        gmarkers[i] = marker;
        htmls[i] = html;
        i++;
        return marker;
      }
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }
	  
	function onLoad() 
	  {
      window.map = new GMap2(document.getElementById("map"));
      // Map Controls
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.addControl(new GScaleControl()) ;
	  map.addMapType(G_PHYSICAL_MAP);
	  map.setCenter(new GLatLng(49.589432, 6.118955), 7, G_PHYSICAL_MAP);
      var point = new GPoint(8.6701387, 50.581966);
						var marker = createMarker(point,"<font face='arial' size=1>Das Elephantenklo",
						'<font face="arial" size=1><b>Das Elephantenklo zu Gie&szlig;en<\/b><br>'
						+'Per Mausklick in dieses Fenster<br>'
						+'k&ouml;nnen Sie Koordinaten bestimmen:<br>'
	  					+'<a href="../../../karten/koordinaten.html" target="_blank">koordinaten.html<\/a><\/FONT>'
						);
       map.addOverlay(marker);

function MyCustomControl()
{
}
MyCustomControl.prototype = new GControl(false,false);
MyCustomControl.prototype.getDefaultPosition = function() {
return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(9,30));
};
MyCustomControl.prototype.initialize = function(gmapref)
{
var container=gmapref.getContainer();
var c = document.createElement("div");
var Neu = "<FORM><INPUT size=5 value=+58.00 name=offset onblur=newoffsetA(this.form)><\/FORM>";
Neu     = Neu + "<FORM><INPUT size=5 value=-58.00 name=offset onblur=newoffsetB(this.form)><\/FORM>";
c.innerHTML = Neu;
container.appendChild(c);
return c;
}
map.addControl(new MyCustomControl());

// Quelle: http://asteroidoccultation.com/2008_12/1229_1135_19730_Summary.txt	
// Zentrallinie malen
var polyline = new GPolyline([
new GPoint( 0.000000, 47.973889),
new GPoint( 1.000000, 48.237500),
new GPoint( 2.000000, 48.494167),
new GPoint( 3.000000, 48.744167),
new GPoint( 4.000000, 48.987222),
new GPoint( 5.000000, 49.223611),
new GPoint( 6.000000, 49.453056),
new GPoint( 7.000000, 49.676111),
new GPoint( 8.000000, 49.892500),
new GPoint( 9.000000, 50.102222),
new GPoint(10.000000, 50.305278),
new GPoint(11.000000, 50.502222),
new GPoint(12.000000, 50.692500),
new GPoint(13.000000, 50.876667),
new GPoint(14.000000, 51.054444),
new GPoint(15.000000, 51.225833),
new GPoint(16.000000, 51.391111),
new GPoint(17.000000, 51.550278),
new GPoint(18.000000, 51.703333),
new GPoint(19.000000, 51.850278),
new GPoint(20.000000, 51.991389)],
"#0000FF", 3, 0.5);
map.addOverlay(polyline);

// Centre path data array, for creating offset line
var polypts = [
new GPoint( 0.000000, 47.973889),
new GPoint( 1.000000, 48.237500),
new GPoint( 2.000000, 48.494167),
new GPoint( 3.000000, 48.744167),
new GPoint( 4.000000, 48.987222),
new GPoint( 5.000000, 49.223611),
new GPoint( 6.000000, 49.453056),
new GPoint( 7.000000, 49.676111),
new GPoint( 8.000000, 49.892500),
new GPoint( 9.000000, 50.102222),
new GPoint(10.000000, 50.305278),
new GPoint(11.000000, 50.502222),
new GPoint(12.000000, 50.692500),
new GPoint(13.000000, 50.876667),
new GPoint(14.000000, 51.054444),
new GPoint(15.000000, 51.225833),
new GPoint(16.000000, 51.391111),
new GPoint(17.000000, 51.550278),
new GPoint(18.000000, 51.703333),
new GPoint(19.000000, 51.850278),
new GPoint(20.000000, 51.991389)];
var polypts_cnt = 21;

// Path Limit1:
var polyline = new GPolyline([
new GPoint( 0.000000, 48.242778),
new GPoint( 1.000000, 48.505833),
new GPoint( 2.000000, 48.761667),
new GPoint( 3.000000, 49.010833),
new GPoint( 4.000000, 49.253333),
new GPoint( 5.000000, 49.488889),
new GPoint( 6.000000, 49.717778),
new GPoint( 7.000000, 49.940000),
new GPoint( 8.000000, 50.155556),
new GPoint( 9.000000, 50.364722),
new GPoint(10.000000, 50.567500),
new GPoint(11.000000, 50.763611),
new GPoint(12.000000, 50.953333),
new GPoint(13.000000, 51.136667),
new GPoint(14.000000, 51.313889),
new GPoint(15.000000, 51.485000),
new GPoint(16.000000, 51.649722),
new GPoint(17.000000, 51.808333),
new GPoint(18.000000, 51.960833),
new GPoint(19.000000, 52.107222),
new GPoint(20.000000, 52.247778)],
"#0000FF", 1, 0.5);
map.addOverlay(polyline);

// Path Limit2:
var polyline = new GPolyline([
new GPoint( 0.000000, 47.705278),
new GPoint( 1.000000, 47.969722),
new GPoint( 2.000000, 48.227222),
new GPoint( 3.000000, 48.477778),
new GPoint( 4.000000, 48.721667),
new GPoint( 5.000000, 48.958611),
new GPoint( 6.000000, 49.188889),
new GPoint( 7.000000, 49.412500),
new GPoint( 8.000000, 49.629722),
new GPoint( 9.000000, 49.840000),
new GPoint(10.000000, 50.043889),
new GPoint(11.000000, 50.241389),
new GPoint(12.000000, 50.432500),
new GPoint(13.000000, 50.616944),
new GPoint(14.000000, 50.795556),
new GPoint(15.000000, 50.967500),
new GPoint(16.000000, 51.133333),
new GPoint(17.000000, 51.293056),
new GPoint(18.000000, 51.446667),
new GPoint(19.000000, 51.594167),
new GPoint(20.000000, 51.735556)],
"#0000FF", 1, 0.5);
map.addOverlay(polyline);

//Error Limit3:
var polyline = new GPolyline([ 
new GPoint( 0.000000, 49.178333),
new GPoint( 1.000000, 49.438611),
new GPoint( 2.000000, 49.692222),
new GPoint( 3.000000, 49.938611),
new GPoint( 4.000000, 50.178611),
new GPoint( 5.000000, 50.411667),
new GPoint( 6.000000, 50.638056),
new GPoint( 7.000000, 50.857778),
new GPoint( 8.000000, 51.071111),
new GPoint( 9.000000, 51.277778),
new GPoint(10.000000, 51.478333),
new GPoint(11.000000, 51.672222),
new GPoint(12.000000, 51.859722),
new GPoint(13.000000, 52.041111),
new GPoint(14.000000, 52.216111),
new GPoint(15.000000, 52.385000),
new GPoint(16.000000, 52.547778),
new GPoint(17.000000, 52.704444),
new GPoint(18.000000, 52.855278),
new GPoint(19.000000, 52.999722),
new GPoint(20.000000, 53.138611)],
"#FF00FF", 1, 0.5);
map.addOverlay(polyline);

//Error Limit4:
var polyline = new GPolyline([  
new GPoint( 0.000000, 46.780833),
new GPoint( 1.000000, 47.047778),
new GPoint( 2.000000, 47.307778),
new GPoint( 3.000000, 47.560833),
new GPoint( 4.000000, 47.807222),
new GPoint( 5.000000, 48.046667),
new GPoint( 6.000000, 48.279167),
new GPoint( 7.000000, 48.505278),
new GPoint( 8.000000, 48.724444),
new GPoint( 9.000000, 48.937222),
new GPoint(10.000000, 49.143333),
new GPoint(11.000000, 49.343056),
new GPoint(12.000000, 49.536111),
new GPoint(13.000000, 49.722778),
new GPoint(14.000000, 49.903056),
new GPoint(15.000000, 50.077222),
new GPoint(16.000000, 50.245000),
new GPoint(17.000000, 50.406389),
new GPoint(18.000000, 50.561944),
new GPoint(19.000000, 50.711111),
new GPoint(20.000000, 50.854167)],
"#FF00FF", 1, 0.5);
map.addOverlay(polyline);



// Insert TRACK.GOO (ex SHADOW.EXE) above here

// Instantiate fixed centre path array
	  for (var i=0; i < polypts_cnt; i++){pathctr.push(new GPoint(polypts[i].x,polypts[i].y));} 

// Number of points in path
	  pathcount = polypts_cnt - 1;  

// Instantiate OFFSET arrays
     init_arrays();  // Instantiate OFFSET arrays
	 		 
	 }


