
		//<![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(21.462612, -157.994385), 10, 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);

			icon7 = new GIcon();
			icon7.image = "http://www.trailstv.com/wp-content/themes/revolution_news-30/images/icons/surfing.png";
			icon7.iconSize = new GSize(32, 32);
			icon7.iconAnchor = new GPoint(9, 34);
			icon7.infoWindowAnchor = new GPoint(9, 2);
			icon7.infoShadowAnchor = new GPoint(18, 25);

		}
		 
		function addPoints() {
		 
		newpoints[0] = new Array(-157.720284, 21.399686, icon6, '1', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/kayaking-kailua-bay-oahu/">Kayaking Kailua Bay, Oahu</a><br/>Kailua Sailboards and Kayaks Inc, lets you view the area in the best possible conditions. In our case we had several small rain showers as well as a little chop. Keep in mind, my wife had never been kayaking before we actually got into one. So a little coaching and we were out the door.<br/><br/></div>');
		newpoints[1] = new Array(-157.807102, 21.263578, icon1, '2', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/hiking-diamond-head-crater-oahu/">Diamond Head Crater</a><br/>The most famous volcanic crater in the world is Diamond Head, located on the South-east Coast of Oahu at the end of Waikiki overlooking the Pacific Ocean.<br/><br/></div>');
		newpoints[2] = new Array(-157.801094, 21.333662, icon1, '3', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/hiking-manoa-falls/">Manoa Falls</a><br/>Oahu has a ton of great hikes. We did the Manoa Falls hike which was easy to get to and relatively short and flat hike at the base of the Kooaus Mountains. A few things before you go, you are hiking in a rainforest, its wet, wet and dirt means mud. Take an extra pair of shoes.<br/><br/></div>');
		newpoints[3] = new Array(-157.905271, 21.396594, icon0, '4', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/mountain-biking-oahu-aiea/">Aiea Loop Trail</a><br/>Keaiwa Heiau State Recreation Area is a 385 acre park in a forest at the end of Aiea Heights Drive in Aiea, just North of Pearl Harbor on the island of Oahu. From the trail you can see the remains of a heiau hoola (temple of healing) and a display of medicinal plants from the area.<br/><br/></div>');
		newpoints[4] = new Array(-158.125191, 21.597981, icon7, '5', '<div id="popup" style="width:320px; height:100px;"><a href="http://www.trailstv.com/surfing-north-shore/">Surfing North Shore</a><br/>One of the most famous stretches of beach on the planet. The North Shore pipeline is known the world over for having some of the best big wave surfing on the planet.<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;
		}
		 
		//]]>
