
// Insert TRACK.GOO (ex SHADOW.EXE) above here, OR WinOccult data.

    if(polypts_cnt > 2)  // Is there a centre path declared ?
      { 
      for (var i=0; i < polypts_cnt; i++){pathctr.push(new GPoint(polypts[i].x,polypts[i].y));} // Instantiate fixed centre path array
      pathcount = polypts_cnt - 1;  // Number of points in path
      init_arrays();                // Instantiate OFFSET arrays
      map.centerAndZoom(new GPoint(polypts[Math.floor(polypts_cnt/2)].x,polypts[Math.floor(polypts_cnt/2)].y),15); // GRH Feb 2007 
      }

    else map.centerAndZoom(new GPoint(173.364257,-41.409776),16);

    document.getElementById("page_name").innerHTML = page_name_string; // Added by GRH March 2007 

    GEvent.addListener(map, "move", function()
      {
      var center = map.getCenterLatLng();
      lonrad2 = deg2rad(center.x);
      latrad2 = deg2rad(center.y);
      center.x = Math.floor(center.x * 1.0E6) / 1.0E6;
      center.y = Math.floor(center.y * 1.0E6) / 1.0E6;
      if(polypts_cnt > 2)
        { 
        find_xtd();
        var latLngStr = '(' + "Map center is at (WGS84 datum) Lat = " + center.y + ", Lon = " + center.x + ", which is " + bearing + " Km from path center." +')';
        }
      else { var latLngStr = '(' + "Map center is at (WGS84 datum) Lat = " + center.y + ", Lon = " + center.x + ')'; }
      document.getElementById("message").innerHTML = latLngStr;});
      }
</script>
</head>
<body onload="onLoad()" onunload="GUnload()">
<div id="map" style="width: 800px; height: 500px"></div>
<div id="message"></div>
</body>
</html>
