// JavaScript Document var addressList=new Array(); var cityList=new Array(); var infoUrlList=new Array(); var appUrlList=new Array(); var phoneNumList=new Array(); var latList=new Array(); var lngList=new Array(); var endpointAddress =""; cityList[0] = 'Arnold'; infoUrlList[0] = 'centerInfo.php?selectedLocation=0'; appUrlList[0] = 'apptScheduling.php?selectedLocation=0'; phoneNumList[0] = '(636) 333-0331'; latList[0] = '38.403061'; lngList[0] = '-90.385002'; cityList[1] = 'Ballwin'; infoUrlList[1] = 'centerInfo.php?selectedLocation=1'; appUrlList[1] = 'apptScheduling.php?selectedLocation=1'; phoneNumList[1] = '(636) 552-4166'; latList[1] = '38.592778'; lngList[1] = '-90.566477'; cityList[2] = 'Brentwood'; infoUrlList[2] = 'http://stlaamco.com/centerInfo.php?selectedLocation=Brentwood'; appUrlList[2] = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Brentwood'; phoneNumList[2] = '(314) 962-3511'; latList[2] = '38.612259'; lngList[2] = '-90.342962'; cityList[3] = 'Crestwood'; infoUrlList[3] = 'http://stlaamco.com/centerInfo.php?selectedLocation=Crestwood'; appUrlList[3] = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Crestwood'; phoneNumList[3] = '(314) 843-1122'; latList[3] = '38.56424050793188'; lngList[3] = '-90.36257028579712'; cityList[4] = 'Florissant'; infoUrlList[4] = 'centerInfo.php?selectedLocation=Florissant'; appUrlList[4] = 'apptScheduling.php?selectedLocation=Florissant'; phoneNumList[4] = '(314) 831-0389'; latList[4] = '38.798072'; lngList[4] = '-90.323835'; cityList[5] = 'Maryland Heights/ Westport'; infoUrlList[5] = 'centerInfo.php?selectedLocation=4'; appUrlList[5] = 'apptScheduling.php?selectedLocation=4'; phoneNumList[5] = '(314) 266-4130'; latList[5] = '38.706816'; lngList[5] = '-90.407431'; cityList[6] = 'Oakville'; infoUrlList[6] = 'centerInfo.php?selectedLocation=5'; appUrlList[6] = 'apptScheduling.php?selectedLocation=5'; phoneNumList[6] = '(314) 329-3676'; latList[6] = '38.5040495551095'; lngList[6] = '-90.2970600128174'; cityList[7] = 'St. Charles/St. Peters'; infoUrlList[7] = 'centerInfo.php?selectedLocation=6'; appUrlList[7] = 'apptScheduling.php?selectedLocation=6'; phoneNumList[7] = '(636) 442-1164'; latList[7] = '38.747356'; lngList[7] = '-90.578345'; cityList[8] = 'Washington'; infoUrlList[8] = 'centerInfo.php?selectedLocation=Washington'; appUrlList[8] = 'apptScheduling.php?selectedLocation=Washington'; phoneNumList[8] = '(636) 239-1059'; latList[8] = '38.535363'; lngList[8] = '-90.976298'; cityList[9] = 'Wentzville'; infoUrlList[9] = 'http://stlaamco.com/centerInfo.php?selectedLocation=Wentzville'; appUrlList[9] = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Wentzville'; phoneNumList[9] = '(636) 327-8282'; latList[9] = '38.80941638665177'; lngList[9] = '-90.87667465209961'; cityList[10] = 'Fairview Heights'; infoUrlList[10] = 'centerInfo.php?selectedLocation=8'; appUrlList[10] = 'apptScheduling.php?selectedLocation=8'; phoneNumList[10] = '(618) 509-9104'; latList[10] = '38.583366'; lngList[10] = '-89.984846'; function createWindowHtml(latandlog) { var city; var infoUrl; var appUrl; var phoneNum; switch(latandlog) { case '(38.403061, -90.385002)': city = 'Arnold'; infoUrl = 'centerInfo.php?selectedLocation=0'; appUrl = 'apptScheduling.php?selectedLocation=0'; phoneNum = '(636) 333-0331'; break; case '(38.592778, -90.566477)': city = 'Ballwin'; infoUrl = 'centerInfo.php?selectedLocation=1'; appUrl = 'apptScheduling.php?selectedLocation=1'; phoneNum = '(636) 552-4166'; break; case '(38.612259, -90.342962)': city = 'Brentwood'; infoUrl = 'http://stlaamco.com/centerInfo.php?selectedLocation=Brentwood'; appUrl = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Brentwood'; phoneNum = '(314) 962-3511'; break; case '(38.56424050793188, -90.36257028579712)': city = 'Crestwood'; infoUrl = 'http://stlaamco.com/centerInfo.php?selectedLocation=Crestwood'; appUrl = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Crestwood'; phoneNum = '(314) 843-1122'; break; case '(38.798072, -90.323835)': city = 'Florissant'; infoUrl = 'centerInfo.php?selectedLocation=Florissant'; appUrl = 'apptScheduling.php?selectedLocation=Florissant'; phoneNum = '(314) 831-0389'; break; case '(38.706816, -90.407431)': city = 'Maryland Heights/ Westport'; infoUrl = 'centerInfo.php?selectedLocation=4'; appUrl = 'apptScheduling.php?selectedLocation=4'; phoneNum = '(314) 266-4130'; break; case '(38.5040495551095, -90.2970600128174)': city = 'Oakville'; infoUrl = 'centerInfo.php?selectedLocation=5'; appUrl = 'apptScheduling.php?selectedLocation=5'; phoneNum = '(314) 329-3676'; break; case '(38.747356, -90.578345)': city = 'St. Charles/St. Peters'; infoUrl = 'centerInfo.php?selectedLocation=6'; appUrl = 'apptScheduling.php?selectedLocation=6'; phoneNum = '(636) 442-1164'; break; case '(38.535363, -90.976298)': city = 'Washington'; infoUrl = 'centerInfo.php?selectedLocation=Washington'; appUrl = 'apptScheduling.php?selectedLocation=Washington'; phoneNum = '(636) 239-1059'; break; case '(38.80941638665177, -90.87667465209961)': city = 'Wentzville'; infoUrl = 'http://stlaamco.com/centerInfo.php?selectedLocation=Wentzville'; appUrl = 'http://stlaamco.com/apptScheduling.php?selectedLocation=Wentzville'; phoneNum = '(636) 327-8282'; break; case '(38.583366, -89.984846)': city = 'Fairview Heights'; infoUrl = 'centerInfo.php?selectedLocation=8'; appUrl = 'apptScheduling.php?selectedLocation=8'; phoneNum = '(618) 509-9104'; break; default: ; } var message ="
AAMCO of "+city+"
"+phoneNum+"
Click Here to schedule an appointment
Click Here for additional center information


All fields required
Street Address
Zip Code
"; return message; } function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById('map')); var stlouisMO = new GLatLng(38.646991,-90.224967); map.setCenter(stlouisMO, 7);//was 9 map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. var baseIcon = new GIcon(G_DEFAULT_ICON); baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png"; baseIcon.image ="images/aamcoLogo.png"; baseIcon.iconSize = new GSize(32,24); var markerOptions = {icon:baseIcon}; // Creates a marker whose info window displays the letter corresponding // to the given index. function createMarker(point) { var marker = new GMarker(point, markerOptions); var msg =createWindowHtml(point.toString()); GEvent.addListener(marker, "click", function() { map.panTo(marker.getLatLng()); marker.openInfoWindowHtml(msg); gatherEndPoint(marker.getLatLng().toString()); //alert(marker.getLatLng()); }); return marker; } // Add 10 markers to the map at random locations var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); /*for (var i = 0; i < 10; i++) { var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(createMarker(latlng, i)); }*/ /*for (var i = 0; i < 8; i++) { //var point = new GLatLng(latList[i],lngList[i]); //marker = new GMarker(point,markerOptions); //map.addOverlay(createMarker(point)); }*/ for (var i = 0; i < 11; i++) { //was 9 var point = new GLatLng(latList[i],lngList[i]); marker = new GMarker(point,markerOptions); map.addOverlay(createMarker(point)); } } } var mapModal; var directionsPanel; var directions; function gatherEndPoint(endpoint) { //alert(endpoint) switch(endpoint) { case '(38.403061, -90.385002)': endpointAddress = '3875 W Outer Road Arnold, MO 63010'; break;case '(38.592778, -90.566477)': endpointAddress = '15475 Manchester Road, Ballwin, MO 63011'; break;case '(38.612259, -90.342962)': endpointAddress = '8500 Manchester Blvd Brentwood, MO 63144'; break;case '(38.56424050793188, -90.36257028579712)': endpointAddress = '8744 Watson Road, Crestwood, MO 63119'; break;case '(38.798072, -90.323835)': endpointAddress = '1180 N. Highway 67 Florissant, MO 63031'; break;case '(38.706816, -90.407431)': endpointAddress = '11323 Midland Blvd., St. Louis, MO 63114'; break;case '(38.5040495551095, -90.2970600128174)': endpointAddress = '2904 Telegraph Road, St. Louis, MO 63125'; break;case '(38.747356, -90.578345)': endpointAddress = '3625 Harvester Road, Saint Charles, MO 63303'; break;case '(38.535363, -90.976298)': endpointAddress = '5222-B Hwy 100, Washington, MO 63090'; break;case '(38.80941638665177, -90.87667465209961)': endpointAddress = '1488 S Service Rd E Wentzville, MO 63385'; break;case '(38.583366, -89.984846)': endpointAddress = '5609 N. Illinois St., Fairview Heights, IL 62208'; break;default: } } function gatherDirections() { cleanUpWindow(); if((document.getElementById("enterAddress").value=="")&&(document.getElementById("enterAddress_3").value=="")){$("#my_textual_div").html("You entered an incorrect or incomplete address.

Please re-enter your full starting address
")}else{$("#my_textual_div").html("")} $('#map_Modal').show(); //alert(document.getElementById("enterAddress").value); mapModal = new GMap2(document.getElementById("map_canvas")); mapModal.addControl(new GSmallMapControl()); mapModal.addControl(new GMapTypeControl()); directionsPanel = document.getElementById("my_textual_div"); mapModal.setCenter(new GLatLng(38.646991,-90.224967), 7);//was 9 directions = new GDirections(mapModal, directionsPanel); var realaddress= document.getElementById("enterAddress").value+" "+document.getElementById("enterAddress_3").value; //alert(realaddress); directions.load("from: "+realaddress+" to: "+endpointAddress+""); //if(($("#my_textual_div").html()=="")&&(document.getElementById("enterAddress").value!="")) //{$("#my_textual_div").html("unrecognized address.

Please re-enter your full starting address
")} } function cleanUpWindow() { $("#my_textual_div").html(""); $('#map_Modal').hide(); }