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 point1 = new GLatLng(62.75382,7.01928);
     var point2 = new GLatLng(62.81901,6.92945);

     map.addMapType(G_PHYSICAL_MAP);
     map.addControl(new GSmallMapControl());
     //map.addControl(new GMapTypeControl());
     map.setCenter (new GLatLng(62.82394,6.86079), 10);
	 
	 // 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(point1 ,"<b>Eiskremheia (493m)</b><br> Prim&aelig;rfaktor: 22 m. Kommunetoppunkt.",icon2));
     map.addOverlay(createMarker(point2 ,"<b>J&aelig;rmannburet (99 m)</b><br> Prim&aelig;rfaktor: 99 m",icon2));

 
     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;
}


