var locations = {
  'mv' : {"office":"Mountain View, California, USA",
 "lat": 37.386111,
 "lng": -122.082778,
 "center_lat": 40.0,
 "center_long": 260.0,
 "photo_id": 5067065677115232497,
 "address": "<a href='mv-home.html'>Learn more</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067065677115232497?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-us.blogspot.com/atom.xml",
  "blogTag": "gdd07us",
  "startTime": 9,
  "endTime": 18,
  "webcasts": {
    "startTime": 10,
    "endTime": 6,
      "sessions": {
        "9.0": [ {"title": "Opening Keynote", "link": "25828"} ],
        "11.0": [ {"title": "Better AJAX", "link": "25828"},
                  {"title": "Google SketchUp", "link": "25829"},
                  {"title": "Maps API Intro", "link": "25830"},
                  {"title": "Google Data APIs Intro", "link": "25831"},
                  {"title": "YouTube APIs", "link": "25832"}],
        "1.0": [ {"title": "Geoweb", "link": "25828"},
                 {"title": "Enterprise Search APIs", "link": "25829"},
                 {"title": "Google AJAX APIs", "link": "25830"},
                 {"title": "Computing at Google", "link": "25831"}],
        "2.0": [ {"title": "Mashups with the Google Mashup Editor", "link": "25828"},
                 {"title": "Advanced KML", "link": "25829"},
                 {"title": "Maps API New Features", "link": "25830"},
                 {"title": "Google Web Toolkit", "link": "25831"},
                 {"title": "Testing Systems with AJAX", "link": "25832"}],
        "3.5": [ {"title": "Mapplets", "hour": 3, "link": "25828"},
                 {"title": "Advanced Gdata", "link": "25829"},
                 {"title": "Google Desktop Gadgets", "link": "25830"},
                 {"title": "Python Design Patterns", "link": "25831"}],
        "4.5": [ {"title": "Theorizing from Data", "link": "25828"},
                 {"title": "KML Search and Mashups", "link": "25829"},
                 {"title": "Universal Gadgets", "link": "25830"},
                 {"title": "Better AJAX: Nuts & Bolts", "link": "25831"},
                 {"title": "Custom Search Engine", "link": "25832"}]
       }
   }
},
  'br' : {"office": "São Paulo, Brasil",
 "lat": -23.764009,
 "lng": -46.676114,
 "center_lat": -23.764009,
 "center_long": -46.676114,
 "photo_id": 5070723029076833249,
  "address": "<a href='br-home.html'>Saiba mais</a>",
  "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5070723029076833249?kind=photo&alt=rss&hl=en_US",
  "blogFeed": "http://googledeveloperday2007-br.blogspot.com/atom.xml",
  "blogTag": "gdd07br",
  "startTime": 9,
  "endTime": 18
},
  'uk' : {"office": "London, UK",
 "lat": 51.521134,
 "lng": -0.092182,
 "center_lat": 51.521134,
 "center_long": -0.092182,
 "photo_id": 5067066360015032593,
 "address": "<a href='uk-home.html'>Learn more</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067066360015032593?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-uk.blogspot.com/atom.xml",
 "blogTag": "gdd07uk",
 "startTime": 11,
 "endTime": 20,
 "webcasts": {
  "startTime": 12,
  "endTime": 8,
  "sessions": {
    "11.0" : [ {"title": "Opening Keynote", "link": "25827"}],
    "1.75" : [ {"title": "Google Maps New Features", "link": "25827"}],
    "2.75" : [ {"title": "The Geoweb", "link": "25827"}],
    "3.75" : [ {"title": "Better AJAX", "link": "25827"}],
    "4.75" : [ {"title": "Google Gadgets API", "link": "25827"}]}
  }
},
  'fr' : {"office": "Paris, France",
 "lat": 48.856558,
 "lng": 2.350966,
 "center_lat": 48.856558,
 "center_long": 2.350966,
 "photo_id": 5067066493159018785,
 "address": "<a href='fr-home.html'>En savoir plus</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067066493159018785?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-fr.blogspot.com/atom.xml",
 "blogTag": "gdd07fr",
 "startTime": 13,
 "endTime": 20
},
  'es' : {"office": "Madrid, España",
 "lat": 40.416712,
 "lng": -3.70327,
 "center_lat": 40.416712,
 "center_long": -3.70327,
 "photo_id": 5067066613418103089,
 "address": "<a href='es-home.html'>Más información</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067066613418103089?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-es.blogspot.com/atom.xml",
 "blogTag": "gdd07es",
 "startTime": 11,
 "endTime": 19
},
  'de' : {"office": "Hamburg, Deutschland", 
 "lat": 53.549839,
 "lng": 9.973259,
 "center_lat": 53.549839,
 "center_long": 9.973259,
 "photo_id": 5067066686432547137,
 "address": "<a href='de-home.html'>Erfahren Sie mehr</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067066686432547137?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-de.blogspot.com/atom.xml",
 "blogTag": "gdd07de",
 "startTime": 12,
 "endTime": 19
},
  'jp' : {"office": "日本 - 東京",
 "lat": 35.626335,
 "lng": 139.770652,
 "center_lat": 35.626335,
 "center_long": 139.770652,
 "photo_id": 5070594686864082049,
 "address": "<a href='jp-home.html'>詳細<>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5070594686864082049?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-ja.blogspot.com/atom.xml",
 "blogTag": "gdd07jp",
 "startTime": 9,
 "endTime": 18
},
  'au' : {"office": "Sydney, Australia",
 "lat": -33.894633,
 "lng": 151.195961,
 "center_lat": -33.894633,
 "center_long": 151.195961,
 "photo_id": 5067067158878949745,
 "address" : "<a href='au-home.html'>Learn more</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067067158878949745?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-au.blogspot.com/atom.xml",
 "blogTag": "gdd07au",
 "startTime": 9,
 "endTime": 18
},
  'cn' : {"office": "北京,中国",
 "lat": 40.245992,
 "lng": 116.982422,
 "center_lat": 40.245992,
 "center_long": 116.982422,
 "photo_id": 5067067257663197569,
  "address": "<a href='cn-home.html'>了解, 情</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067067257663197569?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-cn.blogspot.com/atom.xml",
  "blogTag": "gdd07cn",
  "startTime": 9,
  "endTime": 17
},
  'ru' : {"office": "Москва, Россия",
 "lat": 55.75,
 "lng": 37.619998,
 "center_lat": 55.75,
 "center_long": 37.619998,
 "photo_id": 5067066785216794961,
  "address": "<a href='cn-home.html'>了解, 情</a>",
 "photoFeed": "http://picasaweb.google.com/data/feed/base/user/developerday/albumid/5067066785216794961?kind=photo&alt=rss&hl=en_US",
 "blogFeed": "http://googledeveloperday2007-ru.blogspot.com/atom.xml",
  "blogTag": "gdd07ru",
  "startTime": 9,
  "endTime": 17
}
};

// Load it up
function initMap() {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map"));

	map.setCenter(new GLatLng(locations[homelocation].center_lat, locations[homelocation].center_long), 2);
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setMapType(G_SATELLITE_TYPE);

	addMarkers(map);	
  }
}

function addMarkers(map) {
	for (var p in locations) {
		addMarker(homelocation, p, map);
	}
}

function addMarker(homelocation, markerlocation, map) {
	var marker = new GMarker(new GLatLng(locations[markerlocation].lat, locations[markerlocation].lng));
	var html = "<div style='width:260px;' <b>" + headers[markerlocation] + "</b><br><br>" +
				" <a href='" + markerlocation + "-home.html'>" + menu_home + "</a>&nbsp;&nbsp;|&nbsp;&nbsp;" +
				" <a href='" + markerlocation + "-sessions.html'>" + menu_sessions + "</a>&nbsp;&nbsp;|&nbsp;&nbsp;" +
				" <a href='" + markerlocation + "-local.html'>" + menu_local_info + "</a>&nbsp;&nbsp;";
	GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); });
	map.addOverlay(marker);

	if (homelocation == markerlocation) marker.openInfoWindowHtml(html);
}
