// JavaScript Document

    google.load("maps", "2");
    var map;
    function load() {


      if (google.maps.BrowserIsCompatible()) {
        map = new google.maps.Map2(document.getElementById("map"));
        map.setCenter(new google.maps.LatLng(45.228243, 6.74135), 11);  
		map.setMapType(G_HYBRID_MAP);
		var mapControl = new google.maps.MapTypeControl();
        map.addControl(mapControl);
        map.addControl(new google.maps.LargeMapControl());
		
      }
	 positionne(45.228243, 6.74135,'','<table width=200 border=0><tr><td width=1 rowspan=8 valign=top></td><td width=198><strong>ESF Aussois</strong></td></tr><tr><td>73500 Aussois</td></tr><tr><td> Tél : +33 (0)4.79.20.37.13</td></tr><tr><td>Fax : +33 (0)4.79.20.41.04 </td></tr><tr><td colspan=2 valign=top>Itinéraire :  <a target=\'_blank\' href=\'http://maps.google.com/maps?saddr=&daddr=73500 Aussois \'> Vers ce lieu </a> - <a target=\'_blank\' href=\'http://maps.google.com/maps?saddr=73500 Aussois &daddr=\'> À partir de ce lieu </a></td></tr></table>');
    }


    function positionne(Long,Lat,Adresse,Legende) {
     if (Long==-1 && Lat==-1) {
        //Longitude et lattitude non dfinies, on tente de gcocoder l'adresse
        var geocoder = new google.maps.ClientGeocoder();
        var pointer;
        geocoder.setBaseCountryCode('FR');
        geocoder.getLatLng(
                Adresse,
                function(point){
                        if (!point) {
                                alert(Adresse + " : introuvable");
                        } else {
										alert('' + point);
                                        map.setCenter(point);
                                        AffichePoint(Long,Lat,Legende);
                                }
                        });
     } else {
        var point= new google.maps.LatLng(Long, Lat);
		 map.setCenter(point);
        AffichePoint(Long,Lat,Legende);
    }
    }


    function AffichePoint(Long,Lat,Legende){
      //  map.setCenter(Long,Lat);
      //  var marker=new google.maps.Marker(point);
		
 var blueIcon = new GIcon(G_DEFAULT_ICON); 
	  blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/pink/blank.png";
	  	  //http://www.google.com/mapfiles/marker.png

		var iconBlue = new GIcon(); 
				iconBlue.image = 'http://www.google.com/mapfiles/marker.png';
		iconBlue.iconSize = new GSize(20, 34);
				iconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
		iconBlue.shadowSize = new GSize(22, 20);
		iconBlue.iconAnchor = new GPoint(6, 20);iconBlue.infoWindowAnchor = new GPoint(5, 1);
		var options = { icon: iconBlue,draggable: false,bouncy: false};	  
	  var marker = new GMarker(new GLatLng(Long,Lat),options);	
	  
	      //    var marker=new google.maps.Marker(point,options);
	
		
        map.addOverlay(marker);
        marker.openInfoWindowHtml(Legende);
		 GEvent.addListener(marker, "click", function() {
				   marker.openInfoWindowHtml(Legende);
		 });
   }


    google.setOnLoadCallback(load);
   
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

