// JavaScript Document
				
		var geocoder = new GClientGeocoder();
		function displayPoint(map, markers, 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('<div class="xbtn"></div>' + markers[index][0])//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
		}
		
		function configureOverlays($this, map, markers, mark, i, delayTime)
		{
			//setTimeout(function(){ 
				map.addOverlay(mark);
		/*==========================================================
						configureOverlays-List Setup
		==========================================================*/
		
				//Declared variables of the array. Label:property name, Statelabel:State
				var label = markers[i][1];
				var stateLabel = markers[i][3];
				
				//var orderingByState = typeof(markers[i][2]);
					
					//if(orderingByState == "object")
					//{
						// Populate state using variable
						
						// hide blank entrie function
						if(stateLabel == ""){
							$("<li />")
							.html(stateLabel)//Use list item label from array
							.css({'display' : 'none'})
							.appendTo("#map_list");
						}
						else
						{
							$("<li />")
								.html(stateLabel)//Use list item label from array
								.css({ 'color' : '#3b73a9', 'background' : '#f5f5f5', 'font-weight' : 'bold', 'cursor' : 'default', 'display' : 'block', 'width' : '510px'})
								.appendTo("#map_list");	
						}
						
						// Populate property using variables
						$("<li />")
							.html(label)//Use list item label from array
							.css({ 'width' : '162px', 'padding-bottom' : '10px' , 'padding-top' : '10px'})
							.click(function(){
								displayPoint(map, markers, mark, i);
								setActive(this);//Show active state
								
							})
						.appendTo("#map_list");
					//}
					//else
					//{
						//alert('The city of ');
											 
					//}
				
						
											 
					
					
		/* ======================================================== 
					//configureOverlays-Overlay Events
		   ========================================================	*/		
			
				GEvent.addListener(mark, "click", function(){
					displayPoint(map, markers, mark, i);
					setActive(i);//Show active location
				});
				
				displayPoint(map, markers, mark, 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(3500);
						//setActive();
					//}, 3500);
				}
			//}, delayTime); 		
		}
		$(document).ready(function(){ //Start script when ready
				   
			if (document.getElementById("map_canvas")) {//Checks to see that the page element exists and to prevent conflict with other maps
				
				//Default map center location
				var defaultLat = 39.57182223734374;
				var defaultLon = -100.01953125;
			
				var markers = new Array();
markers[0] = ["<strong>Alabama Sands</strong><br/>1117 W Lagoon Avenue, Gulf Shores, Alabama, United States, 36542 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/AlabamaSands.aspx\">View Property</a>", "Alabama Sands", (new GMarker(new GLatLng(30.245644,-87.7162422))),"Alabama"];
markers[1] = ["<strong>Gulf Shores Plantation</strong><br/>805 Plantation Road, Gulf Shores, Alabama 36542 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/GulfShoresPlantation.aspx\">View Property</a>", "Gulf Shores Plantation", (new GMarker(new GLatLng(30.2353418,-87.888357))),""];
markers[2] = ["<strong>Barefoot Beach Resort</strong><br/>19417 Gulf Blvd, Indian Shores, Florida, United States, 33785  <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/BarefootBeachResort.aspx\">View Property</a>", "Barefoot Beach Resort", (new GMarker(new GLatLng(27.84945,-82.843006))),"Florida"];
markers[3] = ["<strong>Sea and Breeze Beach Club</strong><br/>16 Tybrisa Street, Tybee Island, Georgia, United States, 31328 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/SeaandBreezeBeachClub.aspx\">View Property</a>", "Sea and Breeze Beach Club", (new GMarker(new GLatLng(32.0002152,-80.845666))),"Georgia"];
markers[4] = ["<strong>Patti Anne at Sebago Lake</strong><br/>1554 Richville Road, Sebago, Maine 04029 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/PattiAnneatSebagoLake.aspx\">View Property</a>", "Patti Anne at Sebago Lake", (new GMarker(new GLatLng(43.8405528,-70.6194954))),"Maine"];
markers[5] = ["<strong>The Shoppe at Sebago Lake</strong><br/>1555 Richville Road, Sebago, Maine 04029 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/TheShoppeatSebagoLake.aspx\">View Property</a>", "The Shoppe at Sebago Lake", (new GMarker(new GLatLng(43.8259923,-70.5959134))),""];
markers[6] = ["<strong>Garden II</strong><br/>1556 Richville Road, Sebago, Maine 04029 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/GardenII.aspx\">View Property</a>", "Garden II", (new GMarker(new GLatLng(43.8406069,-70.619598))),""];
markers[7] = ["<strong>Jane at Sebago Lake</strong><br/>1555 Richville Road, Sebago, Maine 04029 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/JaneatSebagoLake.aspx\">View Property</a>", "Jane at Sebago Lake", (new GMarker(new GLatLng(43.8259923,-70.5959134))),""];
markers[8] = ["<strong>Little Oak</strong><br/>1556 Richville Road, Sebago, Maine 04029 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/LittleOak.aspx\">View Property</a>", "Little Oak", (new GMarker(new GLatLng(43.8406069,-70.619598))),""];
markers[9] = ["<strong>Sandbars</strong><br/>570 Shore Road, North Truro, Massachusetts, United States, 02652 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/Sandbars.aspx\">View Property</a>", "Sandbars", (new GMarker(new GLatLng(42.0442453,-70.108103))),"Massachusetts"];
markers[10] = ["<strong>183A North Shore Blvd.</strong><br/>183a N Shore Blvd, East Sandwich, Massachusetts, United States, 02537 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/183ANorthShoreBlvd..aspx\">View Property</a>", "183A North Shore Blvd.", (new GMarker(new GLatLng(41.7489649,-70.4325101))),""];
markers[11] = ["<strong>Betty Avenue</strong><br/>2 Betty Avenue, East Sandwich, Massachusetts, United States, 02537 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/BettyAvenue.aspx\">View Property</a>", "Betty Avenue", (new GMarker(new GLatLng(41.7277,-70.409))),""];
markers[12] = ["<strong>21 Chadwell Avenue</strong><br/>21 Chadwell Avenue, Sandwich, Massachusetts, United States, 02563 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/21ChadwellAvenue.aspx\">View Property</a>", "21 Chadwell Avenue", (new GMarker(new GLatLng(41.7708,-70.4902))),""];

markers[13] = ["<strong>51 Knott Avenue</strong><br/>51 Knott Ave, Sandwich, Massachusetts, United States, 02563-1968 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/51KnottAvenue.aspx\">View Property</a>", "51 Knott Avenue", (new GMarker(new GLatLng(41.7697999,-70.496))),""];

markers[14] = ["<strong>Wood Avenue</strong><br/>3 Wood Avenue, Sandwich, Massachusetts, United States, 02563 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/WoodAvenue.aspx\">View Property</a>", "Wood Avenue", (new GMarker(new GLatLng(41.7697999,-70.4959))),""];
markers[15] = ["<strong>Baynard Cove</strong><br/>16 Baynard Cove Road, Hilton Head, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/BaynardCove.aspx\">View Property</a>", "Baynard Cove", (new GMarker(new GLatLng(32.117356,-80.8088075))),"South Carolina"];
markers[16] = ["<strong>Broad Creek Landing</strong><br/>22 Quartermaster Lane, Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/BroadCreekLanding.aspx\">View Property</a>", "Broad Creek Landing", (new GMarker(new GLatLng(32.1652331,-80.7823231))),""];
markers[17] = ["<strong>Coligny Villas</strong><br/>17 Lagoon Rd, Hilton Head Island, South Carolina, United States, 29928-6469 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/ColignyVillas.aspx\">View Property</a>", "Coligny Villas", (new GMarker(new GLatLng(32.1448969,-80.7506141))),""];

markers[18] = [/*"<strong>Courtside Villas</strong><br/>15 Deallyon Rd., Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/CourtsideVillas.aspx\">View Property</a>", "Courtside Villas", (new GMarker(new GLatLng(32.164761,-80.754698))),""*/];

markers[19] = ["<strong>Fiddler's Cove</strong><br/>35 Folly Field Road, Hilton Head, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/Fiddler'sCove.aspx\">View Property</a>", "Fiddler's Cove", (new GMarker(new GLatLng(32.2028446,-80.6941209))),""];
markers[20] = ["<strong>Forest Garden</strong><br/>125 Cordillo Parkway, Hilton Head, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/ForestGarden.aspx\">View Property</a>", "Forest Garden", (new GMarker(new GLatLng(32.14108,-80.762022))),""];
markers[21] = ["<strong>Hilton Head Beach Club</strong><br/>22 Deallyon Ave., Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/HiltonHeadBeachClub.aspx\">View Property</a>", "Hilton Head Beach Club", (new GMarker(new GLatLng(32.164761,-80.754698))),""];
markers[22] = ["<strong>Hilton Head Resort</strong><br/>663 William Hilton Parkway, Hilton Head, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/HiltonHeadResort.aspx\">View Property</a>", "Hilton Head Resort", (new GMarker(new GLatLng(32.191222,-80.709515))),""];
markers[23] = ["<strong>Island Beach and Tennis Resort</strong><br/>40 Folly Field Rd., Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/IslandBeachandTennisResort.aspx\">View Property</a>", "Island Beach and Tennis Resort", (new GMarker(new GLatLng(32.201817,-80.692112))),""];
markers[24] = ["<strong>Island House</strong><br/>25 Deallyon Ave, Hilton Head, South Carolina, United States, 29928-7033 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/IslandHouse.aspx\">View Property</a>", "Island House", (new GMarker(new GLatLng(32.164761,-80.754698))),""];
markers[25] = ["<strong>Seascape Condominiums</strong><br/>42 South Forest Beach Dr., Hilton Head, South Carolina, United States, 29938 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/SeascapeCondominiums.aspx\">View Property</a>", "Seascape Condominiums", (new GMarker(new GLatLng(32.1395435,-80.758653))),""];
markers[26] = ["<strong>Seaside Villas</strong><br/>23 South Forest Beach Dr., Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/SeasideVillas.aspx\">View Property</a>", "Seaside Villas", (new GMarker(new GLatLng(32.1407277,-80.7557272))),""];
markers[27] = ["<strong>Shorewood Condominium</strong><br/>21 South Forest Beach Drive, Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/ShorewoodCondominium.aspx\">View Property</a>", "Shorewood Condominium", (new GMarker(new GLatLng(32.1409171,-80.7552761))),""];
markers[28] = ["<strong>The Breakers</strong><br/>4 N. Forest Beach Dr., Hilton Head Island, South Carolina, United States, 29928 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/TheBreakers.aspx\">View Property</a>", "The Breakers", (new GMarker(new GLatLng(32.1429025,-80.7504489))),""];

markers[29] = [/*"<strong>Waterford</strong><br/>31 Shipyard Drive, Hilton Head, South Carolina, United States, 29926 <br/><a href=\"/Properties/PropertiesbyRegion/SoutheastUS/Waterford.aspx\">View Property</a>", "Waterford", (new GMarker(new GLatLng(32.155233,-80.7428568))),""*/];

//markers[30] = ["<strong>Marbella</strong><br/>131 E. Mars, South Padre Island, Texas, United States, 78597 <br/><a //href=\"/Properties/PropertiesbyRegion/GulfCoast/Marbella.aspx\">View Property</a>", "Marbella", (new GMarker(new GLatLng(26.1199647,-97.1671385))),"Texas"];
markers[30] = ["<strong>Maroz</strong><br/>102 E Capricorn Dr, South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/Maroz.aspx\">View Property</a>", "Maroz", (new GMarker(new GLatLng(26.1214011,-97.1702608))),"Texas"];
markers[31] = ["<strong>Vista Del Mar</strong><br/>102 E. Pompano, South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/VistaDelMar.aspx\">View Property</a>", "Vista Del Mar", (new GMarker(new GLatLng(26.0996506,-97.166175))),""];
markers[32] = ["<strong>Aqua Del Mar</strong><br/>200 West Esperanza Street, South Padre, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/AquaDelMar.aspx\">View Property</a>", "Aqua Del Mar", (new GMarker(new GLatLng(26.116313,-97.1708688))),""];

markers[33] = [/*"<strong>Beachview Condominiums</strong><br/>2401 Gulf Blvd, South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/BeachviewCondominiums.aspx\">View Property</a>", "Beachview Condominiums", (new GMarker(new GLatLng(26.102462,-97.165135))),""*/];

markers[34] = ["<strong>Fiesta Sol</strong><br/>115 E. Amberjack St., South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/FiestaSol.aspx\">View Property</a>", "Fiesta Sol", (new GMarker(new GLatLng(26.1033871,-97.1660387))),""];

markers[35] = ["<strong>Mar Y Sol II</strong><br/>120 E Campeche Street, South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/MarYSolII.aspx\">View Property</a>", "Mar Y Sol II", (new GMarker(new GLatLng(26.108423,-97.1667028))),""];
markers[36] = ["<strong>Mroning Breeze</strong><br/>129 East Morningside Drive, South Padre Island, Texas, United States, 78597 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/MroningBreeze.aspx\">View Property</a>", "Mroning Breeze", (new GMarker(new GLatLng(26.1272595,-97.1693519))),""];

markers[37] = [/*"<strong>Acushnet Place</strong><br/>4521 Acushnet Drive, Corpus Christi, Texas, United States, 78413 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/AcushnetPlace.aspx\">View Property</a>", "Acushnet Place", (new GMarker(new GLatLng(27.692136,-97.404783))),""*/];

markers[38] = ["<strong>The Lodge at Stillwater</strong><br/>1364 West Stillwater Drive, Heber City, Utah, United States, 84098 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TheLodgeatStillwater.aspx\">View Property</a>", "The Lodge at Stillwater", (new GMarker(new GLatLng(40.6281,-111.437))),"Utah"];
markers[39] = ["<strong>King's Creek Plantation</strong><br/>191 Cottage Cove Lane, Williamsburg, Virginia, United States, 23185 <br/><a href=\"/Properties/PropertiesbyRegion/MidAtlanticUS/King'sCreekPlantation.aspx\">View Property</a>", "King's Creek Plantation", (new GMarker(new GLatLng(37.2429483,-76.7082655))),"Virginia"];
markers[40] = ["<strong>Wyndham Kingsgate</strong><br/>619 Georgetown Crescent , Williamsburg, Virginia, United States, 23185 <br/><a href=\"/Properties/PropertiesbyRegion/MidAtlanticUS/WyndhamKingsgate.aspx\">View Property</a>", "Wyndham Kingsgate", (new GMarker(new GLatLng(37.289922,-76.715899))),""];


				var map = new google.maps.Map2($("#map_canvas").get(0));//Initialise google maps
				//map.setCenter(new GLatLng(defaultLat, defaultLon), 4);//Set location to the default and zoom level to x
				//map.disableDoubleClickZoom();//Disable zooming
				
				//=============================
					//Zoom Functionality
				//=============================
				var customUI = map.getDefaultUI();
        		customUI.maptypes.hybrid = false; // Remove MapType.G_HYBRID_MAP
        		map.setUI(customUI);
				map.setMapType(G_PHYSICAL_MAP);
				
				

				//=============================
				      //Functions Called
				//=============================
				$.each(markers,function(i,marker){
					var delayTime = ((i * 0) / (0.5 * markers.length));//Delay time decreases as number of markers increases
					var mark;
					
					var location = typeof(marker[2]);
					
					if(location == "object") //Only for Get Lat String (not in use anymore)
					{
						var mark = marker[2];
						configureOverlays(this, map, markers, mark, i, delayTime);
					}
					else
					{
						
						//geocoder.getLatLng(
						//	 marker[0]
						//	,function(point) {
						//		mark = new GMarker(point);
						//		configureOverlays(this, map, markers, mark, i, delayTime);
						//	}
						//);							 
					}
					
					
				});
				
				map.setCenter(new GLatLng(defaultLat, defaultLon), 3);//Resets location of the default and zoom level to x again
				$("#map_list").css("opacity","0.2").animate({opacity: 1}, 1100);//Fade in menu
				$("#map_message").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));
			}//End if map_canvas exists
			
			
			/* 
			================================
			  X hide #map_message config 
			================================
			*/	
			$("#map_message").click(function () { 
				$("#map_message").hide(); 
			});	
			
			
		}); //End onReady
		
		
