var plan_key = ''; var meet_loc_url = '/toronto/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 = [ [24836727,'1+Spadina+Crescent',43.66003849550415,-79.40107540326396],[198913423,'111+Avenue+Rd',43.67313316881596,-79.39568281173706],[24078710,'129+Harbord+St',43.662143902464436,-79.40533876419067],[185821033,'18+Hillcrest+Ave',43.76797928484096,-79.41128253936768],[24076667,'20+Eglinton+Ave+E',43.706954706491395,-79.39791649740674],[153498033,'202+Howland+Avenue',43.67179842177874,-79.41147565841675],[192165315,'21+Hillcrest+Ave',43.76746792811675,-79.41091775894165],[27781725,'226+Bathurst+St',43.648326891005524,-79.4046632526042],[25569185,'25+The+Esplanade',43.64646460780971,-79.3744178165247],[33117733,'370+Queens+Quay',43.638487890238174,-79.38884317605176],[176073015,'388+Richmond+Street+West',43.648295804454776,-79.39480304718018],[198928397,'44+Jackes%2f33+Rosehill',43.68624625567728,-79.39149856567383],[32676619,'450+Walmer+Rd',43.686351855915596,-79.41325363055408],[196732928,'4K+Spadina+Ave',43.64068730646014,-79.39452409744263],[230138825,'55+Bloor+St+E',43.670605,-79.38495],[24281722,'68+Merton+St',43.69657917745263,-79.39413940279573],[25928976,'720+Broadview+Ave',43.675438270268906,-79.35847551341058],[31731582,'76+Kingston+Rd',43.66925547736751,-79.3117233968653],[26492659,'777+Bay+St',43.65946109936566,-79.38504117576566],[21876260,'78+St+Patrick+St',43.65249030636019,-79.38948804397094],[188209986,'85+Wellesley+St+East',43.665933,-79.379937],[51704016,'90+Sheppard+Ave+East',43.76418274430379,-79.4075059890747],[182700880,'Adelaide+St+W%2fBathurst+St',43.64505066500213,-79.40265655517578],[23510351,'Adelaide+St+W%2fDuncan+St',43.648468,-79.387386],[29248398,'Adelaide+St%2fSherbourne+St',43.65244785352264,-79.36789045749191],[191981294,'Balliol+St%2fPailton+Cres',43.69934096322446,-79.38997507095337],[196620169,'Bay+St%2fAlbert+St',43.65371433072711,-79.38274383544922],[22861956,'Bay+St%2fElm+St',43.65755630669832,-79.38461223228263],[22997812,'Bay+St%2fSt+Joseph+St',43.665334477094405,-79.38777460986834],[98519175,'Bay+St%2fSt%2e+Mary+St',43.66743700647581,-79.38808679580688],[158620713,'Bloor+St+E%2fYonge+St',43.67088270606131,-79.3847393989563],[56404692,'Bloor+St+W%2fGladstone+Ave',43.6601103571893,-79.43340539932251],[40375875,'Bloor+St+W%2fManning+Ave',43.6637117033245,-79.41617488861084],[139905566,'Bloor+St+W%2fPalmerston+Ave',43.664394692875824,-79.41327810287476],[85063472,'Bloor+St+W%2fRobert+St',43.66624183023586,-79.40495252609253],[48592908,'Bloor+St+West%2fIslington+Ave',43.64539226688457,-79.52290534973145],[23078264,'Bloor+St%2fBelair+St',43.669701854745135,-79.3909589497241],[32937140,'Bloor+St%2fKennedy+Ave',43.65117307986339,-79.4748342010553],[23289113,'Bloor+St%2fSpadina+Ave',43.6667605149284,-79.4040919317955],[45045381,'Carlaw+Ave%2fDundas+St+E',43.664860363114755,-79.34062242507935],[177163748,'Carling+Ave%2fBloor+St+W',43.66257854442859,-79.42456483840942],[188204867,'Carlton+St%2e%2fSeaton+St',43.66327706956424,-79.37158584594727],[154313405,'Cecil+St%2fRoss+St',43.65681928303028,-79.3967342376709],[192560246,'Charles+St+W%2fBay+St',43.66794921757952,-79.38918113708496],[59660519,'Church+St%2fWellesley+St',43.665357074054704,-79.3813705444336],[22669609,'Church+St%2fWood+St',43.662407741035054,-79.37951596778272],[156642557,'College+Ave%2fBellevue+Ave',43.65650879502444,-79.40394401550293],[54792512,'College+St%2fCrawford+St',43.65495633091365,-79.41857814788818],[59904621,'College+St%2fPalmerston+Ave',43.65591886339037,-79.40960884094238],[53633607,'Commerce+Court',43.647985272379834,-79.37948226928711],[149690654,'Danforth+Ave%2fBarrington+Ave',43.68902368965472,-79.30013179779053],[30506460,'Davisville+Ave%2fYonge+St',43.69828919646067,-79.39552593119724],[160131620,'Dovercourt+Rd%2fHallam+St',43.666289,-79.431339],[206226815,'Dovercourt+Rd%2fHumbert+St',43.645032,-79.423004],[63424438,'Dundas+St+W%2fBloor+St+W',43.65546864850724,-79.45196628570557],[160145937,'Dundas+St+W%2fCasmir+St',43.65236362636754,-79.40426588058472],[111044957,'Dundas+St+W%2fChestnut+St',43.65375047626206,-79.38516453422633],[141164050,'Dundas+St+W%2fRusholme+Rd',43.649584495409854,-79.42709684371948],[21873082,'Dundas+St%2fBond+St',43.655826853769746,-79.37812943938121],[37146555,'Dundas+St%2fRitchie+Ave',43.65309332100122,-79.44982051849365],[40378318,'Dunfield+Ave%2fEglinton+Ave',43.7060423612745,-79.39465284347534],[63425200,'Dupont+St%2fChristie+St',43.672062269477344,-79.420166015625],[50783315,'East+Liberty+St%2fLyn+Williams+St',43.638932556918824,-79.41686153411865],[44584717,'Eglinton+Ave+W%2fSpadina+Rd',43.70224189182889,-79.41855669021606],[34041669,'Empress+Walk',43.767824328719506,-79.41188335418701],[88411088,'First+Canadian+Place',43.648575281949576,-79.38173532485962],[50056867,'Front+St+E%2fJarvis+St',43.649629,-79.370923],[33988797,'Front+St%2fJohn+St',43.64405696612728,-79.38898355335144],[105313917,'Gowan+Ave%2fPape+Ave',43.687814,-79.351627],[236761387,'Greenwood+Ave%2fStrathmore+Blvd',43.6819169261608,-79.33321952819824],[183140130,'Hayden+St%2fYonge+St',43.670230832122314,-79.38390254974365],[53774821,'High+Park+Ave%2fBloor+St+W',43.65484765692279,-79.46619272232056],[115500545,'Huntley+St%2fIsabella+St',43.668630043368935,-79.37803381673284],[153482033,'Jane+St%2fBloor+St+W',43.64980186224332,-79.4854187965393],[155200935,'King+St+W%2fPeter+St',43.6464791690415,-79.3915843963623],[43288626,'King+St+West%2fAtlantic+Ave',43.63961582831942,-79.4206166267395],[204123585,'King+St+West%2fTecumseth+St+',43.642975,-79.405085],[45038575,'Kingston+Rd%2fSouthwood+Dr',43.67878223452845,-79.29766416549683],[93038299,'Leslie+St%2fEastern+Ave',43.66136774827329,-79.3291425704956],[139325676,'Logan+Ave%2fBusy+St',43.66136774827329,-79.34201717376709],[56949791,'Main+St%2fGerrard+St',43.68491180031955,-79.3012261390686],[87130806,'Marlee+Ave%2fHillmount+Ave',43.707674,-79.443258],[102486012,'Pantages+Hotel+and+Spa',43.65521555183903,-79.37932472248598],[155187798,'Pleasant+Blvd%2fAvoca+Ave',43.688558206897525,-79.39051151275635],[58686108,'Portland+St%2fWellington+St',43.64345132126085,-79.40053224563599],[198905072,'Prince+Arthur+Ave%2fBedford+Rd',43.66922196564002,-79.39913749694824],[48599663,'Queen+St+E%2f+Dalhousie+Ave',43.65351250327059,-79.37508344650269],[156902487,'Queen+St+E%2fSaulter+St',43.65934970041679,-79.34712409973145],[87134254,'Queen+St+East%2fElmer+Ave',43.669532387902265,-79.30384397506714],[63991875,'Queen+St+W%2fAbell+St+',43.64264386941116,-79.4247579574585],[31443279,'Queen+St+W%2fAugusta+Ave',43.64788092868345,-79.39944404469924],[43966602,'Queen+St+W%2fBrock+Ave',43.643094180435085,-79.43263292312622],[56945384,'Queen+St+W%2fTriller+Ave',43.64039226366114,-79.44406986236572],[21858846,'Queen+St%2fPeter+St',43.64940306085535,-79.39347004425707],[27210494,'Queens+Quay+W+btwn+Bay+%26+York',43.64063221121598,-79.37860136402524],[107738093,'Queens+Quay+W%2fLower+Simcoe+St',43.64006616203973,-79.38255071640015],[76175813,'Queens+Quay%2fBishop+Tutu+Blvd',43.63539184430196,-79.39999580383301],[28305428,'Redpath+Ave%2fEglinton+Ave+',43.70840029151386,-79.3932524215827],[22671617,'Richmond+St+E+btwn+Church+%26+Victoria',43.651939061063445,-79.376969665657],[102521519,'Richmond+St+East%2fBerkeley+St',43.654521633770244,-79.36508417129517],[38509771,'Richmond+St+West%2fJohn+St',43.64885475814401,-79.39096212387085],[179976514,'Riverdale+Ave%2fPape+Ave',43.67141040835008,-79.34152364730835],[49462497,'Rogers+Centre',43.64102893315416,-79.39130544662476],[192552527,'Selby+St%2fSherbourne+St',43.67137936716739,-79.37725067138672],[105120476,'Sherbourne+St%2fFront+St',43.6500968588305,-79.36746597290039],[160139698,'Sherbourne+St%2fGerrard+St+E',43.66085548101048,-79.37244415283203],[38517998,'Simcoe+St%2fFront+St+West',43.644802226049315,-79.38544750213623],[93022148,'Spadina+Ave%2fFort+York+Blvd',43.64005063334696,-79.39342975616455],[63426315,'St+Clair+Ave+W%2fBathurst+St',43.683845,-79.41528],[33477795,'Strachan+Ave%2fKing+St',43.64269239999581,-79.41195159277206],[24813216,'Summerhill+Station',43.68248225196318,-79.39045710072186],[112685448,'TD+Centre',43.646898397474864,-79.38250780105591],[108200757,'The+Queensway%2fWindemere+Ave',43.63958477069706,-79.4720721244812],[192576399,'Thorncliff+Park+Dr%2fOverlea+Blvd',43.70655424282877,-79.34356212615967],[34027512,'Walmer+Rd%2fBloor+St',43.6668955903753,-79.40553310171038],[23931444,'Wellesley+St%2fJarvis+St',43.6664790054699,-79.37816117524547],[56926309,'Wellington+St+West%2fSpadina+Ave',43.64379293223794,-79.39484596252441],[50781206,'Wellington+St+West%2fStafford+St%2e',43.64090470549018,-79.41001653671265],[206232554,'Winona+Dr%2fSt+Clair+Ave+W',43.6799926794208,-79.43278312683105],[33118880,'Woodbine+Ave%2fDanforth+Ave',43.68648851633297,-79.31134407621252],[21402094,'Yonge+St%2fAlexander+St',43.66313074107406,-79.38339845863635],[195572691,'Yonge+St%2fBlythwood++Rd',43.7176439364675,-79.40042495727539],[24175712,'Yonge+St%2fBroadway+Ave',43.70953787643225,-79.39838295029628],[31444227,'Yonge+St%2fFinch+Ave+',43.779382953333,-79.41598176956177],[162792077,'Yonge+St%2fLawrence+Ave+W',43.72545977417781,-79.40259218215942],[102483453,'Yonge+St%2fLawton+Blvd',43.69083498836064,-79.39547811987305],[131058123,'Yonge+St%2fMacPherson+Ave',43.67929434880928,-79.39083337783813],[29247753,'Yonge+St%2fSheppard+Ave',43.76035496768287,-79.41031694412231],[103899398,'Yonge+St%2fSoudan+Ave',43.704708346381636,-79.39767837524414],[63427354,'Yonge+St%2fYonge+Blvd',43.734685492403834,-79.40441608428955],[66814231,'York+University+-+Keele+Campus',43.76979224163757,-79.50187683105469]]; // create a data structure for all the location groups var loc_grps = [ [29017673, 43.648159927322226, -79.484284638825562, 15],[21955862, 43.66940928286180675, -79.38815953161516125, 15],[56405749, 43.66299263387263, -79.42976974591064333333333333333333333333, 15],[21405396, 43.666081431158056, -79.380680280510755, 15],[20919495, 43.65550558666090591666666666666666666667, -79.38066442454174666666666666666666666667, 15],[26626559, 43.64781965060142466666666666666666666667, -79.38124179840088, 15],[27100678, 43.638644526948961, -79.38749776507754, 15],[63977131, 43.72592973434971466666666666666666666667, -79.40247774124145333333333333333333333333, 15],[29499673, 43.663671193685641, -79.340085983276368, 15],[43294274, 43.639274192619122, -79.418739080429075, 15],[54796251, 43.65543759715201, -79.41409349441528, 15],[105329140, 43.649584495409854, -79.42709684371948, 15],[29017675, 43.76786536783281266666666666666666666667, -79.41131472587585333333333333333333333333, 15],[21864501, 43.6462333121525275, -79.40341942260750611111111111111111111111, 15],[37417371, 43.64965141105653333333333333333333333333, -79.44861888885498, 15],[22718565, 43.6506319907866188, -79.369156283642434, 15],[20919647, 43.66702565456671377777777777777777777778, -79.40890538736274111111111111111111111111, 15],[31731863, 43.67562047502944375, -79.3036144191244675, 15],[23535315, 43.68787260754102766666666666666666666667, -79.33306000696192333333333333333333333333, 15],[43341661, 43.642125213027571, -79.390738071143922, 15],[21405405, 43.661092313116335, -79.398724039620326, 15],[24137331, 43.69590154107311536842105263157894736842, -79.40216378908737315789473684210526315789, 15],[66816733, 43.76979224163757, -79.50187683105469, 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 = [ [2190563,6869299,191981294,['']],[2190563,6869299,23078264,['']],[2190563,9876627,21402094,['']],[2190563,9876627,37146555,['']],[94564,742432,21876260,['']],[94564,742432,48592908,['']],[94562,5107542,21876260,['']],[94562,5107542,22671617,['']],[94564,742432,54792512,['']],[94564,2870368,25928976,['']],[94564,2870368,34027512,['']],[94563,33798998,156642557,['']],[94563,33798998,21402094,['']],[2190563,9876627,23289113,['']],[2968515,1014543,33988797,[485650,'']],[94564,742432,24281722,['']],[94564,742432,105313917,['']],[2190563,18381550,23510351,['']],[2190563,18381550,176073015,['']],[94564,742432,154313405,['']],[94564,742432,45038575,['']],[94562,5107542,176073015,['']],[94562,5107542,25928976,['']],[2190563,6869299,24078710,['']],[94563,33798998,177163748,['']],[94563,33798998,24836727,['']],[94564,742432,24813216,['']],[94564,742432,50056867,['']],[2190563,6869299,33118880,['']],[94564,2870368,22669609,['']],[94564,742432,58686108,['']],[94564,742432,105120476,['']],[94564,742432,45045381,['']],[94563,23642479,40378318,[49167247,'']],[94563,23642479,98519175,[49167247,'']],[94563,23642479,63425200,[49167247,'']],[94563,23642479,160145937,['']],[5240856,5240857,139905566,['']],[5240856,5240857,26492659,['']],[94563,94567,25928976,['']],[94563,94567,43966602,['']],[94562,5107542,50056867,['']],[94562,5107542,30506460,['']],[94563,23642479,63991875,[49167247,'']],[94563,33798998,31443279,['']],[94563,33798998,155187798,['']],[94564,742432,206226815,['']],[94564,742432,27781725,['']],[94562,5107542,24175712,['']],[94562,5107542,56926309,['']],[2190563,9876627,43288626,['']],[2190563,9876627,22669609,[49167247,'']],[94563,23642479,177163748,[49167247,'']],[2190563,6869299,153482033,[49167247,'']],[94563,33798998,22861956,['']],[94563,94567,155200935,['']],[94563,94567,139325676,[49167247,'']],[94563,94567,23510351,['']],[94563,94567,21858846,['']],[94563,94567,112685448,['']],[94565,94569,158620713,['']],[94565,94569,196620169,['']],[94565,94569,43288626,['']],[94565,94569,40375875,['']],[94565,18942988,31731582,['']],[94565,18942988,33988797,['']],[94565,18942988,98519175,['']],[94565,18942988,156902487,['']],[2968515,1014543,45045381,[485650,'']],[2968515,1014543,102483453,[485650,'']],[2968515,1014543,34041669,[485650,'']],[94563,94567,153498033,[49167247,'']],[94563,94567,53774821,[49167247,'']],[94563,94567,149690654,[49167247,'']],[2190563,6869299,48592908,[49167247,'']],[94563,94567,25569185,[49167247,'']],[94563,94567,76175813,['']],[2968515,1014543,27210494,[485650,'']],[94563,33798998,33477795,['']],[94563,94567,33117733,[49167247,'']],[2190563,6869299,49462497,[49167247,'']],[94563,94567,108200757,[49167247,'']],[94564,742432,33118880,['']],[2190563,6869299,43966602,[49167247,'']],[2968515,1014543,54792512,['']],[2968515,1014543,29247753,['']],[2968515,1014543,51704016,['']],[94563,33798998,85063472,['']],[94563,94567,192552527,['']],[94563,23642479,29247753,[49167247,'']],[3140121,40936713,88411088,[49167247,'']],[94562,21185113,25928976,['']],[94563,23642479,23289113,[49167247,'']],[94564,2870368,27781725,['']],[94564,742432,25928976,['']],[94564,742432,155187798,['']],[94564,742432,49462497,['']],[94563,94567,160139698,[49167247,'']],[94563,94567,33118880,[49167247,'']],[94565,18942988,56404692,['']],[94565,18942988,50783315,['']],[94565,18942988,48599663,['']],[2190563,6869299,102483453,['']],[2190563,6869299,24175712,[49167247,'']],[2190563,9876627,87130806,['']],[2190563,9876627,131058123,['']],[94564,742432,158620713,['']],[94564,742432,24078710,['']],[2968515,1014543,28305428,[485650,49167247,'']],[2968515,1014543,22997812,[485650,'']],[2968515,1014543,24813216,['']],[2968515,1014543,160145937,[485650,'']],[2968515,1014543,58686108,[49167247,'']],[2190563,9876627,40375875,[49167247,'']],[2190563,9876627,31444227,[49167247,'']],[2190563,6869299,33988797,[49167247,'']],[2190563,6869299,50781206,[49167247,'']],[2190563,6869299,22861956,[49167247,'']],[3140121,40936713,29248398,[49167247,'']],[2190563,6869299,88411088,['']],[2190563,6869299,31443279,['']],[2190563,6869299,107738093,['']],[2190563,9876627,53633607,[49167247,'']],[2190563,9876627,23931444,[49167247,'']],[2190563,9876627,139325676,[49167247,'']],[94565,94569,22671617,['']],[94565,94569,22861956,['']],[94565,18942988,56949791,['']],[94565,18942988,102521519,['']],[2968515,1014543,32676619,[485650,49167247,'']],[2968515,1014543,102486012,[485650,'']],[2968515,1014543,53774821,[485650,49167247,'']],[2190563,6869299,188204867,['']],[2190563,6869299,22997812,['']],[2190563,9876627,59904621,[49167247,'']],[2190563,9876627,29247753,['']],[94563,94567,56945384,[49167247,'']],[94563,94567,162792077,['']],[94563,94567,56949791,[49167247,'']],[94563,94567,56926309,['']],[94563,94567,59904621,[49167247,'']],[94563,94567,115500545,[49167247,'']],[94563,94567,51704016,[49167247,'']],[94564,742432,21402094,['']],[94564,742432,59660519,['']],[3140121,40936713,192560246,['']],[94565,18942988,37146555,['']],[94565,18942988,34027512,['']],[94565,18942988,21858846,['']],[94565,18942988,22669609,['']],[94565,18942988,24281722,['']],[94563,23642479,107738093,['']],[2968515,1014543,33117733,[485650,'']],[2968515,1014543,30506460,[485650,'']],[2968515,1014543,93022148,[49167247,'']],[94563,94567,45038575,[49167247,'']],[94563,94567,154313405,[49167247,'']],[2190563,6869299,63426315,['']],[2190563,6869299,33477795,['']],[2190563,6869299,59660519,['']],[94563,94567,63427354,['']],[94563,94567,63424438,['']],[94563,94567,63426315,['']],[94564,742432,179976514,['']],[41073642,41073737,155200935,['']],[94563,94567,58686108,['']],[81064847,81065198,22669609,[49167247,'']],[3140121,40936713,22669609,['']],[2190563,6869299,87134254,['']],[2190563,6869299,160131620,[49167247,'']],[2190563,6869299,198905072,['']],[2190563,6869299,149690654,[49167247,'']],[2190563,6869299,31731582,[49167247,'']],[2190563,6869299,185821033,[49167247,'']],[29744489,54807456,23078264,[49167247,'']],[29744489,54807456,162792077,[49167247,'']],[29744489,54807456,23931444,[49167247,'']],[94563,94567,105313917,[49167247,'']],[94563,94567,93038299,[49167247,'']],[94563,94567,48599663,[49167247,'']],[94563,94567,27210494,[49167247,'']],[94563,94567,188209986,[49167247,'']],[94563,94567,87130806,[49167247,'']],[94565,18942988,115500545,[49167247,'']],[94565,18942988,23931444,[49167247,'']],[94565,18942988,93038299,[49167247,'']],[94565,18942988,45045381,[49167247,'']],[94565,18942988,160131620,[49167247,'']],[2968515,1014543,50783315,[485650,49167247,'']],[2968515,1014543,21873082,[485650,49167247,'']],[94563,45910234,102486012,[49167247,'']],[94563,94567,87134254,[49167247,'']],[94563,94567,102521519,[49167247,'']],[94563,94567,30506460,[49167247,'']],[94563,94567,230138825,[49167247,'']],[94563,33798998,141164050,['']],[94565,94569,156642557,[49167247,'']],[94565,94569,141164050,[49167247,'']],[94565,94569,153482033,[49167247,'']],[94565,94569,105120476,[49167247,'']],[94565,18942988,56945384,[49167247,'']],[94565,18942988,153498033,[49167247,'']],[94565,18942988,32937140,[49167247,'']],[94565,18942988,29248398,[49167247,'']],[41073642,41073737,230138825,['']],[32061749,32062060,87134254,[49167247,'']],[32061749,32062060,23931444,[49167247,'']],[32061749,32062060,112685448,[49167247,'']],[32061749,32062060,103899398,[49167247,'']],[29744489,54807456,111044957,[49167247,'']],[29744489,54807456,27781725,[49167247,'']],[94565,94569,59660519,[49167247,'']],[94565,94569,44584717,[49167247,'']],[94563,94567,111044957,[49167247,'']],[94563,94567,32937140,[49167247,'']],[94563,94567,183140130,[49167247,'']],[94564,742432,160139698,[49167247,'']],[94564,742432,48599663,[49167247,'']],[94564,742432,139905566,[49167247,'']],[94562,5107542,32937140,[49167247,'']],[94563,64790058,38517998,[49167247,'']],[94563,64790058,34027512,[49167247,'']],[94563,64790058,25569185,[49167247,'']],[94563,64790058,40378318,[49167247,'']],[94563,64790058,158620713,[49167247,'']],[41073642,41073737,53633607,[49167247,'']],[94563,94567,179976514,[49167247,'']],[94563,94567,56404692,[49167247,'']],[94563,94567,196732928,[49167247,'']],[94563,94567,182700880,[49167247,'']],[94564,2870368,29247753,[49167247,'']],[94564,2870368,29248398,[49167247,'']],[94564,2870368,24076667,[49167247,'']],[94564,742432,182700880,[49167247,'']],[94564,742432,183140130,[49167247,'']],[94564,742432,21873082,[49167247,'']],[94564,742432,50781206,[49167247,'']],[94564,742432,176073015,[49167247,'']],[94564,742432,192552527,[49167247,'']],[94564,742432,188209986,[49167247,'']],[94564,742432,191981294,[49167247,'']],[94564,742432,192165315,[49167247,'']],[94564,742432,192576399,[49167247,'']],[94564,742432,107738093,[49167247,'']],[94564,742432,25569185,[49167247,'']],[2190563,6869299,26492659,[49167247,'']],[94565,18942988,198905072,[49167247,'']],[94564,742432,195572691,[49167247,'']],[94564,742432,196732928,[49167247,'']],[94564,742432,28305428,[49167247,'']],[94564,742432,66814231,[49167247,'']],[94564,742432,236761387,[49167247,'']],[94563,94567,192576399,[49167247,'']],[94563,94567,38517998,[49167247,'']],[94563,94567,196620169,[49167247,'']],[94563,94567,204123585,[49167247,'']],[2190563,6869299,198913423,[49167247,'']],[2190563,6869299,198928397,[49167247,'']],[2190563,6869299,204123585,[49167247,'']],[2190563,6869299,236761387,[49167247,'']],[2190563,6869299,195572691,[49167247,'']],[94563,94567,198913423,[49167247,'']],[94563,94567,198928397,[49167247,'']],[94563,94567,206232554,[49167247,'']],[94563,94567,31444227,[49167247,'']],[94563,94567,206226815,[49167247,'']],[94563,94567,38509771,[49167247,'']],[94563,94567,63425200,[49167247,'']] ]; // local array of makes and models so we can tell which is which var mks_mos = [[41073642,1],[41073737,0],[3140121,1],[40936713,0],[2968515,1],[1014543,0],[94562,1],[5107542,0],[21185113,0],[81064847,1],[81065198,0],[94563,1],[94567,0],[45910234,0],[64790058,0],[33798998,0],[23642479,0],[2190563,1],[6869299,0],[9876627,0],[18381550,0],[29744489,1],[54807456,0],[32061749,1],[32062060,0],[94564,1],[742432,0],[2870368,0],[94565,1],[94569,0],[18942988,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,142802904,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 = [[21873082,20919495],[21876260,20919495],[22671617,20919495],[22861956,20919495],[23510351,20919495],[26492659,20919495],[48599663,20919495],[102486012,20919495],[111044957,20919495],[160139698,20919495],[188204867,20919495],[196620169,20919495],[23289113,20919647],[24078710,20919647],[34027512,20919647],[40375875,20919647],[63425200,20919647],[85063472,20919647],[139905566,20919647],[153498033,20919647],[198905072,20919647],[21402094,21405396],[22669609,21405396],[22997812,21405396],[23931444,21405396],[59660519,21405396],[115500545,21405396],[188209986,21405396],[192552527,21405396],[22997812,21405405],[23289113,21405405],[24836727,21405405],[154313405,21405405],[156642557,21405405],[21858846,21864501],[21876260,21864501],[23510351,21864501],[27781725,21864501],[31443279,21864501],[33477795,21864501],[38509771,21864501],[43966602,21864501],[50781206,21864501],[56926309,21864501],[58686108,21864501],[63991875,21864501],[155200935,21864501],[160145937,21864501],[176073015,21864501],[182700880,21864501],[204123585,21864501],[206226815,21864501],[22997812,21955862],[23078264,21955862],[98519175,21955862],[158620713,21955862],[183140130,21955862],[192560246,21955862],[198913423,21955862],[230138825,21955862],[25569185,22718565],[29248398,22718565],[50056867,22718565],[102521519,22718565],[105120476,22718565],[25928976,23535315],[33118880,23535315],[105313917,23535315],[149690654,23535315],[192576399,23535315],[236761387,23535315],[24076667,24137331],[24175712,24137331],[24281722,24137331],[24813216,24137331],[28305428,24137331],[30506460,24137331],[32676619,24137331],[40378318,24137331],[44584717,24137331],[63426315,24137331],[87130806,24137331],[102483453,24137331],[103899398,24137331],[131058123,24137331],[155187798,24137331],[191981294,24137331],[198928397,24137331],[206232554,24137331],[53633607,26626559],[88411088,26626559],[112685448,26626559],[27210494,27100678],[33117733,27100678],[76175813,27100678],[107738093,27100678],[32937140,29017673],[48592908,29017673],[53774821,29017673],[108200757,29017673],[153482033,29017673],[29247753,29017675],[31444227,29017675],[34041669,29017675],[51704016,29017675],[185821033,29017675],[192165315,29017675],[45045381,29499673],[93038299,29499673],[139325676,29499673],[156902487,29499673],[179976514,29499673],[31731582,31731863],[45038575,31731863],[56949791,31731863],[87134254,31731863],[43288626,43294274],[50783315,43294274],[33988797,43341661],[38517998,43341661],[49462497,43341661],[93022148,43341661],[196732928,43341661],[54792512,54796251],[59904621,54796251],[56404692,56405749],[160131620,56405749],[177163748,56405749],[63427354,63977131],[162792077,63977131],[195572691,63977131],[66814231,66816733],[141164050,105329140],[37146555,37417371],[56945384,37417371],[63424438,37417371]]; // get a local mapping of models to styles. this allows us to trim accordion results by style var stylemap = [[94567,8577471],[94569,142802904],[742432,8577473],[1014543,8577468],[2870368,8577472],[5107542,8577470],[5240857,8577471],[6869299,8577471],[9876627,142802904],[18381550,8577469],[18942988,8577471],[21185113,8577467],[32062060,8577470],[32062060,8577473],[33798998,8577470],[40936713,8577471],[45910234,8577471],[45910234,8586495],[54807456,8577471],[64790058,8577470],[81065198,8577468]]; // 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 + ', Ontario', 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 - 43.67043209, 2) + Math.pow(firstaddr.lng - -79.39448176, 2)); new_dist = Math.sqrt(Math.pow(s.lat() - 43.67043209, 2) + Math.pow(s.lng() - -79.39448176, 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"); } }); }); } }