// wxf 2012-07-02
   var map;
   function initialize() {
       var myLatlng = new google.maps.LatLng(null,null);
       var myOptions = {
        zoom:16,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      }
       
      var map_canvas=document.getElementById("map_canvas");
      if(map_canvas!=null){
        map = new google.maps.Map(map_canvas, myOptions);
      }
     
 }

   function codeAddress(region,map) {
   
     var geocoder = new google.maps.Geocoder();
    if (geocoder) {
        geocoder.geocode( { 'address': region}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          map.setCenter(results[0].geometry.location);
          var marker = new google.maps.Marker({
              map: map, 
              position: results[0].geometry.location,
              title:region
          });
        } else {
              alert("Geocode was not successful for the following reason: " + status);
        }
      });
    }
  }

  function loadScript() {
   
      var script = document.createElement("script");
      script.type = "text/javascript";
      script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
      document.body.appendChild(script);
   } 
     
  window.onload=loadScript;  

