
function showMap(coord_1, coord_2, address) {
    ShowEl('testo_trovaci1');
    HideEl('testo_trovaci');

    var icon = new GIcon();
    icon.image = "http://www.ristorantiitaliani.it/img/common/marker.png";
    icon.iconSize = new GSize(26, 40);
    icon.iconAnchor = new GPoint(15, 34);
    icon.infoWindowAnchor = new GPoint(10, 18);
    
    point = new GLatLng(coord_1, coord_2);
    var marker = new GMarker(point, icon);

    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("google_map"));

        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

        map.setCenter(new GLatLng(coord_1, coord_2), 15);
        map.setMapType(G_NORMAL_MAP);

        map.addOverlay(marker);
        marker.openInfoWindowHtml('<span style="font-family: arial, sans-serif; font-size: 11px;">' + address + '</span>');
    }
}

function GeoCoderCallBack(response) {
    if (!response || response.Status.code != 200) {
        ShowEl('testo_trovaci');
        HideEl('testo_trovaci1');
        HideEl('google_map');
    } else {
        ShowEl('testo_trovaci1');
        HideEl('testo_trovaci');
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
        marker = new GMarker(point);

        if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("google_map"));

            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());

            map.setCenter(new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]), 15);
            map.setMapType(G_NORMAL_MAP);

            map.addOverlay(marker);
            marker.openInfoWindowHtml('<span style="font-family: arial, sans-serif; font-size: 11px;">' + place.address + '</span>');
        }
    }
}

geocoder = new GClientGeocoder();

function GetLocation(address) {
    geocoder.getLocations(address, GeoCoderCallBack);
}
