/*
   Copyright (c) 2010, Phillip H. Griffin. All rights reserved. 

   griffin-map.js 
   
   This javascript file contains the functions needed to produce a 
   Google map showing the location of Griffin Consulting.
   
   HTML FILE IMPLEMENTATION

   To display the animated sequence in an HTML file, you must do add
   the following code to your markup:
   
   Between the <head> and </head> tags, add the following markup so 
   that the javascript code in this file will be available for use by
   the user's browser:
   
   <script 
     src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA_Zl2h01Ef-vajCh40BKUgBSL2o0nMkAA9LmU-mMnOQgej-nm3BQnSJW4GAn2fIngfdhRpfpnjQapDg"
     type="text/javascript">
   </script>
   <script type="text/javascript" src="griffin-map.js"> </script>
   
   At the location in your HTML file where you want the Google
   map displayed, add the following markup:
   
     <div id="map_canvas" style="width: 500px; height: 300px"></div>

   Updated: March 28, 2010
   Contact: phil@phillipgriffin.com
*/


//<![CDATA[
  function initialize() {
    if (GBrowserIsCompatible()) {

      var information = 
        "<strong>GRIFFIN <em>Consulting</em></strong><br />"+
        "Phillip H. Griffin<br />"+
        "1625 Glenwood Avenue<br />"+
        "Raleigh, NC 27608 &nbsp;USA<br /> <br />"+
        "<a href='mailto:phil@phillipgriffin.com?subject=Contact Griffin Consulting' " +
        "title='Send email to Griffin Consulting' >"+
        "Send email ...</a>";

      var map = new GMap2(document.getElementById("map_canvas"));
        
      map.setCenter(new GLatLng(35.801999,-78.64645), 13);
        
      //Add a marker to the map at Griffin Consulting location.
        
      var point = new GLatLng(35.801999,-78.64645);
      map.addOverlay(new GMarker(point));

      // Add addreaa information in a window on the map.
            
      map.openInfoWindowHtml(point, information);
        
      /*
        Use function closure in an event listener to redisplay
        the information window when the user clicks on the map.
      */
      
      GEvent.addListener(map, "click", function() {
        map.openInfoWindowHtml(point, information);
      });
      
      map.setUIToDefault();
    }
  }
//]]>
  
function init() {
  /*
     Place any functions that need to be executed after the
     Web page loads here rather than in the page's <body> tag. 
  */
  initialize();
  GUnload()
}

window.onload = init; 

