function maps() {

	if(!document.getElementById('map')) return false;
	
	var map_canvas = document.getElementById('map'); //Get the canvas
	var map = new GMap2(map_canvas); //Create a new map object

	var url = document.location;
	var url_bits = String(url).split('/');
	var office = url_bits[(url_bits.length-1)];

	//Look for the location of the offices
	$.ajax({
		type: 'GET',
		url: 'libs/includes/ajax/office_locations.php?office=' + office.substr(0, (office.length-5)),
		success: function(html) {
		
			eval(html);
			
			var point = new GLatLng(locations['latitude'], locations['longitude']);
			var marker = new GMarker(point);
			
			map.setCenter(point, 14);
			map.addOverlay(marker); //Add the user's marker to the map
			
			clickListener(map, marker, locations);
			
			map.setUIToDefault(); //Set the map to look like maps.google.com
		
		}	
   });

}

function clickListener(map, marker, locations) {

	GEvent.addListener(marker, 'click', function() { //Listen out for a click on an info window							
											
		var boxContent = '<p><strong>' + locations['title'] + '</strong><br />';									
		boxContent += locations['address'] + '</p>';
											
		map.openInfoWindowHtml(marker.getLatLng(), boxContent); //Display the markers information
		
	});

}