
var msnMap = null;
var show_location = '';
var geocoder = null; // Google geocoder

      function MsnMapLoad()
      {
         msnMap = new VEMap('msnMap');
         msnMap.LoadMap();
         if ( show_location ){
         	geocoder = new GClientGeocoder();
         	geocoder.getLocations(show_location, mapShowLocation);
         	//showMapLocation(show_location);
         }
      }

      function showMapLocation(strLocation)
      {
         try
         {
            msnMap.Find(null, strLocation);
         }
         catch(e)
         {
            alert(e.message);
         }
      }

    function showLocation(address) {
		show_location = address;
    }


    function mapShowLocation(response) {
      if (!response || response.Status.code != 200) {
        //alert("Sorry, we were unable to geocode that address");
        //map.setCenter(defPoint, defSize);
      } else {
        place = response.Placemark[0];
        size = 7 + place.AddressDetails.Accuracy;
        if ( size > 15 )
        	size = 15;
        point = new VELatLong(place.Point.coordinates[1], place.Point.coordinates[0]);
        msnMap.SetCenterAndZoom(point, size );
      }
	}
