﻿var mapContainerID="ctl00_Content_ctrlGoogleMap_mapContainer";var map;var ew;var gmarkers=[];function body_onload(){if(GBrowserIsCompatible()){GMapInit(mapContainerID);BuildMap();}}function body_onunload(){GUnload();}function GMapInit(containerObjID){var container=document.getElementById(containerObjID);var width=document.getElementById(containerObjID).style.width.replace("px","");var height=document.getElementById(containerObjID).style.height.replace("px","");map=new GMap2(container,{size:new GSize(width,height)});map.addControl(new GMapTypeControl());map.addControl(new GSmallMapControl());map.enableDoubleClickZoom();map.enableContinuousZoom();GEvent.addDomListener(container,"DOMMouseScroll",wheelZoom);GEvent.addDomListener(container,"mousewheel",wheelZoom);}function showAddress(name,address,lat,lng){if(GBrowserIsCompatible()){var geocoder=new GClientGeocoder();geocoder.getLatLng(address,function(point){if(!point){if(lat!=0&& lng!=0){point=new GLatLng(lat,lng);}}p=point.lat();map.setCenter(point,13);var icon=new GIcon();icon.image="http://dev.lutherauto.com/images/car.png";icon.shadow="http://dev.lutherauto.com/images/cars.png";icon.iconSize=new GSize(50,25);icon.shadowSize=new GSize(55,25);icon.iconAnchor=new GPoint(10,11);icon.infoWindowAnchor=new GPoint(1,1);var marker=new GMarker(point,icon);GEvent.addListener(marker,"click",function(){infoWindow(name,address,map,point);});map.addOverlay(marker);infoWindow(name,address,map,point);gmarkers[1]=marker;});}}function infoWindow(name,address,map,point){var html=""+"<div style='text-align:left;font-size:9pt;line-height:14pt;'>"+"<strong>"+name+"</strong><br/>"+address+"<form action='http://maps.google.com/maps' method='get' target='_blank'>"+"Driving directions<br/>"+"<input type='text' size='30' maxlength='75' name='saddr' id='saddr'/> "+"<input type='submit' value='Go' />"+"<input type='hidden' name='daddr' value='"+address+"' /></form>"+"Enter your starting address and press [Go]"+"</div>";map.openInfoWindowHtml(point,html);}function wheelZoom(evt){if((evt.detail||-evt.wheelDelta)<0){map.zoomIn();if(evt.stopPropagation){evt.stopPropagation();evt.preventDefault();}else if(evt.cancelBubble){evt.cancelBubble=true;evt.returnValue=false;}}else{map.zoomOut();if(evt.stopPropagation){evt.stopPropagation();evt.preventDefault();}else if(evt.cancelBubble){evt.cancelBubble=true;evt.returnValue=false;}}}