<!--  v1 March 2007

Interactive Google Maps, with Offset lines and distance calculator 
              by Geoff Hitchcox, Christchurch, New Zealand

NOTE: Edit this file with NOTEPAD (or similar) but turn OFF wordwrap!

Please be very careful editing this file, it is a "computer program" so
any slight mistake - will cause the webpage to malfunction or not work.

Contact Derek, at    breit_ideas@hotmail.com    for assistance.

See **** symbols below, on how to customise this script for your website:
-->

<!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" xmlns:v="urn:schemas-microsoft-com:vml">
<head>

<!--  ****
The following two lines, need to be customised for each website:

(1) Obtain a "Google Key" (free) for your site, go to 

    http://www.google.com/apis/maps/signup.html
 
to obtain a Google Key, you can then replace "mine" (which wont work on your site) 
with your own Google Key.

(2) To speed up the loading of your maps, you may want to place the javascript called

GoogleMap_ServerDriver.js
 
in a directory in your website, this will then load faster than getting it 
all the way from New Zealand each time.

So the following two "script" lines need to be customised for your website:
-->

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAASDBzq_t2NczLYKPUEUjUPRRtdmUPAgvALyr04IF99XvwsLufMBSoK2yZOGr2-0gpt79Bi0SrU4-IrQ" type="text/javascript"></script>
<script src="http://homepages.slingshot.co.nz/~geoff36/GoogleMap_ServerDriver.js"></script> 

  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  <title>Interactive Shadow Map</title>
  <style type="text/css"> v\:* { behavior:url(#default#VML); } </style>
  <H3 align="center"><I>Interactive Shadow Map</I></H3>
<div align=center>
This is a beta test (does not work on all browsers) using GOOGLE Maps, coding by Geoff Hitchcox.
<A HREF="http://www.geocities.com/kiwi_36_nz/"
TARGET="_blank">Kiwi Geoff</A>, Christchurch, New Zealand.
<BR><BR>
Zoom in and out with control at left of map. You can "drag" map by holding down left mouse button. 
<BR><BR>
Double-clicking will center map at tip of mouse pointer, the lat/lon and perpendicular distance from center path is then given beneath map.
<BR><BR>
GREEN=Center of Path , Gray=User defined offsets to center line.
<BR><BR>
#### Handy HINT #### If you are using dialup and not all tiles load on the map, press the "-" pad on the zoom control
(left side of map) then one second later press the "+" pad. This will take you back to the same zoom setting, but reload any
tiles that are missing. ENJOY!

<!-- 
Following "Page Name" addition by GRH March 2007 
-->

<H3 align="center">
<div id="page_name">## Place Holder for NAME of event ##</div>
</H3>

Top of Map = North , Left = West , Right = East , Bottom = South
<BR><BR>
Use + or - in following input boxes to decide which side of the GREEN line to draw line.

<!-- ****

In the following FORM, you can "preload" the two OFFSET line values
I have set the default to    value="+5.0"   and    value="-5.0"
If you want to change the two lines to something else, change 5 to whatever,
HOWEVER to ensure the page starts with those values see **** a few lines down

-->

<form>To set gray offset line A (in km perpendicular to GREEN line), edit this box <input name="offset" size="5" value="+5.0"> then
<input type="button" onClick="newoffsetA(this.form);" value="Click Here"></form>
<form>To set gray offset line B (in km perpendicular to GREEN line), edit this box <input name="offset" size="5" value="-5.0"> then
<input type="button" onClick="newoffsetB(this.form);" value="Click Here"></form>

<script type="text/javascript">

// **** Edit the following 2 lines, if you wish OFFSET lines, different to 5 Km
  var offset_A  = +5.0;  // A offset to centre line (km)
  var offset_B  = -5.0;  // B offset to centre line (km)

// Global variables 
  var pi = Math.PI;
  var offset  = 2.0;  // value used in calculation
  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 polypts_cnt = 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 of the Offset lines
  var offpts2 = []    // Array to be used for other Offset line
  var pathcount = 0;  // Number of points in path
  onerror = handleErrors 
  var msg = null 
  var page_name_string = "Name of Event is placed here!"; // Added by GRH March 2007 

  function onLoad() 
    {
    window.map = new GMap(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GScaleControl()) ;
    map.addControl(new GOverviewMapControl()); // Map context 
    // map.setMapType(_SATELLITE_TYPE);
    map.centerAndZoom(new GPoint(173.364257,-41.409776),16);  // Needs to come before "map.addOverlay();" for FIREFOX

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

