function load() {
   if (GBrowserIsCompatible()) {
     var map = new GMap2(document.getElementById("map"));

     var icon1 = new GIcon();
     icon1.image = "../icons/markerie.gif";
     icon1.shadow = "../icons/dithshadow.gif";
     icon1.iconSize = new GSize(12, 20);
     icon1.shadowSize = new GSize(22, 20);
     icon1.iconAnchor = new GPoint(6, 20);
     icon1.infoWindowAnchor = new GPoint(5, 1);

     var icon2 = new GIcon();
     icon2.image = "../icons/dd-startie.gif";
     icon2.shadow = "../icons/dithshadow.gif";
     icon2.iconSize = new GSize(12, 20);
     icon2.shadowSize = new GSize(22, 20);
     icon2.iconAnchor = new GPoint(6, 20);
     icon2.infoWindowAnchor = new GPoint(5, 1);

     var point0 = new GLatLng(63.31307, 10.91404); // på Baklifjellet 
     var point1 = new GLatLng(63.33793, 10.69582); // Jervfjellet
     var point2 = new GLatLng(63.34699, 10.83014); // Snustadhøgberget
	 var point3 = new GLatLng(63.42545, 10.85678); // Gjevingåsen
	 
	 var pointA = new GLatLng(63.30672, 10.72567); // Hevilen
	 var pointB = new GLatLng(63.39829, 10.64866); // Buåsen
	 var pointC = new GLatLng(63.40099, 10.67402); // Hønstadåsen
	 var pointD = new GLatLng(63.42204, 10.64808); // Leistadåsen	 

     map.addMapType(G_PHYSICAL_MAP);
     map.addControl(new GSmallMapControl());
     //map.addControl(new GMapTypeControl());
     map.setCenter (new GLatLng(63.383217,10.72883), 11);
	 
	 // Statkart
     var tilelayer = new GTileLayer(null, null, null, {tileUrlTemplate: 'http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo2&zoom={Z}&x={X}&y={Y}', isPng:true, opacity:1.0 } );
     var myTileLayer = new GTileLayerOverlay(tilelayer);
     map.addOverlay(myTileLayer);

	 map.addOverlay(createMarker(point0 ,"på Baklifjellet (622 m)",icon2));
     map.addOverlay(createMarker(point1 ,"Jervfjellet (504 m)",icon2));
     map.addOverlay(createMarker(point2 ,"Snustadhøgberget (412 m)",icon2));
	 map.addOverlay(createMarker(point3 ,"Storheia (332 m)",icon2));	 

     map.addOverlay(createMarker(pointA ,"Hevilen (412 m)",icon1)); 
     map.addOverlay(createMarker(pointB ,"Buåsen (284 m)",icon1));	 
     map.addOverlay(createMarker(pointC ,"Hønstadåsen (273 m)",icon1));	 
     map.addOverlay(createMarker(pointD ,"Leistadåsen (266 m)",icon1));	 
    

 /*
     var polyline = new GPolyline ([
		new GLatLng(62.98602,6.76192),
		new GLatLng(62.89329,6.77718),
		new GLatLng(62.88291,6.78849),
		new GLatLng(62.87264,6.86355),
		new GLatLng(62.87294,6.93688),
		new GLatLng(62.85463,6.98642),
		new GLatLng(62.83872,6.97602),
		new GLatLng(62.82548,6.98134),
		new GLatLng(62.78934,6.95163),
		new GLatLng(62.78646,6.99534),
		new GLatLng(62.78124,7.02013),
		new GLatLng(62.77600,7.02937),
		new GLatLng(62.76311,7.03755),
		new GLatLng(62.75309,7.04692),
		new GLatLng(62.75472,7.02887),
		new GLatLng(62.75030,6.99172),
		new GLatLng(62.75183,6.95599),
		new GLatLng(62.75609,6.91051),
		new GLatLng(62.76413,6.88107),
		new GLatLng(62.76650,6.81598),
		new GLatLng(62.75863,6.75251),
		new GLatLng(62.76751,6.69742),
		new GLatLng(62.80150,6.71217),
		new GLatLng(62.82220,6.74603),
		new GLatLng(62.85728,6.70749),
		new GLatLng(62.88949,6.70724),
		new GLatLng(62.90576,6.68003),
		new GLatLng(62.93167,6.60084),
		new GLatLng(62.98606,6.76206)], "#0000FF", 5, 0.5);
     map.addOverlay(polyline);
	 */
   }
   
}

function createMarker(point,what,icon) {
   var marker = new GMarker(point,icon);
   GEvent.addListener(marker, "click", function() {
     marker.openInfoWindowHtml(what);
   });
   return marker;
}


