var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(51.850, 4.303);
var myOptions = {
  zoom: 13,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("googlemap"), myOptions);
codeAddress();
}
function codeAddress() {
var address = document.getElementById("address").innerHTML;
var balloon = document.getElementById("balloon").innerHTML;
if (geocoder) {
  geocoder.geocode( { 'address': address}, function(results, status) {
	if (status == google.maps.GeocoderStatus.OK) {
	  if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
		map.setCenter(results[0].geometry.location);
		var marker = new google.maps.Marker({
			map: map, 
			position: results[0].geometry.location
		});
		var contentString = balloon;

		var infowindow = new google.maps.InfoWindow({
			content: contentString
		});
		infowindow.open(map,marker);
		
	  } else {
		document.getElementById("googlemap").style.display = "none";
		document.getElementById("address").style.display = "none";
	  }
	} else {
	  document.getElementById("googlemap").style.display = "none";
	  document.getElementById("address").style.display = "none";
	}
  });
}
}
