var gdirect;
var reasons=[];
reasons[G_GEO_SUCCESS]="Success";
reasons[G_GEO_MISSING_ADDRESS]="Missing address: The address was missing";
reasons[G_GEO_UNKNOWN_ADDRESS]="Unknown address:  No location could be found for the address";
reasons[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable address:  The location cannot be returned due to legal or contractual reasons";
reasons[G_GEO_BAD_KEY]="Bad key: The API key is either invalid or does not match the domain for which it was given";
reasons[G_GEO_TOO_MANY_QUERIES]="Too many queries: The daily geocoding quota has been exceeded";
reasons[G_GEO_SERVER_ERROR]="Server error: The request could not be processed";
reasons[G_GEO_BAD_REQUEST]="Could not understand the request";
reasons[G_GEO_MISSING_QUERY]="No query was specified";
reasons[G_GEO_UNKNOWN_DIRECTIONS]="The GDirections object could not compute directions between the points";
function load(){
if(GBrowserIsCompatible()){
gdirect=new GDirections(Drupal.gmap.mymap,document.getElementById("directions"));
GEvent.addListener(gdirect,"error",function(){
var _1=gdirect.getStatus().code;
if(reasons[_1]){
alert("Failed to obtain directions. "+reasons[_1]);
}
});
}
}
function showDir(_2){
gdirect.load("from:"+_2+" to:"+endAddr+"@"+localLat+","+localLng);
}
function addLoadEvent(_3){
var _4=window.onload;
if(typeof window.onload!="function"){
window.onload=_3;
}else{
window.onload=function(){
if(_4){
_4();
}
_3();
};
}
}
addLoadEvent(load);

