﻿
 
function GmapUnload() {
    var divMap = document.getElementById('divGMap');
    if (divMap) {
        GUnload();
    }
}

var map = null;
var geocoder = null;
var _isInitialLoad = true;

function initialize() {

    if (GBrowserIsCompatible()) {
        var divMap = document.getElementById('divGMap');
        map = new GMap2(divMap);
        map.setUIToDefault()
        map.addControl(new GOverviewMapControl());
        map.setMapType(G_SATELLITE_MAP);
        geocoder = new GClientGeocoder();
    }
}

function showAddress(address) 
{

    if (document.getElementById('divGMap')) 
    {
        if (geocoder) {
            geocoder.getLatLng(address, function(point) {

                if (!point) {
                    //alert(address + " not found");

                } else {
                    map.setCenter(point, 14);
                    var marker = new GMarker(point);
                    map.addOverlay(marker);
                }
            }
        );
        }
    }

}
