var plan_key = ''; var meet_loc_url = '/atlanta/meet-location'; // handy images var img_zipmarker, img_youarehere, img_nomatch, img_expanded, img_unknown; img_youarehere = "/images/zipmarker-youarehere.png"; img_nomatch = "/images/zipmarker-reserved.png"; img_expanded = "/images/zipmarker-viewing.png"; img_zipmarker = "/images/zipmarker.png"; img_unknown = "/images/zipmarker-unknown.png"; img_shadow = "/images/zipshadow.png"; // create a data structure for all the locations var locs = [ [68894725,'17+St%2e%2fMcCaslin',33.791042673899064,-84.40098524093628],[68894597,'18th+St%2fTarget+Store',33.79216613659439,-84.39997673034668],[68891867,'3200+Windy+Hill+Rd%2c+Towers+at+Wildwood+Plaza',33.91366258523751,-84.46106672286987],[68893940,'590+Means+Street',33.773843,-84.406478],[68893260,'Central+Ave%2fMLK+Jr+Blvd',33.75112343705587,-84.39021348953247],[68893349,'Church+St%2fSycamore+St',33.774561,-84.293253],[68890752,'Clairemont+Av%2fCommerce+Dr',33.777025,-84.29649],[68893994,'Commerce+Dr%2fW+Ponce+de+Leon',33.775339,-84.298869],[68891790,'Decatur+St%2e%2fKymball+Way',33.753539,-84.388429],[68890824,'E+College+Av%2fS+Loop',33.770619,-84.29394],[68893932,'Edgewood+Av%2fCourtland+St+',33.75447044421744,-84.38525232745836],[68892971,'Emory%3a++Lowergate+S+Parking+Deck',33.79038285560322,-84.31912422180176],[68893722,'Emory%3a++Michael+St+Deck+',33.79721262049457,-84.32438135147095],[68893122,'Emory%3a++Peavine+2+Parking+Deck+',33.79255845342771,-84.32779312133789],[68890447,'Emory%3a++Starvine+Way%2fClairmont+Deck',33.79630320544215,-84.30809497833252],[68891604,'Emory%3a+1599+Clifton+Road',33.799538,-84.325033],[68890307,'Emory%3a+HR+Complex%2fMaterial+Center',33.801117645892944,-84.3315052986145],[68890487,'Emory%3a+S+Kilgo+Cir++towards+Carlos+Museum',33.78977653160492,-84.32487487792969],[68892384,'GA+Tech%3a+10th+St%2fHolly+St%2e',33.78195171034299,-84.39605085653615],[68893830,'GA+Tech%3a+Ferst+Dr%2fState+St',33.77852309227033,-84.39892530441284],[68892884,'GA+Tech%3a+Spring+St%2f5th+St',33.776935721137164,-84.38853979110718],[68893237,'Juniper+St%2f11th+St',33.78274999328276,-84.3826174736023],[68894632,'Lindbergh+-+Abbey+Road%2fGarson+Drive',33.82183448008265,-84.37048316001892],[68892200,'MARTA+Arts+Center%2f15th+St',33.788655,-84.387787],[68892996,'MARTA+Candler+Park%2fDekalb+Av+',33.762168,-84.339301],[68892066,'MARTA+East+Lake%2fCollege+Ave',33.76544869849223,-84.31284785270691],[68894593,'MARTA+Inman+Park%2fDekalb+Av',33.75779577446539,-84.35311317443847],[68890460,'MARTA+Midtown%2f10th+St',33.78141238894158,-84.38645839691162],[68891018,'Midtown%3a+Spring+St%2f5th+St',33.77697139272168,-84.3885612487793],[68892078,'Moreland+Av%2fMansfield+Av',33.766831,-84.349046],[68894281,'One+Georgia+Center+-+W%2e+Peachtree+St%2e%2fNorth+Ave',33.770942684072246,-84.38806772232056],[68890917,'Oxford+College+',33.61911559313211,-83.87064546346664],[68891168,'Peachtree+Ctr+Av%2fEllis+St',33.758741277597664,-84.38585758209228],[68892544,'Peachtree+St%2f4th+St+',33.774639,-84.384666],[68892465,'Peachtree+St%2f6th+St',33.77706057161795,-84.38409805297851],[68892900,'Peachtree+St%2f7th+St+-+lot',33.77868361130899,-84.3839693069458],[68893929,'Peachtree+St%2f7th+St+-+On+street',33.778326901925674,-84.38459157943725],[68891473,'Peachtree+St%2fEllis+St',33.75872343801245,-84.38731670379638],[68893269,'Peachtree+St%2fNorth+Ave+Bank+of+America+Tower',33.770917,-84.385008],[68893378,'Peachtree+St%2fPeachtree+Pl',33.78078,-84.384069],[68892353,'Piedmont+Rd%2fLindbergh+City+Ctr',33.822336,-84.36737],[68892126,'Ponce+de+Leon+Ave%2fPenn+St',33.77270853320015,-84.37864780426025],[68892959,'Spring+St%2fBaker+St',33.76189882569427,-84.38871145248413],[68892442,'Spring+St%2fW+Peachtree+Pl',33.7637897310132,-84.38924789428711],[68891193,'Trinity+St%2fForsyth+St',33.75058820032838,-84.39486980438232],[68890873,'Virginia+Ave%2fHighland+Ave',33.782747427381295,-84.3544003629774],[68894300,'W+Peachtree+St%2f10th+St',33.7820901110853,-84.38783168792724],[68893715,'W+Peachtree+St%2f5th+St',33.77672169131819,-84.38628673553467],[68891676,'W+Peachtree+St%2fPonce+de+Leon+Av',33.77251232953874,-84.3876600265503],[68892948,'W%2e+Peachtree+St%2e%2f14th+St',33.787502,-84.387796]]; // create a data structure for all the location groups var loc_grps = [ [68890111, 33.791604405246727, -84.40048098564148, 15],[68890109, 33.822085240041325, -84.36892658000946, 15],[68890110, 33.774386, -84.295638, 15],[68890106, 33.75660929423990925, -84.38873728175413125, 15],[68890112, 33.763060868239405, -84.338577006786345, 15],[68890107, 33.79526990178078771428571428571428571429, -84.32297240706961571428571428571428571429, 15],[68890108, 33.777813380937621, -84.3974984880140425, 15],[68890105, 33.77821229000884847058823529411764705882, -84.38568563684441058823529411764705882353, 15],[123536237, 33.61911559313211, -83.87064546346664, 15],[88879569, 33.91366258523751, -84.46106672286987, 15],[88879669, 33.91366258523751, -84.46106672286987, 15],[69261627, 33.782747427381295, -84.3544003629774, 15]]; // even though we have vehicle_id, it is not relevant at this stage since it will just be used for // counting up how many vehicles match said criteria. we will leave it out of the array. // make, model, location, amenity list var vehicles = [ [94563,94567,68891790,['']],[94564,96329386,68894593,['']],[94564,3398752,68893260,['']],[94564,3398752,68892442,['']],[94564,3398752,68892996,[49167247,'']],[94564,3398752,68892353,[49167247,'']],[2968515,1014543,68892959,[49167247,'']],[2968515,1014543,68891473,[49167247,'']],[2968515,9878842,68893929,['']],[94563,33798998,68892971,['']],[94563,68894811,68891018,[49167247,'']],[94563,45910234,68890917,[49167247,'']],[94563,45910234,68891604,[49167247,'']],[94563,45910234,68890917,[49167247,'']],[94563,45910234,68893122,[49167247,'']],[2968515,9878842,68891018,[49167247,'']],[2968515,1014543,68890460,['']],[94563,45910234,68890307,[49167247,'']],[94563,45910234,68890447,[49167247,'']],[94563,45910234,68893940,[49167247,'']],[94563,45910234,68890487,[49167247,'']],[94563,45910234,68893722,[49167247,'']],[94563,45910234,68890824,[49167247,'']],[94563,94567,68890873,['']],[94563,94567,68892996,[49167247,'']],[94563,94567,68892884,[49167247,'']],[94563,94567,68894593,[49167247,'']],[94563,94567,68894725,[49167247,'']],[94563,94567,68892126,[49167247,'']],[94563,94567,68892465,[49167247,'']],[94563,94567,68891867,['']],[94563,94567,68892353,[49167247,'']],[94563,94567,68893830,['']],[94563,33798998,68894300,[49167247,'']],[94563,33798998,68893994,[49167247,'']],[94564,2870368,68892465,['']],[94564,742432,68892384,['']],[94564,742432,68893830,['']],[94564,742432,68893378,['']],[94564,742432,68891193,['']],[94564,3398752,68894281,[49167247,'']],[94564,3398752,68891473,[49167247,'']],[94564,3398752,68893349,[49167247,'']],[94564,3398752,68892544,[49167247,'']],[2190563,6869299,68891676,[49167247,'']],[32061749,68438186,68893932,['']],[32061749,68438186,68893269,['']],[2190563,6869299,68892200,[49167247,'']],[94564,3398752,68892078,[49167247,'']],[2190563,6869299,68894597,[49167247,'']],[5240856,5240857,68893715,[49167247,'']],[5240856,5240857,68892900,[485650,49167247,'']],[5240856,5240857,68893237,[485650,49167247,'']],[2190563,6869299,68894300,[49167247,'']],[2190563,6869299,68892066,[49167247,'']],[2190563,6869299,68892948,[49167247,'']],[2190563,6869299,68894632,[49167247,'']],[2190563,6869299,68890752,[49167247,'']],[2190563,6869299,68892948,[49167247,'']],[2190563,6869299,68891168,[49167247,'']],[2190563,6869299,68893237,[49167247,'']],[2190563,6869299,68892384,[49167247,'']] ]; // local array of makes and models so we can tell which is which var mks_mos = [[2968515,1],[1014543,0],[9878842,0],[94563,1],[94567,0],[45910234,0],[33798998,0],[68894811,0],[2190563,1],[6869299,0],[32061749,1],[68438186,0],[94564,1],[742432,0],[3398752,0],[2870368,0],[96329386,0],[5240856,1],[5240857,0]]; // get a local set of ids for the amenities (we dont really need the description, unless // we want to get really fancy and have the form adjust itself based on selections made // (only show relevant body styles / amenities / neighborhoods based on the chosen make/model) var amenities = [49167247,485650]; // get a local set of ids for the styles so we can easily figure out what styles are needed var styles = [8577467,8577468,8586495,8577469,8577471,8577470,8577472,8577473]; // get a local mapping of locations to location groups. this allows us to trim accordion // results by neighborhood. var lgmap = [[68890873,69261627],[68890460,68890105],[68891018,68890105],[68891676,68890105],[68892126,68890105],[68892200,68890105],[68892465,68890105],[68892544,68890105],[68892884,68890105],[68892900,68890105],[68892948,68890105],[68893237,68890105],[68893269,68890105],[68893378,68890105],[68893715,68890105],[68893929,68890105],[68894281,68890105],[68894300,68890105],[68891168,68890106],[68891193,68890106],[68891473,68890106],[68891790,68890106],[68892442,68890106],[68892959,68890106],[68893260,68890106],[68893932,68890106],[68890307,68890107],[68890447,68890107],[68890487,68890107],[68891604,68890107],[68892971,68890107],[68893122,68890107],[68893722,68890107],[68892384,68890108],[68892884,68890108],[68893830,68890108],[68893940,68890108],[68892353,68890109],[68894632,68890109],[68890752,68890110],[68890824,68890110],[68893349,68890110],[68893994,68890110],[68894597,68890111],[68894725,68890111],[68892066,68890112],[68892078,68890112],[68892996,68890112],[68894593,68890112],[68891867,88879569],[68891867,88879669],[68890917,123536237]]; // get a local mapping of models to styles. this allows us to trim accordion results by style var stylemap = [[94567,8577471],[742432,8577473],[1014543,8577468],[2870368,8577472],[3398752,8586495],[5240857,8577471],[6869299,8577471],[9878842,8577467],[9878842,8577468],[33798998,8577470],[45910234,8577471],[45910234,8586495],[68894811,8577469],[96329386,8577472]]; // globals for finding your local address in the search box var closestaddr = new Object(); var firstaddr = new Object(); var addrstr; // TODO: right now, this just returns the coords for one address, // we should expand this to support multiple address geocoding function refreshCarsByAddress() { var addr = document.getElementById('gmaps-address').value; addrstr = addr; var new_addr; if (addr.match(/[ ]*/) != null && addr != "enter some or all of an address") { geocode(addrstr, function (p) { // see if this address is closer to the current fleet of a modified address is closer if (p) { firstaddr.lat = p.lat(); firstaddr.lng = p.lng(); } else { // this is kinda lame, but at least it is in the ocean firstaddr.lat = 0; firstaddr.lng = 0; } geocode(addrstr + ', Georgia', function (s) { var old_dist, new_dist, e; if (!s && (firstaddr.lat == 0 && firstaddr.lng == 0)) { closestaddr.lat = 0; closestaddr.lng = 0; } else if (!s) { closestaddr.lat = firstaddr.lat; closestaddr.lng = firstaddr.lng; } else if (firstaddr.lat == 0 && firstaddr.lng == 0) { closestaddr.lat = s.lat(); closestaddr.lng = s.lng(); } else { old_dist = Math.sqrt(Math.pow(firstaddr.lat - 33.77752766, 2) + Math.pow(firstaddr.lng - -84.35781206, 2)); new_dist = Math.sqrt(Math.pow(s.lat() - 33.77752766, 2) + Math.pow(s.lng() - -84.35781206, 2)); if (old_dist >= new_dist) { closestaddr.lat = s.lat(); closestaddr.lng = s.lng(); } else { closestaddr.lat = firstaddr.lat; closestaddr.lng = firstaddr.lng; } } if (!(closestaddr.lat == 0 && closestaddr.lng == 0)) { find_loc.in_progress = 1; find_loc.retry = 1; place_home(closestaddr.lat, closestaddr.lng); recenter(eval(find_loc.map), closestaddr.lat, closestaddr.lng, 16, 0); e = document.getElementById('location_group_id'); if (e) { e.selectedIndex = 0; } $('#new-type-filter').hide(); find_loc.in_progress = 0; refreshAccordion(find_loc); } else { alert("sorry, we couldn't find that address"); } }); }); } }