var map;
var geocoder = new GClientGeocoder();

function initialize() {
      if (GBrowserIsCompatible()) {
      map = new GMap2(document.getElementById("mapview"));
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GMapTypeControl());

	  var address = addresses[0];
	  geocoder.getLatLng( "Lincon, Nebraska",
			      function(point)
			      {
				map.setCenter(point, 4);
				// increased zoom from 3 to 4
				// Aug 12, 2008
			      });
	  var addLocation = function(point)
	  { map.addOverlay(new GMarker(point)); };
	  for (var i=0; i<addresses.length; i++)
	  { geocoder.getLatLng(addresses[i], addLocation); }
      }
    }

window.addEvent("domready", function()
{

    initialize();

    var locationLinks = $$('.locationLink');

    locationLinks.each(function(el, i)
    {
        el.addEvent('click', function(clicker)
        {
           new Event(clicker).stop();


           geocoder.getLatLng(addresses[i], function(point)
           {
                map.setCenter(point, 12);
                //alert(point);
           });

        });
    });
});
