function initialize() {
  var myOptions = {
    zoom: 8,
    center: new google.maps.LatLng(etabs[0][1],etabs[0][2]),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"),
                                myOptions);
	google.maps.event.addListener(map, 'click', function() {
	      infowindow.close();
	      });
  setMarkers(map, etabs);
}

/**
 * Data for the markers consisting of a name, a LatLng and a zIndex for
 * the order in which these markers should display on top of each
 * other.
 */
function createMarker(map, myLatLng, locs, image,shadow) {
    var marker = new google.maps.Marker({
         position: myLatLng,
         map: map,
         shadow: shadow,
         icon: image,
         title: locs[0]
     });
     
    var contentString = '<table><tr><td rowspan="3">'+locs[5]+'</td><td rowspan="3" width="5px"></td><td><strong>' + locs[0] + '</strong></td></tr><tr><td>' +locs[3] +'</td></tr><tr><td><a href="' + locs[4] + '.html"> <u>Plus d\'informations</u></a></td></tr></table>';
    
    google.maps.event.addListener(marker, 'click', function() {
        infowindow.setContent(contentString); 
        infowindow.open(map,marker);
        }); 
}
var infowindow = new google.maps.InfoWindow( {  size: new google.maps.Size(150,50) });
 
function setMarkers(map, locations) {
  // Add markers to the map

  // Marker sizes are expressed as a Size of X,Y
  // where the origin of the image (0,0) is located
  // in the top left of the image.

  // Origins, anchor positions and coordinates of the marker
  // increase in the X direction to the right and in
  // the Y direction down.
  var image = new google.maps.MarkerImage('images/icons/GGMaps/resto.png',
      // This marker is 20 pixels wide by 32 pixels tall.
      new google.maps.Size(32, 51),
      // The origin for this image is 0,0.
      new google.maps.Point(0,0),
      // The anchor for this image is the base of the flagpole at 0,32.
      new google.maps.Point(16, 51));
  var shadow = new google.maps.MarkerImage('images/icons/GGMaps/resto_ombre.png',
      // The shadow image is larger in the horizontal dimension
      // while the position and offset are the same as for the main image.
      new google.maps.Size(67, 51),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 51));
  
 
  for (var i = 0; i < locations.length; i++) {
    var locs = locations[i];
    var myLatLng = new google.maps.LatLng(locs[1], locs[2]);
    createMarker(map, myLatLng, locs, image,shadow);
  }
}

