    //<![CDATA[
			
		var counter_gm = 0;
		var map;
		var geocoder;
		var localSearch;
		var itemsCount = 0;
		var zoomLevel = 0;
		var popupWindowHTML = new Array();		
		var arrMarkers = new Array();

		function load(addressesArray, ZoomLevel, PopupWindowHTMLarray)
		{			
			if (GBrowserIsCompatible())
			{
				//alert(addressesArray.length);
				//alert(PopupWindowHTMLarray.length);
				
				
				// Create a new instance of the map and geo coder objects
			    map = new GMap2(document.getElementById("map"));	

			    geocoder = new GClientGeocoder();
				localSearch = new GlocalSearch();	
			
				// Add the navigation cotrols to the map.
			    map.addControl(new GSmallMapControl());
			    map.addControl(new GMapTypeControl());					
				
				itemsCount = addressesArray.length;	
				zoomLevel = ZoomLevel;			
													
				// loop for the number of addresses in the markers array.
				for (i = 0; i < addressesArray.length; i++)
				{
					try
					{
						popupWindowHTML[i]	= PopupWindowHTMLarray[i];
						// alert(popupWindowHTML[i]);
					}
					catch(e)
					{
						alert(e.message);						
					}
					
					usePointFromPostcode(addressesArray[i].toString(), addToMap);														
				}
			}
		}

		function usePointFromPostcode(postcode, callbackFunction) 
		{
			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);
						callbackFunction(point);
					}
					else
					{
						//alert("Postcode not found!");
					}
				}
			);	
				
			localSearch.execute(postcode + ", UK");
		}

		function addToMap(point)
		{
			var marker;	
			var baseIcon = new GIcon();
			// Incerement the image counter.
			counter_gm = counter_gm + 1;		
			// Set the new icon options.			
			baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
			baseIcon.iconSize = new GSize(20, 34);
			baseIcon.shadowSize = new GSize(37, 34);
			baseIcon.iconAnchor = new GPoint(9, 34);
			baseIcon.infoWindowAnchor = new GPoint(9, 2);
			baseIcon.infoShadowAnchor = new GPoint(18, 25);
			
			//Was used to display bullet marker if there is one address
			//if (itemsCount > 1) 
			//{
				baseIcon.image = "images/markers/marker" + counter_gm + ".png";
			//}
			//else
			//{
			//	baseIcon.image = "images/markers/marker.png";
			//}	

				// Set up our GMarkerOptions object
				var markerTitle = (counter_gm);
				
				// Set up our GMarkerOptions object
				markerOptions = { icon: baseIcon, title: markerTitle };
				
				// Create a marker and pass it the above options
				marker = new GMarker(point, markerOptions);							
				
				//alert(popupWindowHTML[x-1] + ' , ' + x);
				
				// Add a new event handler on marker click to display bubble
				GEvent.addListener(marker, "click", function(){
					marker.openInfoWindowHtml(popupWindowHTML[parseInt(marker.getTitle())-1]);
				});
				
				//Add marker to array.
				arrMarkers.push(marker);	
			
			//If this is the last marker..
			if (counter_gm == itemsCount)
			{
				//..call function to add all markers to map in 1 go.
				addMarkersToMap();
				//window.setTimeout(addMarkersToMap,1);
			}
		}
		
		function addMarkersToMap()
		{		
			//Center map on last marker.
			map.setCenter(arrMarkers[arrMarkers.length-1].getPoint(),zoomLevel);
			
			//Loop through the markers array.
			for (i=0; i < arrMarkers.length; i++)
			{
				//Add the markers to the map.
				var marker = arrMarkers[i];			
				map.addOverlay(marker);			
			}							
		}

    //]]>
