var geocoder;
var map;
var addresses = new Array("Политехническая ул., 29", "Гражданский пр., 28 ", "Гжатская ул., 10");
var names = new Array("СПбГПУ, Главное здание", "ИМОП", "Третья точка");
var counter=0;

				function load()
				{
				     // Create new map object
				     map = new GMap2(document.getElementById("map"));
				
				     // Create new geocoding object
				     geocoder = new GClientGeocoder();
				
				    // Retrieve location information, pass it to addToMap()
                                   for (i=0; i < addresses.length; i++)
				      geocoder.getLocations("Санкт-Петербург, "+addresses[i], addToMap);
			        }

                              function createMarker(point,html) 
                              {
                                  var marker = new GMarker(point);
                                           GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);});
                                       
                                  return marker;
                              }
				
				// This function adds the point to the map
				
				function addToMap(response)
				{
				// Retrieve the object
				place = response.Placemark[0];
				point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
   
                                htmlText="<b>"+names[counter]+"</b>";
				
				// Create a marker
                               marker=createMarker(point, htmlText);
                               map.addOverlay(marker);
                               marker.openInfoWindowHtml(htmlText);

                             if (counter==0)
                              {
                                 map.setCenter(point, 14);
                                map.addControl(new GSmallMapControl());
                                map.addControl(new GMapTypeControl());
                               }

                              counter++;                         
			      }
