  var ecMap = null;
  var layer = null;

  function GetECMiniMap(lat, lng, start) {
    ecMap = new eContent.Map('myMap');

		ecMap.LoadMap();
   	ecMap.SetCenterAndZoom(new VELatLong(lat, lng), 10);
   	getRout(lat, lng, start);
  }
  
  function getRout(lat, lng, start) {
  	var end; 
    end = new VELatLong(lat, lng);
    
  	var locations;
  	locations = new Array(start, end);	
  	var options = new VERouteOptions();
  	options.DrawRoute = true;
    options.RouteCallback = onGotRoute;
    options.DistanceUnit  = VERouteDistanceUnit.Kilometer;
    
  	ecMap.GetDirections(locations, options);
  }	
  
  function onGotRoute(route) {
     // Unroll route
     var legs     = route.RouteLegs;
     var turns    = "Gesamtstrecke: " + route.Distance.toFixed(1) + " km<br />";
     var numTurns = 0;
     var leg      = null;
                
     // Get intermediate legs
      for(var i = 0; i < legs.length; i++)
      {
         // Get this leg so we don't have to derefernce multiple times
         leg = legs[i];  // Leg is a VERouteLeg object
            
         // Unroll each intermediate leg
         var turn = null;  // The itinerary leg
            
         for(var j = 0; j < leg.Itinerary.Items.length; j ++)
         {
            turn = leg.Itinerary.Items[j];  // turn is a VERouteItineraryItem object
            numTurns++;
            turns += "<br />"+numTurns + ". " + turn.Text + " (" + turn.Distance.toFixed(1) + " km)<br />";
         }
      }
      turns = turns.replace(/ÃŸ/g, "ß");
      turns = turns.replace(/Ã¼/g, "ü");
      turns = turns.replace(/Ã¤/g, "ä");
      turns = turns.replace(/Ã¶/g, "ö");
      turns = turns.replace(/Ãœ/g, "Ü");
      turns = turns.replace(/Ã–/g, "Ö");
      turns = turns.replace(/Ã„/g, "Ä");
			document.getElementById('route').innerHTML = turns;
      //alert(turns);
   }
			
