// 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>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))),"Massachusetts"];
markers[1] = ["<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[2] = ["<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[3] = ["<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[4] = ["<strong>Inn at Swann River</strong><br/>829 Main Street, West Dennis, Massachusetts, United States, 02670 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/InnatSwannRiver.aspx\">View Property</a>", "Inn at Swann River", (new GMarker(new GLatLng(41.6678,-70.152))),""];
markers[5] = ["<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))),""];
markers[6] = ["<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[7] = ["<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))),"Maine"];
markers[8] = ["<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[9] = ["<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[10] = ["<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))),""];
markers[11] = ["<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[12] = ["<strong>Attitash Mountain Village</strong><br/>US Route 302 & River Run Road, Bartlett, New Hampshire, United States, 03812 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/AttitashMountainVillage.aspx\">View Property</a>", "Attitash Mountain Village", (new GMarker(new GLatLng(44.0832183,-71.2292336))),"New Hampshire"];
markers[13] = ["<strong>Santa Barbara South</strong><br/>1008 Wesley Avenue, Ocean City, New Jersey, United States, 08226 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/santabarbarasouth.aspx\">View Property</a>", "Santa Barbara South", (new GMarker(new GLatLng(39.2763052,-74.5766508))),"New Jersey"];

markers[14] = ["<strong>Leaming Avenue</strong><br/>144 Leaming Avenue, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/leamingavenue.aspx\">View Property</a>", "Leaming Avenue", (new GMarker(new GLatLng(38.9842385,-74.8274197))),""];
markers[15] = ["<strong>Carousel</strong><br/>413 East Brigantine Avenue, Brigantine Beach, New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/carousel.aspx\">View Property</a>", "Carousel", (new GMarker(new GLatLng(39.392994,-74.397359))),""];

markers[16] = [];

markers[17] = ["<strong>900 Ocean Avenue</strong><br/>900 Ocean Avenue, Ocean City, New Jersey, United States, 08226 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/900oceanavenue.aspx\">View Property</a>", "900 Ocean Avenue", (new GMarker(new GLatLng(39.2770748,-74.5739474))),""];
markers[18] = ["<strong>Brigantine Island Beach Resort</strong><br/>4500 W Brigantine Ave , Brigantine Beach , New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/brigantineislandbeachresort.aspx\">View Property</a>", "Brigantine Island Beach Resort", (new GMarker(new GLatLng(39.392994,-74.397359))),""];
markers[19] = ["<strong>Brigantine Beach Club</strong><br/>4500 W Brigantine Ave , Brigantine Beach , New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/brigantinebeachclub.aspx\">View Property</a>", "Brigantine Beach Club", (new GMarker(new GLatLng(39.392994,-74.397359))),""];
markers[20] = ["<strong>Mali Kali</strong><br/>19th & Beach Block, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/malikali.aspx\">View Property</a>", "Mali Kali", (new GMarker(new GLatLng(38.9917797,-74.8148894))),""];
markers[21] = ["<strong>Seascape Condominiums</strong><br/>701 Atlantic Avenue, Ocean City, New Jersey, United States, 08226 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/seascapecondominiums.aspx\">View Property</a>", "Seascape Condominiums", (new GMarker(new GLatLng(39.2785872,-74.5702754))),""];
markers[22] = ["<strong>Cedar Sands</strong><br/>Brigantine, New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/cedarsands.aspx\">View Property</a>", "Cedar Sands", (new GMarker(new GLatLng(39.3882113,-74.3997976))),""];
markers[23] = ["<strong>Key Largo</strong><br/>320 E. Wildwood Avenue, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/keylargo.aspx\">View Property</a>", "Key Largo", (new GMarker(new GLatLng(38.988621,-74.8102879))),""];
markers[24] = ["<strong>Flagship</strong><br/>831 Atlantic Avenue, Ocean City, New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/flagship.aspx\">View Property</a>", "Flagship", (new GMarker(new GLatLng(39.276769,-74.5725724))),""];
markers[25] = ["<strong>Esplanade Suites</strong><br/>230 East Taylor Avenue, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/esplanadesuites.aspx\">View Property</a>", "Esplanade Suites", (new GMarker(new GLatLng(38.982466,-74.821871))),""];
markers[26] = ["<strong>Oceanside</strong><br/>875 Plymouth Place, Ocean City, New Jersey, United States, 082626 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/oceanside.aspx\">View Property</a>", "Oceanside", (new GMarker(new GLatLng(39.2766263,-74.5688116))),""];

markers[27] = [/*"<strong>Wildwood by the Sea</strong><br/>308 E. Wildwood Avenue, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/wildwoodbythesea.aspx\">View Property</a>", "Wildwood by the Sea", (new GMarker(new GLatLng(38.988563,-74.810553))),""*/];

markers[28] = ["<strong>Santa Barbara North</strong><br/>1008 Wesley Avenue, Ocean City, New Jersey, United States, 08226 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/santabarbaranorth.aspx\">View Property</a>", "Santa Barbara North", (new GMarker(new GLatLng(39.2763052,-74.5766508))),""];
//markers[29] = ["<strong>Key Colony</strong><br/>3201 Atlantic and Pine Avenue, Wildwood, New Jersey, United States, 08260 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/keycolony.aspx\">View Property</a>", "Key Colony", (new GMarker(new GLatLng(38.989631,-74.810353))),""];
markers[29] = ["<strong>Surrey Beach House</strong><br/>109 S Surrey Ave, Ventnor City, New Jersey, United States, 08406 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/surreybeachhouse.aspx\">View Property</a>", "Surrey Beach House", (new GMarker(new GLatLng(39.340855,-74.471014))),""];
markers[30] = ["<strong>The Islander</strong><br/>322 43rd Street South, Brigantine Beach, New Jersey, United States, 08203 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/theislander.aspx\">View Property</a>", "The Islander", (new GMarker(new GLatLng(39.3882113,-74.3997976))),""];
markers[31] = ["<strong>Bayberry Condominiums</strong><br/>164 40th St South, Brigantine, New Jersey, United States, 08203-3359 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/bayberrycondominiums.aspx\">View Property</a>", "Bayberry Condominiums", (new GMarker(new GLatLng(39.392825,-74.393016))),""];
markers[32] = ["<strong>Sun Beach</strong><br/>Wesley Ave. Ocean City, N.J. 08226<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/sunbeach.aspx\">View Property</a>", "Sun Beach", (new GMarker(new GLatLng(39.277708,-74.5747779))),""];

markers[33] = ["<strong>Pacific Avenue</strong><br/>2810 Pacific Avenue Wildwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/pacificavenue.aspx\">View Property</a>", "Pacific Avenue", (new GMarker(new GLatLng(38.9924695,-74.8103168))),""];

markers[34] = ["<strong>3319 Ocean Avenue</strong><br/>3319 Ocean Avenue, Brigantine, NJ 08203<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/3319oceanavenue.aspx\">View Property</a>", "3319 Ocean Avenue", (new GMarker(new GLatLng(39.391779,-74.385567))),""];

markers[35] = ["<strong>222 E. 25th Avenue</strong><br/>222 E. 25th Ave. Wildwood, NJ, 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/222e25thavenue.aspx\">View Property</a>", "222 E. 25th Avenue", (new GMarker(new GLatLng(38.993489,-74.8075921))),""];

markers[36] = ["<strong>300 East Syracuse</strong><br/>300 East Syracuse Avenue Wilwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/300eastsyracuse.aspx\">View Property</a>", "300 East Syracuse", (new GMarker(new GLatLng(38.9643815,-74.8443527))),""];

markers[37] = ["<strong>8401 Atlantic Avenue</strong><br/>8401 Atlantic Avenue Wildwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/8401atlanticavenue.aspx\">View Property</a>", "8401 Atlantic Avenue", (new GMarker(new GLatLng(38.9638448,-74.8426759))),""];

markers[38] = ["<strong>Flying Dutchman</strong><br/>711 Ocean Avenue, North Wildwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/flyingdutchman.aspx\">View Property</a>", "Flying Dutchman", (new GMarker(new GLatLng(38.999623,-74.791409))),""];

markers[39] = ["<strong>Majestic Hotel</strong><br/>19 Main Avenue, Ocean Grove, NJ 07756<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/majestichotel.aspx\">View Property</a>", "Majestic Hotel", (new GMarker(new GLatLng(40.211929,-74.0046009))),""];

markers[40] = ["<strong>3400 Central Avenue</strong><br/>3400 Central Avenue Ocean City, NJ 08226<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/3400centralavenue.aspx\">View Property</a>", "3400 Central Avenue", (new GMarker(new GLatLng(39.2507168,-74.6103057))),""];

markers[41] = ["<strong>Friendship 7</strong><br/>701 Ocean Avenue N. Wildwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/friendship7.aspx\">View Property</a>", "Friendship 7", (new GMarker(new GLatLng(38.999364,-74.791045))),""];

// markers[34] = ["<strong>Crafts Inn</strong><br/>10 W Main St, Wilmington, Vermont, United States, 05363 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/CraftsInn.aspx\">View Property</a>", "Crafts Inn", (new GMarker(new GLatLng(42.867916,-72.871582))),"Vermont"];
markers[42] = ["<strong>Home Farm Cottages</strong><br/>1386 Pucker Street, Stowe, Vermont, United States, 05672 <br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/HomeFarmCottages.aspx\">View Property</a>", "Home Farm Cottages", (new GMarker(new GLatLng(44.478035,-72.665527))),"Vermont"];

markers[43] = ["<strong>204 East 24th Avenue</strong><br/>204 East 24th Avenue, North Wildwood, NJ 08260<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/204east24thavenue.aspx\">View Property</a>", "204 East 24th Avenue", (new GMarker(new GLatLng(38.993483,-74.806948))),""];

markers[44] = ["<strong>Oceanfront Condominiums</strong><br/>212 W. Brigantine Avenue, Brigantine, NJ 08102<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/oceanfrontcondominiums.aspx\">View Property</a>", "Oceanfront Condominiums", (new GMarker(new GLatLng(39.406191,-74.363954))),""];

markers[45] = ["<strong>Sand Pebbles</strong><br/>440 Atlantic Avenue Ocean City, NJ 08226<br/><a href=\"/Properties/PropertiesbyRegion/NortheastUS/sandpebbles.aspx\">View Property</a>", "Sand Pebbles", (new GMarker(new GLatLng(39.2810954,-74.5671546))),""];

				var map = new google.maps.Map2($("#map_canvas").get(0));//Initialise google maps
				map.setCenter(new GLatLng(defaultLat, defaultLon), 6);//Set location to the default and zoom level to 8
				//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_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
		
		
