// JavaScript Document

 function load() {
     if (GBrowserIsCompatible()) { 

      // 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 createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.setCenter(new GLatLng(42.87596410238254, -8.525390625), 8);
    
      // Set up three markers with info windows 
    
      var point = new GLatLng(42.8400539612445,-8.581534624099731);
      var marker = createMarker(point,'<div style="width:240px; padding-left:10px; padding-bottom:10px"><p>SSANGYONG / TATA / HYUNDAI SANTIAGO<br/>Ctra. Santiago-Vigo, Km 4<br/>15895 Milladoiro - Ames - A Coruña<br/>Tfno: 981 535 536<br/>Fax: 981 536 616</p></div>')
      map.addOverlay(marker);
	  
	           var point = new GLatLng(43.35684491078803,-8.424711227416992);
      var marker = createMarker(point,'<div style="width:240px; padding-left:10px; padding-bottom:10px"><p>SUZUKI-SANTANA A CORUÑA<br/>Av Finisterre, 271<br/>15008 A Grela- A Coruña<br/>Tfno: 981 634 012<br/>Fax: 981 634 074</p></div>')
      map.addOverlay(marker);

       var point = new GLatLng(43.33850702146877,-8.3750581741333);
      var marker = createMarker(point,'<div style="width:240px; padding-left:10px; padding-bottom:10px"><p>SSANGYONG-TATA A CORUÑA<br/>Ctra N-VI, Km 590<br/>15173 Perillo - Oleiros - A Coruña<br/>Tfno: 981 102 711<br/>Fax: 981 634 224</p></div>')
      map.addOverlay(marker);
	  
	
      var point = new GLatLng(43.50455009119726,-8.221206665039062);
      var marker = createMarker(point,'<div style="width:240px; padding-left:10px; padding-bottom:10px"><p>SUZUKI-SANTANA / SSANGYONG /TATA FERROL<br/>Lugar de Catabois, 642 <br/>15405 Ferrol - A Coruña<br/>Tfno: 981 370 120<br/>Fax: 981 330 912</p></div>')
      map.addOverlay(marker);
	  


    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
	}

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://www.econym.demon.co.uk/googlemaps/

    //]>
	

