//from http://forum.cmsmadesimple.org/index.php/topic,5366.0.html

// Check to see if this browser can run the Google API

  if (GBrowserIsCompatible()) {

    var to_html = '';
    var from_html = '';
var point = new GLatLng( 45.539759,6.759467);
var marker = new GMarker(point);


    // Create Parking icon
    var icon = new GIcon();
    icon.image = "http://www.as-if-by-magic.com/images/parking.png";
    icon.iconSize = new GSize(21, 21);
    icon.iconAnchor = new GPoint(6, 20);
    icon.infoWindowAnchor = new GPoint(5, 1);

    // functions that open the directions forms
    function tohere() {
    marker.openInfoWindowHtml(to_html);
    }
    function fromhere(i) {
    marker.openInfoWindowHtml(from_html);
    }

    // Display the map, with some controls and set the initial location
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.setCenter(point, 16);
 
    // Set up office location marker with info window
var address = 'Le Moulin, 73210 Peisey-Nancroix, Savoie, Rh&ocirc;ne-Alpes, France';
var html = '<p><strong>The Goat Shed</strong><br />Moulin<br />73210 Peisey-Nancroix<br />Savoie, France</p>';

    // The info window version with the "to here" form open
    to_html = html + '<strong>Directions: To here</strong> - <a href="javascript:fromhere()">From here</a>' +
       '<br />Start address:<form action="http://maps.google.com/maps" method="get">' +
       '<input type="text" size="40" maxlength="40" name="saddr" id="saddr" value="" /><br />' +
       '<input value="Get Directions" type="submit" />' +
       '<input type="hidden" name="daddr" value="' + address +
       '" />';

    // The info window version with the "from here" form open
    from_html = html + '<strong>Directions:</strong> <a href="javascript:tohere()">To here</a> - <strong>From here</strong>' +
       '<br />End address:<form action="http://maps.google.com/maps" method="get">' +
       '<input type="text" size="40" maxlength="40" name="daddr" id="daddr" value="" /><br />' +
       '<input value="Get Directions" type="submit" />' +
       '<input type="hidden" name="saddr" value="' + address +
       '" />';

   // The inactive version of the direction info
    html = html + '<strong>Directions:</strong> <a href="javascript:tohere()">To here</a> - <a href="javascript:fromhere()">From here</a>';

    GEvent.addListener(marker, "click", function() {
      map.setCenter(point, 16)
      marker.openInfoWindowHtml(html);
    });
    map.addOverlay(marker);

 
// Mark the parking lot
var park = new GLatLng(37.4135,-94.706);
var parking = new GMarker(park, icon);
    GEvent.addListener(parking, 'click', function() {
      map.setCenter(point, 16)
      parking.openInfoWindowHtml("Congratulations, you've found the car park!");
    });
    map.addOverlay(parking);

      //  ======== Add a map overview ==========
      map.addControl(new GOverviewMapControl(new GSize(250,200)));

      //  ======== A function to adjust the positioning of the overview ========
      function positionOverview(x,y) {
        var omap=document.getElementById("map_overview");
        omap.style.left = x+"px";
        omap.style.top = y+"px";
        
        // == restyling ==
        omap.firstChild.style.border = "1px solid gray";

        omap.firstChild.firstChild.style.left="1px";
        omap.firstChild.firstChild.style.top="1px";
        omap.firstChild.firstChild.style.width="250px";
        omap.firstChild.firstChild.style.height="200px";
      }

      //  ======== Cause the overview to be positioned AFTER IE sets its initial position ======== 
      setTimeout("positionOverview(-265,250)",1);
  }