        $(document).ready(function(){
          var map = new GMap2(document.getElementById('map'));
		  map.setCenter(new GLatLng(52.99872, -1.26451), 12);
          		  
    // setup 10 random points

      var markers = new Array();
      
      markers[0] = new Array(new GMarker(new GLatLng(52.99872, -1.26451)),"Kimberley Caravans","<br /> Eastwood Road,<br /> Nottingham");
	  	
				$.each(markers,function(i,marker){
					var delayTime = ((i * 3000) / (0.5 * markers.length));//Delay time decreases as number of markers increases
				
					setTimeout(function(){ 
						map.addOverlay(marker[0]);
						$("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function(){
								displayPoint(marker[0], i);
								setActive(this);//Show active state
							})
							.appendTo("#map_list");
					
						GEvent.addListener(marker[0], "click", function(){
							displayPoint(marker[0], i);
							setActive(i);//Show active location
						});
						
						displayPoint(marker[0], i);
						setActive(i);//Show active location
						if (i == (markers.length - 1)) {//If last item in array
							setTimeout(function(){//Remove active class and fade marker after delay
								$("#map_message").fadeOut();
								//setActive();
							}, 3500);
						}
					}, delayTime); 
				});
				
				$("#map_list").css("opacity","0.2").animate({opacity: 1}, 1100);//Fade in menu
				$("#map_message").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));
								
				function displayPoint(marker, index){
					if ($('#map_message').is(':hidden')) {//Allow toggling of markers
						$('#map_message').fadeIn();
					}
					else{//Remove all .active classes and hide markers
						$('#map_message').hide();
						$(".active").removeClass();
					}
					//$("#map_message").hide();//Default behaviour, doesn't allow toggling
					
					var moveEnd = GEvent.addListener(map, "moveend", function(){
						var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
						$("#map_message")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top:markerOffset.y, left:markerOffset.x });
					GEvent.removeListener(moveEnd);
					});
					map.panTo(marker.getLatLng());
				}	
				
				function setActive(el){
					$(".active").removeClass();//Remove all .active classes
					$("#map_list").find('li').eq(el).addClass('active');//Find list element equal to index number and set active
					$(el).addClass('active');//Set active if list element clicked directly
				}
		
		}); //End onReady
