//Created by Cory Gagliardi. Copyright 2006 Sullivan
var map,mapmgr,markerOvs,mappable,communities,commLinks,icon;function loadCommDom(){var cityLocs=new Array(new GLatLng(26.342611,-81.779031),new GLatLng(26.430061,-81.810589),new GLatLng(26.225081,-81.800300),new GLatLng(26.138989,-81.795769));var selectors=$$('h4.toggler');var elements=$$('div.element');var showThis;var i=0;selectors.each(function(sel){sel.myIndex=i;++i;});function checkHash(){var found=false;$$('h4.toggler a').each(function(link,i){if(window.location.hash==link.hash||inCity==link.hash){showThis=i;found=true;}});return found;}
if(!checkHash())showThis=0;var prices=[['100,000','100000'],['125,000','125000'],['150,000','150000'],['175,000','175000'],['200,000','200000'],['225,000','225000'],['250,000','250000'],['275,000','275000'],['300,000','300000'],['325,000','325000'],['350,000','350000'],['375,000','375000'],['400,000','400000'],['425,000','425000'],['450,000','450000'],['475,000','475000'],['500,000','500000'],['525,000','525000'],['550,000','550000'],['575,000','575000'],['600,000','600000'],['625,000','625000'],['650,000','650000'],['675,000','675000'],['700,000','700000'],['725,000','725000'],['750,000','750000'],['775,000','775000'],['800,000','800000'],['825,000','825000'],['850,000','850000'],['875,000','875000'],['900,000','900000'],['925,000','925000'],['950,000','950000'],['975,000','975000'],['1,000,000','1000000'],['1,200,000','1200000'],['1,400,000','1400000'],['1,600,000','1600000'],['1,800,000','1800000'],['2,000,000','2000000'],['2,200,000','2200000'],['2,400,000','2400000'],['2,600,000','2600000'],['2,800,000','2800000'],['3,000,000','3000000'],['3,200,000','3200000'],['3,400,000','3400000'],['3,600,000','3600000'],['3,800,000','3800000'],['4,000,000','4000000'],['4,200,000','4200000'],['4,400,000','4400000'],['4,600,000','4600000'],['4,800,000','4800000'],['5,000,000','5000000']];var completers=['minprice','maxprice'];completers.each(function(completer){new Autocompleter.Local($(completer),prices,{'delay':60,'filterTokens':function(){var regex=new RegExp('^'+this.queryValue.escapeRegExp(),'i');return this.tokens.filter(function(token){return(regex.test(token[0])||regex.test(token[1]));});},'injectChoice':function(choice){var el=new Element('li').setHTML(this.markQueryValue(choice[0]));el.inputValue=choice[0];this.addChoiceEvents(el).injectInside(this.choices);},'minLength':1});});map=new GMap2(document.getElementById("map"));map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());if(cityLocs[showThis])map.setCenter(cityLocs[showThis],12);else map.setCenter(cityLocs[0],12);if(window.ie)
$$('.featc .element').each(function(el){el.setStyle('opacity',0);});var s=selectors[showThis].getFirst();s.setText(s.getText().substring(0,s.getText().length-31));var accordion=new Accordion(selectors,elements,{show:showThis,transition:Fx.Transitions.quadOut,duration:600,opacity:false,onActive:function(toggler,element){;element.style.border='#ccd4e4 solid 1px';element.style.borderTop='none';map.closeInfoWindow();if(cityLocs[toggler.myIndex])
(function(){map.panTo(cityLocs[toggler.myIndex])}).delay(600);if(window.ie)element.setStyle('opacity',1);},onBackground:function(toggler,element){element.style.border='none';if(!firstToggleRan){firstToggleRan=true;$$('.toggler a').each(function(el){text=el.getText();if((num=text.indexOf('(click'))!=-1)
el.setText(text.substr(0,num));});}
if(window.ie)element.setStyle('opacity',0);}});icon=new GIcon();icon.image="http://labs.google.com/ridefinder/images/mm_20_red.png";icon.shadow="http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon.iconSize=new GSize(12,20);icon.shadowSize=new GSize(22,20);icon.iconAnchor=new GPoint(6,20);icon.infoWindowAnchor=new GPoint(5,1);mappable=new Array(true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true);markerOvs=new Array(182);communities=new Array([77,499000,12575000,1,1,1,0,1,true,26.193285,-81.77915,1,1,1,0],[226,140000,4850000,1,1,1,1,1,true,26.351205,-81.82205,1,1,1,1],[77,149000,4990000,1,1,1,0,0,true,26.346535,-81.81985,0,0,0,0],[6,149000,399000,1,0,0,0,0,true,26.335165,-81.8016,0,0,1,0],[30,33900,699000,0,1,0,0,0,true,26.33961,-81.78505,0,1,0,0],[8,250000,539900,1,0,1,0,0,true,26.335545,-81.79875,1,0,1,1],[9,210000,1695000,0,1,0,0,0,true,26.34401,-81.80115,0,1,0,0],[5,829900,2775000,0,1,0,0,0,true,26.348125,-81.8494,0,1,0,0],[12,220000,689500,0,0,1,0,0,true,26.364285,-81.80055,0,0,0,0],[15,149900,300000,0,0,0,0,1,true,26.399815,-81.81745,1,0,1,1],[31,239900,840000,0,0,1,1,1,true,26.37465,-81.77825,1,0,1,1],[2,2895000,3795000,0,1,1,0,1,true,26.16882,-81.77565,1,1,1,0],[2,1295000,1875000,0,1,1,0,0,true,26.32389,-81.82725,0,1,0,0],[0,359000,359000,0,0,0,0,0,true,26.3524,-81.7717,0,0,0,0],[9,84900,699900,0,1,0,0,0,true,26.381895,-81.8329,0,1,0,0],[5,309430,798000,0,0,0,0,0,true,26.3784,-81.78585,0,0,0,0],[4,38900,159000,0,0,0,0,0,true,26.344205,-81.7708,1,0,1,0],[7,79000,699000,0,0,1,0,1,true,26.357015,-81.77535,1,0,1,1],[24,11250,799000,0,1,0,0,0,true,26.34264,-81.78315,0,1,0,0],[39,129900,659000,0,0,1,1,1,true,26.353865,-81.7998,1,0,1,1],[29,130000,499000,0,0,1,1,1,true,26.328465,-81.75895,1,0,1,1],[36,40000,2590000,0,1,0,0,0,true,26.334685,-81.8255,0,1,0,0],[24,144900,347000,0,0,1,1,1,true,26.39278,-81.77885,1,0,1,1],[15,79900,1979000,0,1,0,0,0,true,26.327095,-81.8285,0,1,0,0],[4,230000,499000,0,0,0,0,0,true,26.400875,-81.8236,0,0,0,0],[10,280000,749000,0,0,0,0,1,true,26.46743,-81.79435,1,0,1,0],[64,109900,1595000,0,0,1,1,1,true,26.32414,-81.7145,1,0,1,1],[7,169900,899000,0,1,1,0,0,true,26.15237,-81.7605,0,1,0,0],[129,13000,2499999,0,0,1,1,1,true,26.37708,-81.81925,1,0,1,1],[9,109900,339000,0,0,1,0,1,true,26.32789,-81.7087,1,0,1,0],[6,89500,178888,0,0,1,0,0,true,26.34985,-81.7967,0,0,1,0],[103,259900,2997000,0,0,1,1,1,true,26.409415,-81.789,1,0,1,1],[3,999900,2495000,0,1,1,0,0,true,26.360055,-81.85945,0,0,0,0],[83,116375,769000,0,0,1,1,1,true,26.328315,-81.7907,1,0,1,1],[40,159900,560000,0,0,1,1,1,true,26.371455,-81.79385,1,0,1,1],[200,144900,2997000,0,0,1,1,1,true,26.40422,-81.80385,1,0,1,1],[92,294900,3729000,0,1,1,1,1,true,26.368705,-81.80935,1,0,1,1],[19,109900,649900,0,0,1,0,0,true,26.319865,-81.8151,0,0,0,0],[22,118900,495000,0,0,1,0,1,true,26.328885,-81.7347,1,0,1,1],[53,99000,549900,0,0,1,1,1,true,26.32772,-81.7302,1,0,1,1],[20,71500,499000,0,0,1,0,1,true,26.438305,-81.7567,1,0,1,1],[12,384995,697995,0,0,1,0,1,true,26.457035,-81.80865,1,0,1,1],[6,99000,229000,0,0,1,1,1,true,26.446215,-81.82395,1,0,1,0],[29,189900,439000,0,0,1,0,1,true,26.445705,-81.8025,1,0,1,1],[94,179000,675000,0,0,1,0,1,true,26.29016,-81.7711,1,0,1,0],[2,189900,499000,0,0,1,0,0,true,26.42481,-81.79185,1,0,1,0],[3,139900,399990,0,0,1,0,0,true,26.443355,-81.798,1,0,1,1],[26,135000,379000,0,0,0,1,0,true,26.43721,-81.79435,1,0,1,0],[1,283900,399850,0,0,1,0,0,true,26.4296,-81.8039,0,0,0,0],[7,27900,349900,0,0,1,1,1,true,26.42181,-81.8152,1,0,1,1],[57,165000,1600000,0,0,1,1,1,true,26.444275,-81.76365,1,0,1,1],[5,179900,399000,0,0,1,0,1,true,26.404365,-81.8163,1,0,1,1],[14,89050,239990,0,0,1,0,0,true,26.43313,-81.8061,1,0,1,1],[110,165900,6350000,1,0,1,1,1,true,26.903425,-81.7064,1,1,1,1],[2,72500,293000,0,0,1,0,0,true,26.54635,-81.8795,1,0,1,0],[72,154800,939000,0,0,1,1,1,true,26.42847,-81.8247,1,0,1,1],[81,183000,579200,0,0,1,0,1,true,26.42543,-81.7711,1,0,1,1],[4,215000,525000,0,0,1,0,1,true,26.45282,-81.80135,1,0,1,0],[11,129900,599900,0,0,1,0,1,true,26.44098,-81.7936,1,0,1,1],[32,99900,1450000,0,0,1,1,1,true,26.46525,-81.83255,1,0,1,1],[12,119900,499999,0,0,1,1,1,true,26.43072,-81.76575,1,0,1,1],[13,179000,675000,0,0,0,0,0,true,26.29008,-81.8009,1,0,1,1],[0,239900,499000,0,0,1,1,1,true,26.459333,-81.815404,1,0,1,1],[10,95535,299900,0,0,1,0,1,true,26.292985,-81.771,1,0,1,0],[64,185000,2500000,0,0,1,1,1,true,26.4341,-81.8398,1,0,1,1],[43,159900,1195000,0,0,1,1,1,true,26.437355,-81.7495,1,0,1,1],[60,375000,3750000,0,0,1,1,1,true,26.315595,-81.81675,1,0,1,1],[47,175000,17700000,1,1,1,1,1,true,26.24605,-81.81635,1,0,1,1],[14,114900,495000,0,0,1,0,1,true,26.30978,-81.82225,1,0,1,0],[2,234900,397900,0,0,1,0,1,true,26.264965,-81.76755,0,0,1,0],[18,152365,469000,0,0,1,0,1,true,26.23631,-81.75675,1,0,1,1],[5,59900,379000,0,0,0,0,1,true,26.25761,-81.68575,1,0,1,0],[27,135900,447900,0,0,1,0,1,true,26.279795,-81.74945,1,0,1,0],[21,875000,2987000,0,0,1,1,1,true,26.28064,-81.7924,1,0,1,1],[61,392500,8495000,0,1,0,0,0,true,26.264365,-81.82105,0,1,0,0],[43,95000,595000,0,0,1,0,1,true,26.363945,-81.76635,1,0,1,0],[15,304000,631900,0,0,1,0,1,true,26.28784,-81.7615,1,0,1,1],[7,474300,649900,0,0,1,0,0,true,26.30436,-81.82235,1,0,1,0],[10,2925000,6395000,0,0,1,1,1,true,26.26335,-81.7944,1,0,1,0],[44,795000,5995000,0,0,1,1,1,true,26.1722,-81.7765,1,0,1,1],[40,129900,359000,0,0,1,0,1,true,26.181235,-81.7479,1,0,1,0],[5,324900,559000,0,0,1,0,0,true,26.302475,-81.8143,1,0,1,0],[124,499900,6499000,0,0,1,1,1,true,26.168555,-81.77395,1,0,1,1],[9,149900,1192000,0,1,0,0,0,true,26.32466,-81.83305,0,1,0,0],[8,124000,499000,0,0,1,1,1,true,26.21871,-81.72625,1,0,1,0],[21,159900,600000,0,0,1,1,1,true,26.265395,-81.70905,1,0,1,0],[4,47500,725000,0,0,0,0,0,true,26.482085,-81.7698,0,0,0,1],[10,119000,269000,0,0,1,0,1,true,26.281045,-81.7361,1,0,1,0],[12,150000,339900,0,0,1,0,1,true,26.268375,-81.703,1,0,1,0],[65,29000,1099000,0,0,1,1,0,true,26.294365,-81.78095,0,0,0,1],[5,209900,699900,0,0,1,0,1,true,26.261235,-81.6986,1,0,1,0],[35,210000,599000,0,0,1,0,1,true,26.251485,-81.71015,1,0,1,0],[6,139900,375000,0,0,1,0,1,true,26.236965,-81.7633,1,0,1,0],[8,214900,549900,0,0,1,0,1,true,26.26856,-81.69905,1,0,1,0],[24,179000,2400000,0,0,0,0,0,true,26.221495,-81.7155,0,0,0,0],[22,159000,924900,0,0,1,0,1,true,26.28054,-81.7255,1,0,1,0],[177,221100,7999500,0,0,1,1,1,true,26.28191,-81.7702,1,0,1,0],[9,355000,1370000,1,0,0,0,1,true,26.26669,-81.7596,1,0,1,1],[9,89900,245000,0,0,0,0,1,true,26.290355,-81.7565,0,0,1,0],[17,159920,1695000,0,0,1,0,1,true,26.19514,-81.78625,1,0,1,0],[114,64900,1195000,0,0,0,0,0,true,26.19701,-81.77285,0,0,0,0],[49,189900,3299000,0,0,1,1,1,true,26.28237,-81.71505,1,0,1,1],[52,12000,975000,0,0,0,1,0,true,26.2801,-81.78575,0,0,0,0],[14,159900,399900,0,0,1,0,1,true,26.26935,-81.69325,1,0,1,0],[384,175000,17700000,1,1,1,1,1,true,26.232185,-81.8115,1,0,1,0],[109,45600,6395000,0,0,1,1,1,true,26.258365,-81.77805,1,0,1,0],[51,109900,2795000,0,0,1,1,1,true,26.22114,-81.7567,1,0,1,1],[68,75000,9950000,0,0,1,1,1,true,26.23254,-81.75845,1,0,1,1],[10,89900,1599000,0,0,1,0,0,true,26.2658,-81.7587,0,0,0,0],[7,225000,499000,0,0,1,0,0,true,26.20763,-81.7936,1,0,1,0],[25,218500,979900,0,0,1,0,1,true,26.20623,-81.75405,1,0,1,0],[21,134900,484900,0,0,1,0,1,true,26.311035,-81.79965,1,0,1,0],[44,180000,949500,0,0,1,1,1,true,26.38318,-81.83455,1,0,1,1],[1,12500000,17700000,0,1,1,1,1,true,26.24099,-81.82005,1,0,1,0],[11,147300,345000,0,0,1,0,0,true,26.25478,-81.6917,1,0,1,0],[19,169000,359000,0,0,1,0,1,true,26.262145,-81.7393,1,0,1,0],[21,179900,429000,0,0,1,0,1,true,26.297875,-81.8065,1,0,1,0],[26,211613,3750000,0,0,1,1,1,true,26.178795,-81.7345,1,0,1,0],[10,139900,435900,0,0,1,0,1,true,26.26779,-81.6845,1,0,1,0],[5,908850,2750000,0,0,1,1,1,true,26.31238,-81.7489,1,0,1,1],[47,75000,3975000,0,0,1,1,1,true,26.219635,-81.7107,1,0,1,0],[8,134900,559000,0,0,1,0,1,true,26.28171,-81.5906,1,0,1,0],[223,7000,8495000,0,1,0,0,0,true,26.21398,-81.81075,0,1,0,0],[59,129900,899000,0,0,1,1,1,true,26.32255,-81.7555,1,0,1,1],[25,24900,499000,0,1,1,0,1,true,26.29249,-81.81065,1,1,1,0],[24,119900,899000,0,0,1,0,1,true,26.25109,-81.74345,1,0,1,0],[1,228900,611100,0,0,1,0,0,true,26.173745,-81.76965,1,0,1,0],[62,695000,14000000,0,1,0,0,0,true,26.167135,-81.72645,0,1,0,0],[4,199900,419000,0,0,1,0,1,true,26.09915,-81.75295,1,0,1,1],[20,225000,718900,0,0,1,0,1,true,26.22643,-81.7874,1,0,1,1],[16,2000,699900,0,0,1,0,1,true,26.154175,-81.74635,1,0,1,0],[16,309900,999000,0,0,1,0,0,true,26.175885,-81.77955,1,0,1,1],[30,70000,1799900,0,0,0,0,1,true,26.142395,-81.78855,1,1,1,0],[3,3600000,10495000,0,1,0,0,0,true,26.101415,-81.80165,0,1,0,0],[3,219900,279000,0,0,0,0,0,true,26.17367,-81.7686,0,0,1,0],[4,299000,510000,0,0,1,0,0,true,26.206585,-81.74905,0,0,0,0],[7,139900,300000,0,0,1,0,1,true,26.23701,-81.7864,1,0,1,1],[0,2900000,2900000,0,1,1,0,0,true,26.19031,-81.8146,0,0,1,0],[26,139900,859000,0,0,1,1,1,true,26.14344,-81.6946,1,0,1,1],[3,1325000,2495000,0,0,0,0,0,true,26.137565,-81.80195,0,0,0,0],[2,373900,849000,0,0,0,0,0,true,26.190725,-81.7742,0,0,1,0],[61,249000,5950000,0,1,0,1,0,true,26.164345,-81.80465,0,0,0,1],[64,74500,798767,0,0,1,1,1,true,26.098065,-81.74775,1,0,1,1],[6,109000,439000,0,0,0,1,1,true,26.237765,-81.77365,1,0,1,0],[218,124900,4995000,0,0,1,1,1,true,26.16172,-81.73095,1,0,1,0],[40,100900,454000,0,0,1,0,1,true,26.14719,-81.6772,1,0,1,0],[39,34900,419000,0,0,0,0,0,true,26.205815,-81.778,0,0,0,0],[118,19900,5700000,0,0,0,0,0,true,26.18925,-81.6725,0,0,0,1],[11,550000,4600000,0,1,0,0,0,true,26.136465,-81.78565,0,1,0,0],[0,22975000,22975000,0,1,0,0,0,true,26.112084,-81.80207,0,0,0,0],[7,249900,995000,0,0,1,0,1,true,26.195185,-81.7722,1,0,1,0],[14,259000,3695000,0,1,0,0,0,true,26.072425,-81.77695,0,1,0,0],[45,279900,2450000,0,0,1,1,1,true,26.20431,-81.7584,1,0,1,1],[50,55900,589000,0,0,0,0,1,true,26.13112,-81.74605,0,0,1,0],[202,87500,1695000,0,0,1,1,1,true,26.17899,-81.6939,1,0,1,1],[10,425000,989900,0,0,1,0,1,true,26.240895,-81.7862,1,0,1,0],[0,4595000,4595000,0,1,1,0,0,true,26.12137,-81.7983,0,1,0,0],[24,149900,8750000,0,0,0,0,0,true,26.22286,-81.74415,0,0,0,0],[9,399000,1200000,0,0,1,0,1,true,26.22914,-81.78005,0,0,1,0],[228,39900,5950000,0,1,0,1,1,true,26.183625,-81.8072,0,1,0,0],[11,95000,1099000,0,0,1,0,1,true,26.1747,-81.78185,1,0,1,0],[5,34995,175000,0,0,0,0,0,true,26.08904,-81.72545,0,0,0,0],[260,9000,13900000,0,1,0,0,0,true,26.16254,-81.70005,0,0,0,0],[8,169900,389000,0,0,1,0,1,true,26.241755,-81.7571,1,0,1,0],[24,62000,1500000,0,1,0,0,0,true,26.13613,-81.7858,0,1,0,0],[363,36900,7900000,1,1,0,0,0,true,26.26396,-81.80235,0,1,0,1],[51,69900,8500000,0,0,0,0,0,true,26.23166,-81.79505,0,0,0,1],[12,129900,270000,0,0,1,0,1,true,26.241415,-81.76365,1,0,1,0],[95,1750000,23000000,0,1,0,1,1,true,26.11599,-81.74895,0,1,0,1],[11,74900,376000,0,0,1,0,0,true,26.1728,-81.77275,1,0,1,0],[2,47900,139500,0,0,1,0,1,true,26.208235,-81.74015,1,0,1,0],[67,139000,6900000,0,1,0,0,0,true,26.126825,-81.7862,0,1,0,0],[7,105900,244000,0,0,1,0,0,true,26.200325,-81.73955,0,0,1,0],[6,225000,1175000,0,0,0,0,0,true,26.21852,-81.766,0,0,0,0],[65,142500,1595000,0,0,1,1,1,true,26.228945,-81.7157,1,0,1,1],[64,219000,4995000,0,0,1,1,1,true,26.22003,-81.77495,1,0,1,1],[28,436108,5400000,0,0,1,1,1,true,33.46675,-33.760895,1,0,1,0],[23,170725,599000,0,0,1,0,1,true,26.282895,-81.72145,1,0,1,0],[192,127000,3400000,0,0,1,1,1,true,26.192585,-81.75755,1,0,1,1],[7,32900,139000,0,0,0,0,1,true,26.143225,-81.7124,1,0,1,0],[16,67900,438900,0,0,1,0,1,true,26.200915,-81.76485,1,0,1,0],[54,129900,1695000,0,0,1,1,1,true,26.187895,-81.7435,1,0,1,0]);markerOvs.each(function(m){if(m){map.addOverlay(m);}});commLinks=$$('div.element a');commLinks.each(function(thelink,i){thelink.myIndex=i;if(mappable[i])thelink.addEvent("mouseleave",function(){stopWaitingForInfo(thelink.myIndex)});if(mappable[i])thelink.addEvent("mouseenter",function(){if(!markerOvs[i])addMarker(i);startWaitingForInfo(thelink.myIndex);});});initializeMarkers();if(revise)runFilter();GEvent.addListener(map,"move",function(){var bounds=map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var east=northEast.lng();var west=southWest.lng();var north=northEast.lat();var south=southWest.lat();communities.each(function(c,i){if(markerOvs[i]==false&&mappable[i]&&c[10]<=east&&c[10]>=west&&c[9]>=south&&c[9]<=north){markerOvs[i]=createMarker(i);map.addOverlay(markerOvs[i]);if(!communities[i][8])
markerOvs[i].hide();}});});}
function addMarker(i){markerOvs[i]=createMarker(i);map.addOverlay(markerOvs[i]);}
function createMarker(index){var marker=new GMarker(new GLatLng(communities[index][9],communities[index][10]),icon);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(generateInfo(index),{maxWidth:300});});return marker;}
function generateInfo(index){var names,ammens,i,loc,ammenT=false;names=new Array('high rise condos','gulf access','gated community','tennis courts',false,false,false,'fitness center','boat docks available')
ammens=new Array();for(i=0;i<names.length;++i)
if(names[i]&&communities[index][i+3])
ammens.push(names[i]);if(ammens.length){ammenT=ammens[0];for(i=1;i<ammens-1;++i)
ammenT+=', '+ammens[i];if(ammens.length>1)ammenT+=', and '+ammens[ammens.length-1];}
ammenT=ammenT?'<b>Amenities:</b> '+ammenT+'<br />':'';ammenT+='<b>Properties for Sale:</b> '+addCommas(communities[index][0])+'<br />';var href=commLinks[index].getProperty('href');var image=communities[index][14]?'<a href="'+href+'"><img src="images/commlogos/'+href.substr(0,href.lastIndexOf('.php'))+'.jpg" /></a>':''
var title=commLinks[index].innerHTML;if((loc=title.indexOf('<'))!=-1)
title=title.substr(0,title.indexOf('<'));if(communities[0]){ammenT+='<b>Minimum Price: </b>$'+addCommas(communities[index][1])+'<br /><b>Maximum Price: </b>$'+addCommas(communities[index][2]);}
return'<span class="m"><h3><a href="'+href+'">'+title+'</a></h3>'+ammenT+'</span>';}
function addCommas(nStr)
{nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;}
function initializeMarkers(){var bounds=map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var east=northEast.lng();var west=southWest.lng();var north=northEast.lat();var south=southWest.lat();communities.each(function(c,i){if(mappable[i]&&c[10]<=east&&c[10]>=west&&c[9]>=south&&c[9]<=north){markerOvs[i]=createMarker(i);map.addOverlay(markerOvs[i]);}else{markerOvs[i]=false;}});};var infoIndex=-1;var infoWaitCount=-1;function startWaitingForInfo(index){if(communities[index][8]&&markerOvs[index]&&index!=infoIndex){infoIndex=index;if(infoWaitCount>0){infoWaitCount=5;}else{infoWaitCount=5;setTimeout('waitForInfo()',80);}}}
function waitForInfo(){if(infoWaitCount>0){--infoWaitCount;setTimeout('waitForInfo()',80);}else if(infoWaitCount==0)
showInfoWindow();}
function stopWaitingForInfo(index){if(index==infoIndex){infoWaitCount=-1;infoIndex=-1;}}
function showInfoWindow(){if(infoIndex!=-1){markerOvs[infoIndex].openInfoWindowHtml(generateInfo(infoIndex),{maxWidth:300});stopWaitingForInfo(infoIndex);}}
function resetFilter(){var lists=['gulfaccess','gated','golf','tennis','highrise','fitness','boat','pool'];lists.each(function(a){$(a).selectedIndex=0});$('minprice').value='';$('maxprice').value='';$('showopts').value='1';showHideOpts();revise=false;setTimeout('runFilter()',40);}
function runFilter(){var filter=new Array(11);filter[0]=$('showopts').value;var x=parseInt(removeChar($('minprice').value,','));if(x&&!isNaN(x)&&$('minprice').value!='')filter[1]=x;else filter[1]=0;var x=parseInt(removeChar($('maxprice').value,','));if(x&&!isNaN(x)&&$('maxprice').value!='')filter[2]=x;else filter[2]=Number.MAX_VALUE;filter[3]=$('highrise').value;filter[4]=$('gulfaccess').value;filter[5]=$('gated').value;filter[6]=$('golf').value;filter[7]=$('tennis').value;filter[8]=$('fitness').value;filter[9]=$('boat').value;filter[10]=$('pool').value;communities.each(function(row,index){if(!(filter[2]<row[1]||filter[1]>row[2])&&((filter[3]==-1||filter[3]==row[3])&&(filter[4]==-1||filter[4]==row[4])&&(filter[5]==-1||filter[5]==row[5])&&(filter[6]==-1||filter[6]==row[6])&&(filter[7]==-1||filter[7]==row[7])&&(filter[8]==-1||filter[8]==row[11])&&(filter[9]==-1||filter[9]==row[12])&&(filter[10]==-1||filter[10]==row[13]))){if(!row[8]){row[8]=true;commLinks[index].removeClass('inactive');if(markerOvs[index]!=false){markerOvs[index].show();}}}else{if(row[8]){row[8]=false;commLinks[index].addClass('inactive');if(markerOvs[index]!=false){markerOvs[index].hide();}}}});if(!revise)
new Ajax('includes/ajax/savecommfilter.php',{method:'post',data:Object.toQueryString({minprice:$('minprice').value,maxprice:$('maxprice').value,highrise:$('highrise').value,showopts:$('showopts').value,gulfaccess:$('gulfaccess').value,gated:$('gated').value,golf:$('golf').value,tennis:$('tennis').value,fitness:$('fitness').value,boat:$('boat').value,pool:$('pool').value})}).request();else
revise=false;map.closeInfoWindow();}
function showHideOpts(){if($('showopts').value=='0'){$('showopts').value='1';$('showoptslink').setText('Hide extra amenity options. <');$$('.ammens').setStyle('display','block');$('filter').setStyle('width','auto');$$('.prange').setStyle('width','37%');}else{$('showopts').value='0';$('showoptslink').setText('Show extra amenity options. >');$$('.ammens').setStyle('display','none');$('filter').setStyle('width','35%');$$('.prange').setStyle('width','100%');}}
function removeChar(str,char){var pos;while((pos=str.indexOf(char))!==-1){if(str.length==1){str='';}else if(pos==0){str=str.substring(1,str.length);}else if(pos==str.length-1){str=str.substring(0,pos);}else{str=str.substring(0,pos)+str.substring(pos+1,str.length);}}
return str;}