var bhnfmMap;var bhnfmGdir;var bhnfmGeocoder=null;var bhnfmAddressMarker;function bhnfmGoogleLoad(){if(GBrowserIsCompatible()){bhnfmMap=new GMap2(document.getElementById("bhnfmMap"));bhnfmMap.addControl(new GSmallMapControl());bhnfmMap.addControl(new GMapTypeControl());bhnfmMap.setMapType(G_NORMAL_MAP);bhnfmMap.setCenter(new GLatLng(41.092111826673275,-73.91955614089966),13);bhnfmGdir=new GDirections(bhnfmMap,document.getElementById("bhnfmDirections"));GEvent.addListener(bhnfmGdir,"load",onBhnfmGDirectionsLoad);GEvent.addListener(bhnfmGdir,"error",handleBhnfmErrors);var C=new GIcon();C.image="http://labs.google.com/ridefinder/images/mm_20_brown.png";C.shadow="http://labs.google.com/ridefinder/images/mm_20_shadow.png";C.iconSize=new GSize(12,20);C.shadowSize=new GSize(22,20);C.iconAnchor=new GPoint(6,20);C.infoWindowAnchor=new GPoint(5,1);markerOptions={icon:C};var A=new GLatLng(41.092111826673275,-73.91955614089966);bhnfmAddressMarker=new GMarker(A,markerOptions);bhnfmMap.addOverlay(bhnfmAddressMarker);var B="Nyack Farmers' Market";GEvent.addListener(bhnfmAddressMarker,"click",function(){bhnfmAddressMarker.openInfoWindowHtml(B)})}}function setBhnfmDirections(B,C,A){bhnfmGdir.load("from: "+B+" to: "+C,{locale:A})}function clearBhnfmDirections(){bhnfmGdir.clear()}function handleBhnfmErrors(){if(bhnfmGdir.getStatus().code==G_GEO_UNKNOWN_ADDRESS){alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: "+bhnfmGdir.getStatus().code)}else{if(bhnfmGdir.getStatus().code==G_GEO_SERVER_ERROR){alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: "+bhnfmGdir.getStatus().code)}else{if(bhnfmGdir.getStatus().code==G_GEO_MISSING_QUERY){alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: "+bhnfmGdir.getStatus().code)}else{if(bhnfmGdir.getStatus().code==G_GEO_BAD_KEY){alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: "+bhnfmGdir.getStatus().code)}else{if(bhnfmGdir.getStatus().code==G_GEO_BAD_REQUEST){alert("A directions request could not be successfully parsed.\n Error code: "+bhnfmGdir.getStatus().code)}else{alert("An unknown error occurred.")}}}}}}function onBhnfmGDirectionsLoad(){};
