var address = "";
var address2 = "";
var map = null;
var geocoder = null;
function load() {
  if (GBrowserIsCompatible()) {
    geocoder = new GClientGeocoder();
	  geocoder.getLatLng(address, renderMap);
  }
}
function load2() {
  if (GBrowserIsCompatible()) {
    geocoder = new GClientGeocoder();
	  geocoder.getLatLng(address, renderMap2);
  }
}
function renderMap(point) {
  if (point) {
	document.getElementById("maprow").style.display = 'block';
	if (document.getElementById("moredetails")){
    document.getElementById("moredetails").style.display = 'inline';
	}
  map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(point,15);
  var marker = new GMarker(point);
	map.addOverlay(marker);
	marker.openInfoWindowHtml(address2, 100);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(address2, 100);
	});
  }
}
function renderMap2(point) {
  if (point) {
	document.getElementById("maprow").style.display = 'block';
	if (document.getElementById("moredetails")){
    document.getElementById("moredetails").style.display = 'inline';
	}
  map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(point,15);
  var marker = new GMarker(point);
	map.addOverlay(marker);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(address2, 100);
	});
  }
}
function setAddress(thisAddress, thisPlace)
{
	address = thisAddress;
	address = address.replace(/<br>/gi," ");
	address = address.replace(/<br>/gi," ");
	address = address.replace(/<br\/>/gi," ");
	address2 = "<strong>" + thisPlace + "</strong><br />" + thisAddress;
}
