/*
 * $Header: /cygdrive/c/Documents\040and\040Settings/frank/My\040Documents/svmorninglight.com/php/RCS/googleMaps.js,v 1.1 2009/06/25 07:59:38 frank Exp frank $
 *
 * $Log: googleMaps.js,v $
 * Revision 1.1  2009/06/25 07:59:38  frank
 * Initial revision
 *
 */

// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the function closure
// Each instance of the function preserves the contends of a different instance
// of the "marker" and "html" variables which will be needed later when the event triggers.    

function initialize() 
{
    if (GBrowserIsCompatible()) { // if the browser is compatible with Google Map's
        var map = document.getElementById("myMap"); // Get div element
        var m = new GMap2(map); // new instance of the GMap2 class and pass in our div location.
 
        m.setMapType(G_HYBRID_MAP); // sets the default mode. G_NORMAL_MAP, G_HYBRID_MAP G_SATELLITE_MAP

        loadMapContents(m);
        
     
        if (!hide_controls) {
            var c = new GMapTypeControl(); // switch map modes
            m.addControl(c);
            m.addControl(new GLargeMapControl()); // creates the zoom feature
        }
    }
    else {
        alert("This page requires Javascript support!");
    }
}

function createMarker(point, html, title, openHtml) {
    var marker = new GMarker(point, 
                             {title:title, 
                                     hide:false});
    GEvent.addListener(marker, 'click', 
                       function() {
                           marker.openInfoWindowHtml(html);
                       }
        );
    //if (openHtml) {
    //    marker.openInfoWindowHtml(html);
    //}
                      
    return marker;
}

