﻿function fnSoegning()
{ 
    strSerachField = document.SearchForm1.q;
    if(strSerachField.value != '')
    {
        document.SearchForm1.submit();
    }
    else
        alert("Indtast søgeord i søgefeltet!")
}

//document.onkeydown = checkKeycode
function checkKeycode(e) {
var keycode;
    strSerachField = document.SearchForm1.q;
    if(strSerachField.value != '')
    {
      if (window.event) keycode = window.event.keyCode;
      else if (e) keycode = e.which;
      if(keycode == 13){
        fnSoegning();    
      }
    }
    else
       {
        alert("Indtast søgeord i søgefeltet!")
        strSerachField.focus();
        void(0);
       }
}

function gup(name){  
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
      return "";
  else
      return results[1];
}
function load() {
   var strNavn = gup('ID');
   //alert(strNavn);
   if (strNavn == "8"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("afrika"),
         { size: new GSize(540,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(4.334345, 10.217285), 2);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);55.869147,11.228027
      }
   }
   if (strNavn == "9"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("asien"),
         { size: new GSize(539,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(55.578345, 97.734375), 1);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);
      }
   }
   if (strNavn == "11"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("europa"),
         { size: new GSize(539,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(55.478853, 19.511719), 2);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);
      }
   }
   if (strNavn == "12"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("mellemamerika"),
         { size: new GSize(540,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(20.055931, -97.998047), 4);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);
      }
   }
   if (strNavn == "13"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("nordamerika"),
         { size: new GSize(540,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(63.658275, -99.843750), 2);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);
      }
   }
   if (strNavn == "10"){
      if (GBrowserIsCompatible()) {
         var map2 = new GMap2(document.getElementById("oceanien"),
         { size: new GSize(540,320) } );
         map2.removeMapType(G_HYBRID_MAP);
         map2.setCenter(new GLatLng(-25.958045, 136.933594), 3);
         map2.addControl(new GLargeMapControl());
         var mapControl2 = new GMapTypeControl();
         map2.addControl(mapControl2);
      }
   }
   if (strNavn == "14"){
      if (GBrowserIsCompatible()) {
        // define the crosshair tile layer and its required functions
        var crossLayer = new GTileLayer(new GCopyrightCollection(""), 0, 15);
        crossLayer.getTileUrl =  function(tile, zoom) {
          return "./Files/System/tile_crosshairs.png";
        }
        crossLayer.isPng = function() {return true;}

        // Create a new map type incorporating the tile layer
        var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0],
                              crossLayer ];
        var mtTerCross = new GMapType(layerTerCross,
                                      G_PHYSICAL_MAP.getProjection(), "Ter+");

         var map = new GMap2(document.getElementById("sydamerika"),
         { size: new GSize(540,320) } );
         map.addMapType(G_PHYSICAL_MAP);
         map.addMapType(mtTerCross);
         map.setCenter(new GLatLng(-24.686952, -63.808594), 2);
         map.addControl(new GLargeMapControl())

        var mapControl = new GHierarchicalMapTypeControl();
        
        // Set up map type menu relationships
        mapControl.clearRelationships();
        mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false);
        mapControl.addRelationship(G_PHYSICAL_MAP, mtTerCross, "Crosshairs");
  
        // Add control after you've specified the relationships
        map.addControl(mapControl);
      }
   }
}

