var mapviewer, marker;
var pan_zoom_widget;




function updateGeocodeStatus( type ) {
  var gs = document.getElementById( 'geocode_status' );

  if( type == 'startGeocode' ) {
     //if we are starting a geocode request, display the flashing "Geocoding..." message
     gs.style.display = 'block';
  } else {
     //if we are ending a geocode request, hide the flashing "Geocoding..." message
     gs.style.display = 'none';
  }
}
  
function endGeocode( type, target, location, error_code ) {
    if( error_code && error_code != 'MM_GEOCODE_MULTIPLE_MATCHES') {
        alert( 'There was a problem geocoding that address: '+error_code );
        return;
    } 
    if( error_code == 'MM_GEOCODE_MULTIPLE_MATCHES') {
        alert( 'Please note that multiple possible locations have been found for this address' );
    }
    mapviewer.removeOverlay( marker );
    marker = mapviewer.createMarker( location, {'label' : location.address.toString(), 'text' : '1'} );
}



MMAttachEvent( window, 'load', onLoad );