
 
function nl2br(str) 
{
 if(typeof(str)=="string") return str.replace(/(\r\n)|(\n\r)|\r|\n/g,"<BR/>");
 else return str;
}
  
    var iconBlue = new GIcon(); 
    iconBlue.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png';
    iconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue.iconSize = new GSize(12, 20);
    iconBlue.shadowSize = new GSize(22, 20);
    iconBlue.iconAnchor = new GPoint(6, 20);
    iconBlue.infoWindowAnchor = new GPoint(5, 1);

    var iconRed = new GIcon(); 
    iconRed.image = 'http://labs.google.com/ridefinder/images/mm_20_red.png';
    iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconRed.iconSize = new GSize(12, 20);
    iconRed.shadowSize = new GSize(22, 20);
    iconRed.iconAnchor = new GPoint(6, 20);
    iconRed.infoWindowAnchor = new GPoint(5, 1);



function initialize() 
{
 if (GBrowserIsCompatible()) 
 {
 
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl()); 
  
 }
}


function showAddress(address, description, city, plz) 
{

 var adresse = address + " " + plz + " " + city;
 geocoder = new GClientGeocoder();
 geocoder.getLatLng(adresse, function(point) 
 {
  if (!point) 
  {
   alert(adresse + " wurde nicht gefunden!");
  } 
  else
  {
   map = new GMap2(document.getElementById("map"));
   map.addControl(new GLargeMapControl());
   map.addControl(new GMapTypeControl()); 
   map.clearOverlays();
   map.setCenter(point, 13);
   var marker = new GMarker(point, {draggable: true});
   GEvent.addListener(marker, "dragstart", function() 
   {
	  map.closeInfoWindow();
   });

   map.addOverlay(marker);
   var desc = nl2br(description);
   marker.openInfoWindowHtml('<span style="color:#000000"><div style="font-size:17px;font-weight:bold">' + desc + '</div>' + address + '<br/>' + plz + ' ' + city + '</span>');
   GEvent.addListener(marker, "click", function() 
   {
    marker.openInfoWindowHtml('<span style="color:#000000"><div style="font-size:17px;font-weight:bold">' + desc + '</div>' + address + '<br/>' + plz + ' ' + city + '</span>');
   });
   document.formstep2.address.value = address;
   document.formstep2.point.value = point;
   document.formstep2.plz.value = plz;
   document.formstep2.city.value = city;
   document.formstep2.description.value = description;
  }
 }
 );
}





