 //<![CDATA[
function Gload() {
    //alert("calling Gload()address: " + address);
    if (GBrowserIsCompatible()) {
        if (address) {
            showAddress();
        } else {
            alert("address is undefined");
        }
        if (from_address) {
            showDirections();
        }
    }
}

function showDirections() {
    var googlemap   = new GMap2(document.getElementById("googlemap"));
    
    directionsPanel     = document.getElementById("route");
    directions          = new GDirections(googlemap, directionsPanel);        
    var addr            = from_address + " to " + address;
    
    directions.load(addr);    
}
    
function showAddress() {
    var googlemap   =  new GMap2(document.getElementById("googlemap"));
    var mapControl  = new GHierarchicalMapTypeControl();

    // Zoom In and Out  + Map types
    googlemap.addControl(new GSmallMapControl());
    googlemap.addControl(new GMapTypeControl())
          
    var geocoder    = new GClientGeocoder();    
    geocoder.getLatLng(
        address,
        function(point) 
        {
            if (point) 
            {
                googlemap.setCenter(point, 13);
                var marker = new GMarker(point);
                googlemap.addOverlay(marker);
                marker.openInfoWindowHtml(title);
            } // if
            else 
            {
                alert(address + " not found");                    
            }   // else
        }       // function 
    );          // geocoder.getLatLng()
}              // function
    
//]]>

