

    //<![CDATA[

   var geocoder;
     // On blur, call this function
   function loadgeo()
   {
  	var addr =  document.getElementById("address1")// + ", " + document.getElementById("city".value) + ", " + document.getElementById("state").value + ", ";
    var cty = document.getElementById("city")
	 var st = document.getElementById("state")
var address = addr.value + ", " + cty.value + ", " + st.value
//alert(address)
// Create new geocoding object
      geocoder = new GClientGeocoder();
      // Retrieve location information, pass it to addToForm()
      geocoder.getLocations(address, addToForm);
   }

   // This function adds the point to the form

   function addToForm(response)
   {
      // Retrieve the object
      place = response.Placemark[0];

      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);
	
		//alert(place.Point.coordinates[1])
		document.getElementById("lat").value = place.Point.coordinates[1]
		//alert(place.Point.coordinates[0])
        document.getElementById("lng").value = place.Point.coordinates[0]
   }

    //]]>
