  var geo = new GClientGeocoder(new GGeocodeCache());
  var map

  function load() {
    if (GBrowserIsCompatible()) {
      map = new GMap2(document.getElementById("map"));
      map.setCenter(new GLatLng(logn, lati), zoom);

		  map.addControl(new GLargeMapControl()); 
      map.addControl(new GMapTypeControl());
      map.addControl(new GOverviewMapControl());
		  map.setMapType(G_NORMAL_MAP);

		  map.enableDoubleClickZoom();
		  //map.enableScrollWheelZoom();
		  map.enableContinuousZoom();
		  GEvent.addDomListener(map.getContainer(), "DOMMouseScroll", wheelevent);
		  map.getContainer().onmousewheel = wheelevent;
		
		  active="search"
		  document.getElementById("search").focus();
     
    }
  }

  function showAddress() {
	  var search = document.getElementById("input_search").value;
	  // ====== Perform the Geocoding ======        
	  geo.getLatLng(search, function (point)
		  { 
			  // ===== If that was successful, plot the point and centre the map ======
			  if (point) {
			    var marker = new GMarker(point);
			    map.addOverlay(marker);
			    map.setCenter(point,14);
			  }
			  // ====== Decode the error status ======
			  else {
			    // ==Look to see if the query was cached ==
			    var result=geo.getCache().get(search);
			    if (result) {
				  var reason="Code "+result.Status.code;
				  if (reasons[result.Status.code]) {
				    reason = reasons[result.Status.code]
				  }
			    } else {
				  var reason = "";
			    } 
			    alert('Could not find "'+search+ '" ' + reason);
			  }
		    }
		  );
  }


function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}

function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}

