var map;var geocoder;function load() {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());    map.setCenter(new GLatLng(50.947494, 6.953394), 10);    geocoder = new GClientGeocoder();
}    

function addAddressToMap(response) {    map.clearOverlays();    if (!response || response.Status.code != 200) {        alert("Sorry, we were unable to geocode that address");
    } else {
        icon = new GIcon();
        icon.image = "http://www.satyananda-yoga.de/fileadmin/template_ananda/media/syz-icon.png";
        /*icon.shadow = "http://www.satyananda-yoga.de/fileadmin/template_ananda/media/syz-icon-shadow.png";*/
        icon.iconSize = new GSize(18, 30);
        icon.shadowSize = new GSize(29, 30);
        icon.iconAnchor = new GPoint(9, 30);
        icon.infoWindowAnchor = new GPoint(5, 1);
        
        place = response.Placemark[0];        point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
        marker = new GMarker(point,icon);        map.addOverlay(marker);
        map.setCenter(point, 15);    }
}



function showLocation() {    var address = document.forms[0].q.value;    geocoder.getLocations(address, addAddressToMap);}

function findLocation(address) {
    document.forms[0].q.value = address;
    showLocation();
}
