﻿      var ffv = 0;
      var ffn = "Firefox/";
      var ffp = navigator.userAgent.indexOf(ffn);
      if (ffp != -1) ffv = parseFloat(navigator.userAgent.substring(ffp + ffn.length));
      // If we are using Firefox 1.5 or above override the Virtual Earth drawing functions to use SVG
      if (ffv >= 1.5)
      {
          Msn.Drawing.Graphic.CreateGraphic=function(f,b) { return new Msn.Drawing.SVGGraphic(f,b) }
      }
      
      var map = null;
      var mapId = null;
      var mapType = null;
      var mapTranslation = false;
      
		function OnPageLoad(p_mapId, p_mapType, p_mapTranslation)
		{
		   mapId = p_mapId;
		   mapType = p_mapType;
		   mapTranslation = p_mapTranslation;
         
			map = new VEMap('goMapDiv');
			map.onLoadMap = fnLoadCollection;
			map.LoadMap();
		}
		
		function fnLoadCollection()
		{	
         d=document.getElementById('goMapDiv');
         if(d!=null)
         {
            d.style.display = "none";
         }
         
         var veLayerSpec = new VEShapeSourceSpecification(VEDataType.VECollection, mapId);
         map.ImportShapeLayerData(veLayerSpec, fnLayerLoaded, true);
		}
		
      function fnLayerLoaded(layer)
      {
         d=document.getElementById('goMapDiv');
         if(d!=null)
         {
            d.style.display = "block";
         }
         
         var len = layer.GetShapeCount();
         var cnt=0;
         for (cnt=0;cnt < len; cnt++)
         {
            if (cnt > 0)
            {
               var shape = layer.GetShapeByIndex(cnt);
               if (mapType == "G" || mapType == "F")
               {
                  //shape.SetTitle("");
                  //shape.SetDescription("");
               }
               shape.SetCustomIcon("images/pp00green.gif");
            }
         }
         
         if (mapTranslation == true)
         {
		      map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
            fnTranslateMap();
         }
      }
      
      function fnTranslateMap()
      {
          var a=document.getElementById("MSVE_navAction_RoadMapStyle");
          if(a!=null)
          {
             a.innerText="Karte";
             a.title = "Wechseln zur Kartenansicht";
          }
          
          var b=document.getElementById("MSVE_navAction_AerialMapStyle");
          if(b!=null)
          {
             b.innerText="Luftbild";
             b.title = "Wechseln zur Luftbildansicht";
          }
          
          var c=document.getElementById("MSVE_navAction_HybridMapStyle");
          if(c!=null)
          {
             c.innerText="Hybrid";
             c.title = "Wechseln zur Hybridansicht";
          }
          
          var d=document.getElementById("MSVE_navAction_modeCell");
          if(d!=null)
          {
             d.style.display = "none";
          }
          
          var e=document.getElementById("MSVE_navAction_separator0");
          if(e!=null)
          {
            e.style.display = "none";
          }
          
          var f=document.getElementById("MSVE_navAction_ObliqueMapView");
          if(f!=null)
          {
             f.title="Wechseln zur Bird's Eye-Ansicht";
             f.innerText="Bird's Eye";
          }
          
          var g=document.getElementById("MSVE_obliqueNotifyText");
          if(g!=null)
          {
            g.innerHTML="Diesen Ort in Bird's Eye-Ansicht anzeigen";
          }
          
          var h=document.getElementById("MSVE_navAction_toggleGlyphWrapper");
          if(h!=null)
          {
            h.title="Karten-Navigation ausblenden";
            //h.attachEvent("onclick",TranslateNavAction);
          }
          
          var i=document.getElementById("MSVE_navAction_tinyZoomBar_minus");
          if(i!=null)
          {
            i.title="Verkleinern";
          }
          
          var j=document.getElementById("MSVE_navAction_tinyZoomBar_plus");
          if(j!=null)
          {
            j.title="Vergr\xf6\xdfern";
          }
          
          var k=document.getElementById("Compass");
          if(k!=null)
          {
            k.title="Karte verschieben";
          }
          
          var _2f=document.getElementById("MSVE_minimap_r_style_button");
          if(_2f!=null)
          {
             _2f.title="Wechseln zur Kartenansicht";
             _2f.innerHTML="K";
          }
          
          var _30=document.getElementById("MSVE_minimap_h_style_button");
          if(_30!=null)
          {
            _30.title="Wechseln zur Hybridansicht";
          }
          
          var _31=document.getElementById("MSVE_minimap_content");
          if(_31!=null)
          {
            _31.title="Kartenausschnitt durch Verschieben ver\xe4ndern";
          }
      }

