var MapLib={};MapLib.activeMap=null;MapLib.drivingDirectionsDestinationElement=null;MapLib.drivingDirectionsDestinationElementId='goingto';MapLib.drivingDirectionsElement=null;MapLib.drivingDirectionsElementId='directions';MapLib.drivingDirectionsOriginElement=null;MapLib.drivingDirectionsOriginElementId='startingfrom';MapLib.googleMapsLinksElementId='gmlinks';MapLib.initializationComplete=false;MapLib.buttonToggleStreetViewId='toggle-street-view-button';MapLib.buttonToggleTrafficViewId='toggle-traffic-view-button';MapLib.mapElement=null;MapLib.mapElementId='ubermap';MapLib.mapHeight=480;MapLib.mapPanoramaId='panorama';MapLib.mapWidth=640;MapLib.markerManager=null;MapLib.otherPropertyMarkerHeight=25;MapLib.otherPropertyMarkerShadowHeight=25;MapLib.otherPropertyMarkerShadowWidth=38;MapLib.otherPropertyMarkerWidth=25;MapLib.propertyLocationPoint=null;MapLib.propertyMarker=null;MapLib.propertyMarkerHeight=40;MapLib.propertyMarkerShadowHeight=40;MapLib.propertyMarkerShadowWidth=61;MapLib.propertyMarkerWidth=40;MapLib.addListingMarkers=function(){var request=GXmlHttp.create();request.open("GET",MapLib.otherPropertyMarkerDataUrl,true);request.onreadystatechange=function(){var otherPropertyMarkers=[];if(request.readyState==4){var xmlDoc=request.responseXML;if(xmlDoc!=null){var markers=xmlDoc.documentElement.getElementsByTagName("marker");for(var i=0;iShow Detailed Directions';markup+='
  • Print Directions
  • ';markup+='';linksElement.innerHTML=markup;ApplicationLib.show(linksElement);};MapLib.streetViewMarkerOnDragEnd=function(){var latlng=MapLib.streetViewMarker.getLatLng();if(MapLib.streetViewPanorama){MapLib.streetViewClient.getNearestPanoramaLatLng(latlng,function(nearestLatLng){if(nearestLatLng==null){MapLib.streetViewMarker.setLatLng(MapLib.streetViewLastLatLng);MapLib.activeMap.panTo(MapLib.streetViewMarker.getLatLng());}else{ApplicationLib.show("panorama");MapLib.streetViewPanorama.setLocationAndPOV(nearestLatLng);MapLib.streetViewLastLatLng=MapLib.streetViewMarker.getLatLng();ApplicationLib.moveToScreenTop(MapLib.mapPanoramaId);}});}};MapLib.toggleStreetView=function(){var streetViewButton=document.getElementById(MapLib.buttonToggleStreetViewId);if(MapLib.streetViewOverlay){ApplicationLib.hide("panorama");MapLib.activeMap.removeOverlay(MapLib.streetViewOverlay);MapLib.streetViewOverlay=null;if(MapLib.streetViewMarker){MapLib.activeMap.removeOverlay(MapLib.streetViewMarker);MapLib.streetViewMarker=null;MapLib.streetViewLastLatLng=null;} streetViewButton.value="Show Street Level View";ApplicationLib.moveToScreenTop();}else{MapLib.streetViewOverlay=new GStreetviewOverlay();MapLib.activeMap.addOverlay(MapLib.streetViewOverlay);streetViewButton.value="Hide Street Level View";}};MapLib.toggleTrafficView=function(){var trafficViewButton=document.getElementById(MapLib.buttonToggleTrafficViewId);if(MapLib.trafficOverlay){MapLib.activeMap.removeOverlay(MapLib.trafficOverlay);MapLib.trafficOverlay=null;trafficViewButton.value="Show Traffic View";}else{MapLib.trafficOverlay=new GTrafficOverlay();MapLib.activeMap.addOverlay(MapLib.trafficOverlay);GEvent.addListener(MapLib.trafficOverlay,"changed",function(hasTrafficInView){});trafficViewButton.value="Hide Traffic View";}};MapLib.updateStreetViewMarkerLocation=function(theLocation){if(MapLib.streetViewMarker){MapLib.streetViewMarker.setLatLng(new GLatLng(theLocation.lat,theLocation.lng));}};MapLib.validateAndGetDrivingDirections=function(){if(MapLib.validateDrivingDirectionsForm()){MapLib.getDrivingDirections();}else{return false;}};MapLib.validateDrivingDirectionsForm=function(){var validationSuccessful=true;var originMissing=DataEntryLib.isMissing(MapLib.drivingDirectionsOriginElement.value);var destinationMissing=DataEntryLib.isMissing(MapLib.drivingDirectionsDestinationElement.value);var errorMessage="";if(originMissing){validationSuccessful=false;errorMessage+=""Starting From" location must be provided.
    ";} if(destinationMissing){validationSuccessful=false;errorMessage+=""Destination" location must be provided.";} if(!validationSuccessful){ApplicationLib.flashMessage(errorMessage,"warning");} return validationSuccessful;};