// 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>Pointe Resort Condominiums</strong><br/>10410 N. Cave Creek Rd, Phoenix, AZ 85020 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/PointeResortCondominiums.aspx\">View Property</a>", "Pointe Resort Condominiums", (new GMarker(new GLatLng(33.581414,-112.055842))),"Arizona"];
markers[1] = ["<strong>Pretti Point</strong><br/>118 Pretti Point, Hot Springs, Arkansas, United States, 71913 <br/><a href=\"/Properties/PropertiesbyRegion/GulfCoast/PrettiPoint.aspx\">View Property</a>", "Pretti Point", (new GMarker(new GLatLng(34.443939,-93.094424))),"Arkansas"];
markers[2] = [/*"<strong>Beso Del Sol</strong><br/>17101 Pacific Coast Highway, Sunset Beach, California, United States, 90742 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/BesoDelSol.aspx\">View Property</a>", "Beso Del Sol", (new GMarker(new GLatLng(33.712981,-118.066257))),"California"*/];
markers[3] = ["<strong>Heavenly Inn</strong><br/>930 Park Avenue South Lake Tahoe, CA 96150 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/HeavenlyInn.aspx\">View Property</a>", "Heavenly Inn", (new GMarker(new GLatLng(38.9563,-119.947364))),"California"];
markers[4] = ["<strong>Secrets Inn</strong><br/>924 Park Avenue South Lake Tahoe, CA 96150 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/SecretsInn.aspx\">View Property</a>", "Secrets Inn", (new GMarker(new GLatLng(38.956462,-119.947734))),""];
markers[5] = ["<strong>Tuscany Manor</strong><br/>350 W Chino Canyon Road, Palm Springs, California, United States, 92262 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TuscanyManor.aspx\">View Property</a>", "Tuscany Manor", (new GMarker(new GLatLng(33.84626,-116.550272))),""];

markers[6] = ["<strong>Kicking Horse</strong><br/>150 Village Road, Granby, Colorado, United States, 80446 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/kickinghorse.aspx\">View Property</a>", "Kicking Horse", (new GMarker(new GLatLng(40.0592,-105.917))),"Colorado"];

markers[7] = ["<strong>Beaver Village</strong><br/>50 Village Drive Building, Winter Park, CO 80482 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/BeaverVillage.aspx\">View Property</a>", "Beaver Village", (new GMarker(new GLatLng(39.9140223,-105.7840208))),""];

markers[8] = [ "<strong>Colorado Rocky Mtn Resorts</strong><br/>912 N Summit Blvd, Frisco, Colorado, United States, 80443 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/coloradorockymountainresorts.aspx\">View Property</a>", "Colorado Rocky Mtn Resorts", (new GMarker(new GLatLng(39.590029,-106.095093))),""];

/*markers[8] = ["<strong>Kicking Horse</strong><br/>Bronco 101, Blue Sky Trail, Granby, CO 80446 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/KickingHorse.aspx\">View Property</a>", "Kicking Horse", (new GMarker(new GLatLng(40.048665,-105.8991166))),""];*/

markers[9] = [ "<strong>Ten Mile Creek</strong><br/>150 Village Road, Granby, Colorado, United States, 80446 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TenMileCreek.aspx\">View Property</a>", "Ten Mile Creek", (new GMarker(new GLatLng(40.0592,-105.917))),""];

markers[10] = [ "<strong>The Pines at Meadowridge</strong><br/>51 Meadow Ln., Winter Park, CO 80482 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/ThePinesatMeadowridge.aspx\">View Property</a>", "The Pines at Meadowridge", (new GMarker(new GLatLng(39.945211,-105.802337))),""];

markers[11] = [];

//markers[11] = ["<strong>Island Park Village</strong><br/>4153 N. Big Springs Loop Rd., Island Park, Idaho, United States, 83429 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/IslandParkVillage.aspx\">View Property</a>", "Island Park Village", (new GMarker(new GLatLng(44.521161,-111.325575))),"Idaho"];

markers[12] = ["<strong>Teton Creek Resort</strong><br/>274 Teton Creek Drive, Driggs, Idaho, United States, 83422 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TetonCreekResort.aspx\">View Property</a>", "Teton Creek Resort", (new GMarker(new GLatLng(43.7482571,-111.0483065))),"Idaho"];

markers[13] = ["<strong>Trout Creek</strong><br/>4749 S. Pleasantview, Harbor Springs, MI 49740  <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/troutcreek.aspx\">View Property</a>", "Trout Creek", (new GMarker(new GLatLng(45.4812919,-84.9145142))),"Michigan"];

markers[14] = ["<strong>Eagles Nest Resort at Indian Point</strong><br/>2 Lantern Bay Road, Branson, Missouri, United States, 65616 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/EaglesNestResort.aspx\">View Property</a>", "Eagles Nest Resort at Indian Point", (new GMarker(new GLatLng(36.6603553,-93.3496548))),"Missouri"];

markers[15] = [];
//markers[14] = ["<strong>Plaza Resort Club</strong><br/>121 West Street, Reno, Nevada, United States, 89501 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/PlazaResortClub.aspx\">View Property</a>", "Plaza Resort Club", (new GMarker(new GLatLng(39.5254421,-119.8156311))),"Nevada"];

markers[16] = ["<strong>Eagles's Nest</strong><br/>472 Needle Peak Rd., Stateline, Nevada, 89449<br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/EaglesNest.aspx\">View Property</a>", "Eagles's Nest", (new GMarker(new GLatLng(38.9596422,-119.8900412))),"Nevada"];

markers[17] = ["<strong>Residence Inn by Marriott</strong><br/>5875 Dean Martin Dr., Las Vegas, NV 89118 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/residenceinnbymarriottlasvegassouth.aspx\">View Property</a>", "Residence Inn", (new GMarker(new GLatLng(36.083005,-115.182641))),""];
markers[18] = ["<strong>Tahoe Summit Village</strong><br/>750 Wells Fargo Lane, Stateline, Nevada, United States, 89449 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TahoeSummitVillage.aspx\">View Property</a>", "Tahoe Summit Village", (new GMarker(new GLatLng(38.9624079,-119.9399029))),""];
markers[19] = ["<strong>Tahoe Village</strong><br/>472 Needle Peak Rd., Stateline, Nevada, United States, 89449 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TahoeVillage.aspx\">View Property</a>", "Tahoe Village", (new GMarker(new GLatLng(38.9596418,-119.8900465))),""];
markers[20] = ["<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[21] = ["<strong>Willowbend</strong><br/>1389 Silver Meadows Drive, Park City, Utah, United States, 84098 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/Willowbend.aspx\">View Property</a>", "Willowbend", (new GMarker(new GLatLng(40.699522,-111.538533))),""];
markers[22] = ["<strong>Dells Club Condos</strong><br/>Wisconsin Dells, Wisconsin, United States, 53965 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/DellsClubCondos.aspx\">View Property</a>", "Dells Club Condos", (new GMarker(new GLatLng(43.6274794,-89.7709579))),"Wisconsin"];
markers[23] = ["<strong>Tamarack Resort</strong><br/>E10035 Xanadu Rd, Wisconsin Dells, Wisconsin, United States, 53940 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/TamarackResort.aspx\">View Property</a>", "Tamarack Resort", (new GMarker(new GLatLng(43.5843687,-89.8058667))),""];
markers[24] = ["<strong>Landmark Resort</strong><br/>Egg Harbor, Wisconsin, United States, 54209 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/LandmarkResort.aspx\">View Property</a>", "Landmark Resort", (new GMarker(new GLatLng(44.9863601,-87.2799592))),""];

markers[25] = ["<strong>Lawrence Welk Resort Villas</strong><br/>8860 Lawrence Welk Drive Escondido, CA 92026 <br/><a href=\"/PropertiesbyRegion/WesternUS/lawrencewelkresortvillas.aspx\">View Property</a>", "Lawrence Welk Resort Villas", (new GMarker(new GLatLng(33.2540019,-117.143447))),""];

markers[26] = ["<strong>Villas on the Greens at The Lawrence Welk Resort</strong><br/>8860 Lawrence Welk Drive Escondido, CA 92026 <br/><a href=\"/Properties/PropertiesbyRegion/WesternUS/villasonthegreenatthewelkresort.aspx\">View Property</a>", "Villas on the Greens at The Lawrence Welk Resort", (new GMarker(new GLatLng(33.2340019,-117.143447))),""];




				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 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
		
		
