var helpWindow="Select your start location. Please check out the "+"<a onclick=\"window.open('mapFAQ.html','_blank','width=500,height=600,scrollbars=yes','false')\">"+"<span style='color:blue;cursor:pointer;text-decoration:underline;'>Map guide</span></a><br><br>Clicking on the map will place the marker.";var fromIcon=new GIcon();fromIcon.iconSize=new GSize(26,34);fromIcon.shadowSize=new GSize(37,34);fromIcon.iconAnchor=new GPoint(15,34);fromIcon.infoWindowAnchor=new GPoint(9,2);fromIcon.infoShadowAnchor=new GPoint(18,25);fromIcon.image="images/googleMapIcons/home_h.png";fromIcon.shadow="images/googleMapIcons/homeShadow.png";var toIcon=new GIcon();toIcon.iconSize=new GSize(30,34);toIcon.shadowSize=new GSize(37,34);toIcon.iconAnchor=new GPoint(10,34);toIcon.infoWindowAnchor=new GPoint(9,2);toIcon.infoShadowAnchor=new GPoint(18,25);toIcon.image="images/googleMapIcons/destination.png";toIcon.shadow="images/googleMapIcons/destinationShadow.png";var custIcon=new GIcon();custIcon.iconSize=new GSize(30,34);custIcon.shadowSize=new GSize(37,34);custIcon.iconAnchor=new GPoint(10,34);custIcon.infoWindowAnchor=new GPoint(9,2);custIcon.infoShadowAnchor=new GPoint(18,25);custIcon.image="images/googleMapIcons/destination.png";custIcon.shadow="images/googleMapIcons/destinationShadow.png";var enrouteIcon=new GIcon();enrouteIcon.image="images/googleMapIcons/enroute.png";enrouteIcon.shadow="images/googleMapIcons/enroute_shadow.png";enrouteIcon.iconSize=new GSize(12,20);enrouteIcon.shadowSize=new GSize(22,20);enrouteIcon.iconAnchor=new GPoint(6,20);enrouteIcon.infoWindowAnchor=new GPoint(5,1);var cityLatMapper=new Array(0,12.967089,18.52519,13.060750,17.392579,19.11105,22.5265,28.63,23.04);var cityLngMapper=new Array(0,77.588196,73.851471,80.245857,78.461609,72.87093,88.3448,77.22,72.56);var cityNameMapper=new Array(0,"Bangalore","Pune","Chennai","Hyderabad","Mumbai","Kolkata","New Delhi","Ahmedabad");var locationLatMapper=new Array(0,12.952);var locationLngMapper=new Array(0,77.643);var locationNameMapper=new Array(0,"Net App,Embassy Golf Links");function getTimeStamp(){return new Date().getTime();}
function moveToCityCenter(){map.setCenter(new GLatLng(cityLatMapper[cityId],cityLngMapper[cityId]),12);}
function initializeMapForCity(){resetMap();resetEnRoute();}
function resetFromTo(){document.getElementById("fromLocation").value="";document.getElementById("toLocation").value="";document.getElementById("fromLocationId").innerHTML="";document.getElementById("toLocationId").innerHTML="";}
function resetEnRoute(){document.getElementById("enroute1").value="";document.getElementById("enroute1Id").innerHTML="";document.getElementById("enroute2").value="";document.getElementById("enroute2Id").innerHTML="";document.getElementById("enroute3").value="";document.getElementById("enroute3Id").innerHTML="";document.getElementById("enroute4").value="";document.getElementById("enroute4Id").innerHTML="";}
function resetMap(){counter=0;map.clearOverlays();moveToCityCenter();map.openInfoWindow(map.getCenter(),helpWindow);resetFromTo();}
function updateLatLngOfMarker(){var lat=this.getLatLng().lat();var lng=this.getLatLng().lng();var type=this.value;document.getElementById(type).value=lat+","+lng+","+cityId;getLocationName(lat,lng,type);}
function setDestinationDetails(){var destId=document.getElementById("destinationId").value;var destLat=locationLatMapper[destId];var destLng=locationLngMapper[destId];var destName=locationNameMapper[destId];tempMarker=new GMarker(new GLatLng(destLat,destLng),{draggable:false,icon:custIcon});tempMarker.value="toLocation";infoWindowHtml="This is your To location";map.addOverlay(tempMarker)
tempMarker.bindInfoWindow(infoWindowHtml);document.getElementById(tempMarker.value).value=destLat+","+destLng+","+cityId;var locationId=document.getElementById("toLocationId");locationId.innerHTML=destName;}