function createIcon(path){
      var icon = new GIcon();
      icon.image = path
      icon.iconSize=new GSize(32,32)
      icon.iconAnchor=new GPoint(16,32)
      icon.infoWindowAnchor=new GPoint(16,0)
      return icon
}

function getLocationFromGoogle(address){
  var geocoder = new GClientGeocoder();
  geocoder.getLocations(address,populateLocationAndSubmit);
  return false;
}

function populateLocationAndSubmit(response){
   if (!response || response.Status.code != 200) {
     alert("Invalid location! Can't locate the location. Please re-enter the location.")
     return false;
  } else {
    place = response.Placemark[0];
    point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
    $('message_lat').value = place.Point.coordinates[1]
    $('message_lng').value = place.Point.coordinates[0]
    $('message_location_text').value = place.address
    document.forms[0].submit();
  }
}