//// Googlemaps mit Routenplaner Vers. 1.00 (c) 2007 by www.rpa-com.de////

//Koordinaten
var point = new GLatLng(51.639861, 7.084669);


//Adresse     
var infoname= 'SC Olymp Dorsten e.V.';
var infoname2= 'beim TC Marl 33 e.V.';
var infostrasse= 'Ophoffstr. 33';
var infoort= '45768 Marl';
var infotelefon= 'Telefon: 02365 - 13534';

if (infoname2!=''){infoname2='<br>' + infoname2;}
var infohtml= '<center><div style="width:230px;"><b><big>' + infoname + '</big></b>' + infoname2 + '<br>'+  infostrasse + '<br>' + infoort + '<br>' + infotelefon + '</div></center>';

// Beispiel für Routenplanereingabe
var beispiel= '<div style="font-size: 10px";>Beispiel: Parallelstr.28, 46284 Dorsten</div>';

// Foto (optional)
//var fotopfad= '<center><img src="http://www.wellness-dorsten.de/grafik/foto_gm.jpg" width=120 height=74 vspace=3></center>';
//var infohtml= infohtml + fotopfad; 
     

//<![CDATA[

    // Check to see if this browser can run the Google API
    if (GBrowserIsCompatible()) {

      var gmarkers = [];
      var htmls = [];
      var to_htmls = [];
      var from_htmls = [];
      var i=0;

      // A function to create the marker and set up the event window
      function createMarker(point,name,html) {
        var marker = new GMarker(point);

        // The info window version with the "Hierher" form open
        to_htmls[i] = html + '<br>Route planen: <b>Hierher</b> - <a href="javascript:fromhere(' + i + ')">Von hier aus</a>' +
           '<br>Startadresse: <form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' + beispiel + '<br>' +
           '<INPUT value="Route berechnen" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + 
                  // "(" + name + ")" + 
           '"/>';
        // The info window version with the "Von hier aus" form open
        from_htmls[i] = html + '<br>Route planen: <a href="javascript:tohere(' + i + ')">Hierher</a> - <b>Von hier aus</b>' +
           '<br>Zieladresse: <form action="http://maps.google.com/maps" method="get" target="_blank"> ' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' + beispiel + '<br>' +
           '<INPUT value="Route berechnen" TYPE="SUBMIT">' +
           '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() +
                  // "(" + name + ")" + 
           '"/>';
        // The inactive version of the direction info
        html = html + '<br>Route planen: <a href="javascript:tohere('+i+')">Hierher</a> - <a href="javascript:fromhere('+i+')">Von hier aus</a>';

        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        gmarkers[i] = marker;
        htmls[i] = html;
        i++;
        return marker;
      }

      // functions that open the directions forms
      function tohere(i) {
        gmarkers[i].openInfoWindowHtml(to_htmls[i]);
      }
      function fromhere(i) {
        gmarkers[i].openInfoWindowHtml(from_htmls[i]);
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      //map.setCenter(new GLatLng(48.615243,11.605757), 15);
      map.setCenter(point, 15);
    
      // Set up ONE markers with info windows 
    
     
     var marker = createMarker(point,infoname,infohtml);
     map.addOverlay(marker);
     
     //Übersichtsfenster
     overview = new GOverviewMapControl(new GSize(135,135));
     map.addControl(overview);
     setOverviewPos();
     
     
    }

    
    // display a warning if the browser was not compatible
    else {
      alert("Leider ist Google Maps API nicht kompatibel mit diesem Browser!");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://www.econym.demon.co.uk/googlemaps/

    //]]>
    
