/******************************************
	map.js
This is used for all the google map associated tasks,
author: Peter M. Laurina
******************************************/

/*google Map stuff */ 
 var defaultzoom = 14; //default zoom level of Google Maps
 
 var map = null;
 var geocoder = null;
 var circle = null;
 var currentMarker = null;
 
    
function mapload() 
{
  if (GBrowserIsCompatible()) 
  {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.enableScrollWheelZoom()
    map.enableContinuousZoom()
    geocoder = new GClientGeocoder();  
    showAddress(address);
    
  }
}

function showAddress(address) 
{
  if (geocoder) 
  {
    geocoder.getLatLng( address, 
    	function(point) 
        {
          if (!point) 
          {
            alert(address + " not found");
          } 
          else 
          {
            map.setCenter(point, defaultzoom);
            var latlng = new GLatLng(point.lat(), point.lng());
            map.addOverlay(new GMarker(latlng));
            map.setZoom(defaultzoom);
          }
        }
      ); //End of getLatLng()
  }
}