
		//<![CDATA[
		var map;
		var icon0;
		var newpoints = new Array();
		 
		function addLoadEvent(func) { 
			var oldonload = window.onload; 
			if (typeof window.onload != 'function'){ 
				window.onload = func
			} else { 
				window.onload = function() {
					oldonload();
					func();
				}
			}
		}
		 
		addLoadEvent(loadMap);
		addLoadEvent(addPoints);
		 
		function loadMap() {
			map = new GMap2(document.getElementById("map"));
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
		
			map.setCenter(new GLatLng(38.74551518488265, -121.651611328125), 7, G_PHYSICAL_MAP);
		 
			icon0 = new GIcon();
			icon0.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/biking.png";
			icon0.iconSize = new GSize(32, 32);
			icon0.iconAnchor = new GPoint(9, 34);
			icon0.infoWindowAnchor = new GPoint(9, 2);
			icon0.infoShadowAnchor = new GPoint(18, 25);
			
			icon1 = new GIcon();
			icon1.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/hiking.png";
			icon1.iconSize = new GSize(32, 32);
			icon1.iconAnchor = new GPoint(9, 34);
			icon1.infoWindowAnchor = new GPoint(9, 2);
			icon1.infoShadowAnchor = new GPoint(18, 25);
			
			icon2 = new GIcon();
			icon2.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/water.png";
			icon2.iconSize = new GSize(32, 32);
			icon2.iconAnchor = new GPoint(9, 34);
			icon2.infoWindowAnchor = new GPoint(9, 2);
			icon2.infoShadowAnchor = new GPoint(18, 25);
			
			icon3 = new GIcon();
			icon3.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/sailing.png";
			icon3.iconSize = new GSize(32, 32);
			icon3.iconAnchor = new GPoint(9, 34);
			icon3.infoWindowAnchor = new GPoint(9, 2);
			icon3.infoShadowAnchor = new GPoint(18, 25);

			icon4 = new GIcon();
			icon4.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/skiing.png";
			icon4.iconSize = new GSize(32, 32);
			icon4.iconAnchor = new GPoint(9, 34);
			icon4.infoWindowAnchor = new GPoint(9, 2);
			icon4.infoShadowAnchor = new GPoint(18, 25);

			icon5 = new GIcon();
			icon5.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/climbing.png";
			icon5.iconSize = new GSize(32, 32);
			icon5.iconAnchor = new GPoint(9, 34);
			icon5.infoWindowAnchor = new GPoint(9, 2);
			icon5.infoShadowAnchor = new GPoint(18, 25);

			icon6 = new GIcon();
			icon6.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/kayaking.png";
			icon6.iconSize = new GSize(32, 32);
			icon6.iconAnchor = new GPoint(9, 34);
			icon6.infoWindowAnchor = new GPoint(9, 2);
			icon6.infoShadowAnchor = new GPoint(18, 25);

		}
		 
		function addPoints() {
		 
		newpoints[0] = new Array(-120.82626342773438, 39.564411856338054, icon0, '1', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/downieville-downhill/">Downieville</a><br/>17 miles of downhill and over 5000 ft vertical drop!!! Singletrack for 85% of ride. steep technical on top with creek crossings, faster high speed on lower area called 2nd divide, waterfalls, swimming holes, long suspension style bridges, and getting rockier each year, go soon!<br/><br/></div>');
		newpoints[1] = new Array(-121.91253662109375, 36.98500309285596, icon0, '2', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/soquel-demo-forest-santa-cruz/">Soquel Demo Forest</a><br/>You will find here some of the best and most challenging MTB trails in the Bay Area. The setting is quite remote, deep in the Santa Cruz mountains. The Demonstration Forest borders the Forest of Nisene Marks, featuring an extensive trail system that hardly ever gets crowded.<br/><br/></div>');
		newpoints[2] = new Array(-122.09793090820312, 36.97183825093165, icon0, '3', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/wilder-ranch-santa-cruz/">Wilder Ranch</a><br/>Wilder Ranch State Park, just north of Santa Cruz along highway 1, is a great place to ride, for beginners as well as advanced riders. That is one of the cool things of Wilder: you can do really mellow but still entertaining loops on fireroads.<br/><br/></div>');

		for(var i = 0; i < newpoints.length; i++) {
		 
				var point = new GPoint(newpoints[i][0],newpoints[i][1]);
		 
				//Add overlay to map 
				var popuphtml = newpoints[i][4] ;
				var marker = createMarker(point,newpoints[i][2],popuphtml);
				map.addOverlay(marker);
			}
		}
		 
		function createMarker(point, icon, popuphtml) {
			var marker = new GMarker(point, icon);
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(popuphtml);
			});
			return marker;
		}
		 
		//]]>
