function initialize(lat,lng,zoom) {
  if (GBrowserIsCompatible()) {
	var options = {
		showOnLoad : true,
		resultList : G_GOOGLEBAR_RESULT_LIST_SUPPRESS
	};    
	var map = new GMap2(document.getElementById("map_canvas"), {googleBarOptions: options});
    map.setCenter(new GLatLng(lat, lng), zoom);
    map.setUIToDefault();
    map.enableGoogleBar();
    map.disableScrollWheelZoom();
    map.addControl(new GOverviewMapControl());
	map.addControl(new GLargeMapControl());
    
    // Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    //var baseIcon = new GIcon(G_DEFAULT_ICON);
    /*baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize(20, 34);
    baseIcon.shadowSize = new GSize(37, 34);
    baseIcon.iconAnchor = new GPoint(9, 34);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);*/
    var baseIcon = new GIcon(G_DEFAULT_ICON, "/img/gicon/mm_20_red.png");
    baseIcon.shadow = "/img/gicon/mm_20_shadow.png";
    baseIcon.shadowSize = new GSize(22, 30);
    baseIcon.iconSize = new GSize(12, 20);
    baseIcon.iconAnchor = new GPoint(5, 20);
    

    // Creates a marker whose info window displays the letter corresponding
    // to the given index.
    function createMarker(point, info, link, temp, ws_on) {
    	//alert(title);
      // Create a lettered icon for this point using our icon class
      var wsIcon = new GIcon(baseIcon);
      //letteredIcon.image = "http://www.google.com/mapfiles/markerA.png";
      if (temp) {
      	//wsIcon.image = "/img/gicon/mm_20_green.png";
      	if (ws_on == 1) {
      		wsIcon.image = "/img/gicon/temp/"+Math.round(temp)+".png";
      	} else {
      		wsIcon.image = "/img/gicon/tempoff/"+Math.round(temp)+".png";
      	}
      }

      // Set up our GMarkerOptions object
      markerOptions = { icon:wsIcon,title:info };
      var marker = new GMarker(point, markerOptions);

      GEvent.addListener(marker, "click", function() {
        //sm_open(link);
        r(link);
      });
      return marker;
    }

    // Add 10 markers to the map at random locations
    /*
    var bounds = map.getBounds();
    var southWest = bounds.getSouthWest();
    var northEast = bounds.getNorthEast();
    var lngSpan = northEast.lng() - southWest.lng();
    var latSpan = northEast.lat() - southWest.lat();
    for (var i = 0; i < 10; i++) {
      var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(),
        southWest.lng() + lngSpan * Math.random());
      map.addOverlay(createMarker(latlng, i));
    } 
    */    
      
	var t = new Array();
	var i = 0;
	jQuery(".map").find('.city').each(function(i){
	   t[i] = jQuery(this).find('a').text() + ',' + jQuery(this).find(".lat").text() + ',' + jQuery(this).find(".lng").text() + ',' + jQuery(this).find('a').attr("href");
	   if (jQuery(this).find(".ws_date").text() != '') {
		   t[i] += ',' + jQuery(this).find(".ws_date").text(); // 4
		   t[i] += ',' + jQuery(this).find(".ws_heure").text(); // 5
		   t[i] += ',' + jQuery(this).find(".ws_temp_ext").text(); // 6
		   t[i] += ',' + jQuery(this).find(".ws_pression").text(); // 7
	   } else {
	   	t[i] += ',,,,'; 
	   }
	   if (jQuery(this).find(".marque").text() != '') {
	   	t[i] += ',' + jQuery(this).find(".marque").text(); // 8
	   } else {
	   	t[i] += ',';
	   }
	   if (jQuery(this).find(".ref").text() != '') {
	   	t[i] += ',' + jQuery(this).find(".ref").text(); // 9
	   } else {
	   	t[i] += ',';
	   }
	   if (jQuery(this).find(".ws_date").text() != '') {
		   t[i] += ',' + jQuery(this).find(".ws_humidite_ext").text(); // 10
		   t[i] += ',' + jQuery(this).find(".ws_pluie_jour").text(); // 11
		   t[i] += ',' + jQuery(this).find(".ws_vitesse_vent").text(); // 12
		   t[i] += ',' + jQuery(this).find(".ws_on").text(); // 13
	   }
	   i++;
	 });
	 for (n=0;n<t.length;n++) {
	 	//alert(t[n]);
	   var p = t[n].split(',');
		var latlng = new GLatLng(p[1],p[2]);
		var info = p[0];
		if (p[8]) {info += "\r\n" + 'Marque: ' + p[8];}
		if (p[9]) {info += "\r\n" + 'Référence: ' + p[9];}
		if (p[4]) {
			info += "\r\n" + 'Date: ' + p[4];
			info += "\r\n" + 'Heure: ' + p[5];
			info += "\r\n" + 'Température : ' + p[6] + ' °C';
			if (p[10]) {info += "\r\n" + 'Humidité ' + p[10] + '%';}
			info += "\r\n" + 'Pression atmosphérique: ' + p[7] + ' hPa';
			if (p[11]) {info += "\r\n" + 'Pluie du jour: ' + p[11] + ' mm';}
			if (p[12]) {info += "\r\n" + 'Vitesse du vent: ' + p[12] + ' Km/h';}
		}		
		map.addOverlay(createMarker(latlng, info , p[3], p[6], p[13]));
	 }
	 
  }
}

