// JavaScript Document

function load() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.setCenter(new GLatLng(51.415066, -3.497383), 13);
		var point = new GLatLng(51.415066, -3.497383);
		var point2 = new GLatLng(51.486995, -3.191185);
		map.addOverlay(new GMarker(point, {title:"Head office"}));
		map.addOverlay(new GMarker(point2, {title:"Cardiff Marketing office"}));
		GEvent.addListener(map, "click", function() {
			var zoom = map.getZoom();
			if (zoom == 13) {
				map.setCenter(new GLatLng(51.481089, -3.185048), 14);
			}
			if (zoom == 14) {
				map.setCenter(new GLatLng(51.415066, -3.497383), 13);
			}
			/*var cntr = map.getCenter();
			if (cntr == "(51.415066, -3.497383)") {
				map.setCenter(new GLatLng(51.481089, -3.185048), 14);
			}
			if (cntr == "(51.481089, -3.185048)") {
				map.setCenter(new GLatLng(51.415066, -3.497383), 14);
			}*/
		});

	}
}