    var map;
	var localSearch = new GlocalSearch();
    var i=0;
    var j=1;
    var geocoder;
    var InfoString=[];
    var setCenter = 0;
    
 // Create our "Office" marker icon
	var officeIcon = new GIcon();
	officeIcon.image = "http://maps.google.com/mapfiles/kml/pal2/icon10.png";
	officeIcon.iconSize=new GSize(32,32);
	officeIcon.shadowSize=new GSize(56,32);
	officeIcon.iconAnchor=new GPoint(16,32);

// Create our "Property" marker icon
	var propertyIcon = new GIcon(G_DEFAULT_ICON);
	propertyIcon.image = "http://maps.google.com/mapfiles/kml/pal2/icon13.png";
	propertyIcon.iconSize=new GSize(32,32);
	propertyIcon.shadowSize=new GSize(56,32);
	propertyIcon.iconAnchor=new GPoint(16,32);

function initialize(mapContainer) {
	map = new GMap2(document.getElementById(mapContainer));
    map.setCenter(new GLatLng(52, 0), 11);
    map.setUIToDefault();
    geocoder = new GClientGeocoder();
}
    
function initializeLatLng(mapContainer, lat, lng) {
    map = new GMap2(document.getElementById(mapContainer));
    map.setCenter(new GLatLng(lat, lng), 11);
    map.setUIToDefault();
    geocoder = new GClientGeocoder();
}

function createMarker(point, htmlString, ToolTip) {
    var markerProperty = {icon:propertyIcon, title:ToolTip};
    var marker = new GMarker(point, markerProperty);
    GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(htmlString);});
    return marker;
}

function addAddressToMap(response) {
		i++;
    	var htmlString=InfoString[i];
    	var marker = createMarker(response, htmlString, "Click to open info window");
    	if (setCenter) { map.setCenter(response, 11)};
    	map.addOverlay(marker);
   	}


function showLocation(postcode) {
	localSearch.setSearchCompleteCallback(null, 
		function() {
			if (localSearch.results[0])
			{		
				var resultLat = localSearch.results[0].lat;
				var resultLng = localSearch.results[0].lng;
				var point = new GLatLng(resultLat,resultLng);
				addAddressToMap(point);
			}else{
				alert("Postcode not found!");
			}
		});	
	localSearch.execute(postcode + ", UK");
}

function createOfficeMarker (Lat, Lng, ToolTip){
   	point = new GLatLng(Lat, Lng);
   	var markerOffice = {icon:officeIcon, title:ToolTip};
   	var officeMarker = new GMarker(point, markerOffice);
   	return officeMarker;	
}
    
function SwitchOffice(lat, lng) {
    map.panTo(new GLatLng(lat, lng));
}	