				var	_map = null;
				var	_latitude;
				var	_longitude;
				var	_mapControl;
				var	_zoom;
				var	_businessMap;

				function GetMapA()
				{
					if (window.attachEvent)
					{
					
						window.attachEvent("onload", GetMap);
						window.attachEvent("onunload", Page_Unload);
					}
					else
					{
						
					window.addEventListener("DOMContentLoaded",	GetMap,	false);
					window.addEventListener("unload", Page_Unload, false);
					}
				}

				function Page_Unload()
				{
					if (_map !=	null)
					{
						_map.Dispose();
						_map = null;
					}
				}

				function GetMap()
				{
					try{

					if (_map !=	null)
					_map.Dispose();

					// Load	the	map	and	center it on the Pacific Northwest,	Arial view
					_map = new VEMap(_mapControl);


					if(_businessMap=='false')
					{
						_map.LoadMap(new VELatLong(_latitude, _longitude), _zoom, VEMapStyle.Road, false);

						// Add an array	of shapes to the map, unclustered
						var	pins = GetPins();
					}
					else
					{
						_map.LoadMap(new VELatLong(_latitude, _longitude), _zoom, VEMapStyle.Road, true);
						_map.HideDashboard();


						// Add an array	of shapes to the map, unclustered
						var	pins = GetPinsBusiness();
					}
					_map.AddShape(pins);
					_map.AttachEvent("onclick", ClickEvent);

					}
					catch(E)
					{alert(E.description);}
				}

				function ClickEvent(e)
		         {
					 if(e.elementID != null)
		            {
						var pinDescription = _map.GetShapeByID(e.elementID).GetDescription().toString();
						pinDescription = pinDescription.substring(pinDescription.indexOf("=",0)+3)
						pinDescription = pinDescription.substring(pinDescription.indexOf("/",0)+1);
						pinDescription = pinDescription.substring(0,pinDescription.indexOf("'"));
						window.location.href = pinDescription;
		            }
				 }
				function GetPins()
				{

					// Create a	new	array to store all of the VEShape objects (pins)
					
					var	pins = new Array();
					var	count=0;
					var lblEnquiry="Make an enquiry";	
					var lblDetail="Full details";
					var	_zoomStreet="26";
					var	_zoomCity="11";
					var	_zoomRegion="6";

					for	(var x in JSONPinsData)
					{

						var	pinsData = JSONPinsData[x];
						var	pin	= new VEShape(VEShapeType.Pushpin, new VELatLong(pinsData.Latitude,	pinsData.Longitude));
						pin.SetTitle(pinsData.Title);

						var	desc= "<a href='"+pinsData.FullDetail+"'><img	 class='img_pins' src='"+pinsData.ImageUrl+"'/></a>"+pinsData.Description+"	<a href='"+pinsData.RequestAppointment+"' class='link_pins_appon'>"+ lblEnquiry+ "<img class='arrow_icon' src='/ATStyle/Images/img_arrowLink.gif'/></a><a	href='"+pinsData.FullDetail+"' class='link_pins_detail'>"+lblDetail+"<img class='arrow_icon' src='/ATStyle/Images/img_arrowLink.gif'/></a><div><strong>Zoom to: </strong><a href='#' onclick='DoZoom("+_zoomCity+");' >City | </a><a href='#' onclick='DoZoom("+_zoomRegion+");' > Region </a></div>";

						pin.SetCustomIcon("<div	class='pinStyle1'><div class='text'>"+ String.fromCharCode(65+count)+"</div></div>");
						pin.SetDescription(desc);
						pins.push(pin);
						count++;
					}

					return pins;
				}

				function DoZoom(zoomLevel)      
				{ 
								
					_map.SetZoomLevel(zoomLevel);     
				}

				function GetPinsBusiness()
				{
					var	pins = new Array();
					for	(var x in JSONPinsData)
					{

						var	pinsData = JSONPinsData[x];
					// Create a	new	array to store all of the VEShape objects (pins)
					
					var	pin	= new VEShape(VEShapeType.Pushpin, new VELatLong(_latitude,_longitude));
					pin.SetTitle(pinsData.Title);
					var	desc= pinsData.Description;

   				    pin.SetCustomIcon("<div	class='pinStyle1'></div>");

//					pin.SetCustomIcon("<div	class='pinStyle1'>sas</div>");
pin.SetDescription(desc);
					pins.push(pin);	
					
					}
					return pins;
				}
