//Created by Cory Gagliardi. Copyright 2006 Sullivan
var map,mapmgr,markerOvs,mappable,communities,commLinks,icon;function loadCommDom(){var cityLocs=new Array(new GLatLng(26.138989,-81.795769),new GLatLng(26.225081,-81.800300),new GLatLng(26.342611,-81.779031),false);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,true);markerOvs=new Array(183);communities=new Array([4,599000,1150000,1,1,0,0,0,true,26.19251,-81.8134,1,0,1,0],[12,2175000,5195000,1,1,0,0,0,true,26.201185,-81.81335,1,0,1,0],[6,575000,995000,1,1,1,0,0,true,26.19601,-81.8132,1,0,1,0],[9,1495000,2975000,1,1,1,0,1,true,26.19634,-81.81335,1,0,1,0],[1,6500000,7900000,1,1,0,0,1,true,26.20125,-81.8132,1,0,1,0],[12,529000,750000,1,1,0,0,0,true,26.19209,-81.8135,1,0,1,0],[8,459000,699000,1,1,0,0,0,true,26.19125,-81.8135,1,0,1,0],[6,799000,1695000,1,1,1,0,1,true,26.19279,-81.8133,1,0,1,0],[5,2095000,2575000,1,1,1,0,1,true,26.19176,-81.8135,1,0,1,0],[7,1495000,2450000,1,1,1,0,1,true,26.19151,-81.8135,1,0,1,0],[2,3399000,5900000,1,1,1,0,1,true,26.19508,-81.8133,1,0,1,0],[6,1150000,2690000,1,1,1,0,1,true,26.20645,-81.8144,1,0,1,0],[2,5900000,6500000,1,1,1,0,1,true,26.19743,-81.8129,1,0,1,0],[3,629000,1649000,1,1,1,0,1,true,26.20575,-81.814,1,0,1,0],[5,395000,1750000,1,1,1,0,1,true,26.19818,-81.8129,1,0,1,0],[9,1349000,2990000,1,1,1,0,1,true,26.1967,-81.813,1,0,1,0],[6,949000,1499000,1,1,1,0,0,true,26.197415,-81.81395,1,0,1,0],[5,450000,1125000,1,1,0,0,0,true,26.196325,-81.81155,0,1,1,0],[9,1775000,5995000,1,1,1,0,1,true,26.19426,-81.8133,1,0,1,0],[2,4950000,6999000,1,1,1,0,0,true,26.19357,-81.8133,1,0,1,0],[8,689000,1895000,1,1,1,0,1,true,26.193955,-81.8139,1,0,1,0],[11,575000,1150000,1,1,0,0,1,true,26.19887,-81.813,1,0,1,0],[10,499000,1099000,1,1,0,0,0,true,26.19206,-81.8135,0,0,1,0],[9,485000,1298000,1,1,0,0,0,true,26.20349,-81.8133,1,0,1,0],[11,599000,1449000,1,1,0,0,0,true,26.20203,-81.8132,1,0,1,0],[1,899500,1200000,1,1,0,0,0,true,26.16106,-81.8089,0,0,1,0],[4,264000,365000,1,1,0,0,0,true,26.16128,-81.8089,0,0,1,0],[1,680000,680000,1,1,0,0,0,true,26.16852,-81.8107,0,0,0,0],[5,799500,1275000,1,1,0,0,0,true,26.1662,-81.81,0,0,1,0],[1,1950000,2150000,1,1,0,0,0,true,26.16115,-81.8089,0,0,1,0],[1,2395000,2395000,1,1,0,0,0,true,26.16063,-81.8088,0,0,1,0],[1,2300000,2300000,1,1,0,0,0,true,26.16091,-81.8088,0,0,1,0],[8,499000,1499000,1,1,1,0,1,true,26.17553,-81.81325,1,1,1,0],[2,999999,1600000,1,1,0,0,0,true,26.17892,-81.8137,0,0,1,0],[57,214900,4199000,1,0,1,1,1,true,25.996305,-81.69335,1,0,1,0],[0,899000,899000,1,1,0,0,0,true,26.18028,-81.8137,0,0,1,0],[1,389000,389000,1,1,0,0,0,true,26.17209,-81.8112,1,0,1,0],[9,399000,1150000,1,1,0,0,0,true,26.18423,-81.8142,1,0,1,0],[5,399000,1200000,1,1,0,0,0,true,26.18201,-81.8136,0,0,1,0],[4,489000,725000,1,1,0,0,0,true,26.18752,-81.8143,1,0,1,0],[3,2900000,4295000,1,1,1,0,0,true,26.16671,-81.8101,1,0,1,0],[5,399000,499000,0,1,0,0,0,true,26.17724,-81.8132,0,1,1,0],[5,1250000,1795000,1,1,0,0,0,true,26.180535,-81.8137,0,0,1,0],[16,1375000,5475000,1,1,1,0,1,true,25.90962,-81.7275,1,0,1,0],[61,599000,6475000,1,1,1,0,1,true,25.931415,-81.7268,1,0,1,0],[8,1250000,2795000,1,1,1,0,1,true,25.91059,-81.7269,1,0,1,0],[18,1225000,7495000,1,1,1,0,1,true,25.941145,-81.7286,1,0,1,0],[2,600000,799000,1,1,1,0,1,true,25.91042,-81.7268,1,0,1,0],[6,649000,1425000,1,1,1,0,1,true,25.93229,-81.72175,1,1,1,0],[8,679000,1199000,1,1,1,0,1,true,25.91042,-81.7268,1,0,1,0],[4,545000,1075000,1,1,1,0,1,true,25.93717,-81.7316,1,0,1,0],[5,749000,1350000,1,1,1,0,1,true,25.938005,-81.7309,1,0,1,0],[2,1290000,1695000,1,1,1,0,1,true,25.91083,-81.7266,1,0,1,0],[20,1495000,6475000,1,1,1,0,1,true,25.93238,-81.72605,1,0,1,0],[7,980100,1795000,1,1,1,0,1,true,26.2084,-81.8157,1,0,1,0],[0,2900000,2900000,1,1,1,0,1,true,26.208,-81.8155,1,0,1,0],[3,4450000,4995000,1,1,1,0,1,true,26.20845,-81.8162,1,0,1,0],[5,735000,1350000,1,1,1,0,1,true,26.20844,-81.8159,1,0,1,0],[7,2325000,6450000,1,1,1,0,1,true,26.20825,-81.8153,1,1,1,0],[3,899000,1250000,1,1,1,0,1,true,26.20841,-81.8157,1,0,1,0],[6,886000,6500000,1,1,1,0,0,true,26.29827,-81.81855,1,1,1,0],[4,349900,450000,1,1,0,0,0,true,26.25443,-81.8201,0,1,1,0],[3,519000,799000,1,1,0,0,1,true,26.27581,-81.8251,1,1,1,0],[5,975000,1499000,1,1,0,0,0,true,26.25406,-81.8229,0,0,1,0],[5,875000,1475000,1,1,0,0,0,true,26.25929,-81.8238,0,0,1,0],[3,439900,695000,1,1,0,0,0,true,26.254365,-81.8173,0,1,1,0],[30,385000,1975000,0,1,1,0,1,true,26.21646,-81.80485,1,1,1,0],[8,480000,769000,1,1,0,0,1,true,26.276135,-81.82485,0,1,1,0],[0,699000,825000,1,0,0,1,1,true,26.26677,-81.8253,0,0,0,0],[3,769000,997700,1,1,0,0,0,true,26.25976,-81.8236,0,0,1,0],[1,750000,1395000,1,1,0,0,1,true,26.26055,-81.8237,0,0,1,0],[11,94500,679500,1,1,1,0,1,true,26.289815,-81.81905,1,1,1,0],[1,449000,494900,1,1,0,0,0,true,26.26803,-81.8254,0,0,1,0],[4,2500000,4950000,1,1,1,0,0,true,26.27153,-81.82585,1,0,1,0],[27,85000,2175000,0,1,1,0,1,true,26.217615,-81.8082,1,1,1,0],[3,749900,1299000,1,1,1,0,0,true,26.25492,-81.8231,0,0,1,0],[30,65000,1150000,1,1,0,0,0,true,26.198285,-81.8069,0,1,1,0],[1,520000,649000,1,1,0,0,0,true,26.25821,-81.8233,0,0,1,0],[5,1050000,1395000,1,1,0,0,0,true,26.25863,-81.8237,0,0,1,0],[1,1349000,1349000,1,1,0,0,0,true,26.25679,-81.8231,0,0,1,0],[68,499000,1999000,0,1,1,0,1,true,26.211315,-81.80845,1,0,1,0],[0,580000,580000,0,1,1,0,1,true,26.27482,-81.8204,1,0,1,0],[6,799999,1295000,0,1,1,0,1,true,26.27728,-81.8201,1,0,1,0],[11,1099000,1600000,0,1,1,0,1,true,26.27727,-81.82,1,0,1,0],[7,895000,1650000,0,1,1,0,1,true,26.211315,-81.80845,1,0,1,0],[24,799000,1750000,0,1,1,0,1,true,26.277405,-81.81855,1,0,1,0],[2,2995000,3400000,1,1,0,0,0,true,26.2562,-81.8231,1,0,1,0],[10,824900,1795000,1,1,0,0,1,true,26.269915,-81.82545,0,0,1,0],[6,429000,649000,1,1,0,0,1,true,26.2717,-81.8256,0,0,1,0],[3,860000,1250000,1,1,0,0,1,true,26.26817,-81.8257,0,0,1,0],[7,369000,799000,1,1,0,0,1,true,26.2759,-81.82465,1,0,1,0],[19,139500,495000,1,1,0,0,0,true,26.27293,-81.8253,0,0,1,0],[4,495990,998500,1,1,0,0,0,true,26.27105,-81.8255,0,0,1,0],[2,699750,1050000,1,1,0,0,1,true,26.25695,-81.8231,0,0,1,0],[14,1595000,6800000,1,1,1,1,1,true,26.230165,-81.8121,1,0,1,0],[1,379000,649777,1,0,1,1,1,true,26.21845,-81.8092,1,0,1,0],[9,739000,1699000,1,0,1,1,1,true,26.2388,-81.8127,1,0,1,0],[5,795000,4400000,1,0,1,1,1,true,26.237,-81.8123,1,0,1,0],[2,575000,1499000,1,0,1,1,1,true,26.219785,-81.81085,1,0,1,0],[11,499000,1175000,1,0,1,1,1,true,26.21821,-81.8095,1,0,1,0],[1,749900,895000,1,0,1,1,1,true,26.21429,-81.8104,1,0,1,0],[16,82944,2499000,1,0,1,1,1,true,26.219205,-81.7893,1,0,1,0],[8,1649000,6299000,1,0,1,1,1,true,26.23914,-81.8127,1,0,1,0],[12,469000,1075000,1,0,1,1,1,true,26.22902,-81.81175,1,0,1,0],[6,559000,1375000,1,0,1,1,1,true,26.23174,-81.8121,1,0,1,0],[4,499000,750000,1,0,1,1,1,true,26.22586,-81.81085,1,0,1,0],[4,499900,1060000,1,0,1,1,1,true,26.21973,-81.8105,1,0,1,0],[8,500000,1189000,1,0,1,1,1,true,26.22775,-81.8119,1,0,1,0],[5,394000,1095000,1,0,1,1,1,true,26.21456,-81.8103,1,0,1,0],[4,539000,1350000,1,0,1,1,1,true,26.2317,-81.812,1,0,1,0],[2,499900,699000,1,0,1,1,1,true,26.21428,-81.8093,1,0,1,0],[17,649000,3350000,1,1,1,1,1,true,26.235225,-81.8124,1,0,1,0],[9,379000,1999995,1,0,1,1,1,true,26.21562,-81.8102,1,0,1,0],[2,2550000,3000000,1,1,1,1,1,true,26.24806,-81.8207,1,0,1,0],[4,2395000,3150000,1,1,1,1,1,true,26.24526,-81.8196,1,0,1,0],[3,2245000,3295000,1,1,1,1,1,true,26.24457,-81.8199,1,0,1,0],[5,1295000,5975000,1,1,1,1,1,true,26.24409,-81.8204,1,0,1,0],[4,950000,1650000,1,1,1,1,1,true,26.24902,-81.817,1,0,1,0],[6,175000,8900000,1,1,1,1,1,true,26.250635,-81.8211,1,0,1,0],[5,1350000,3875000,1,1,1,1,1,true,26.24841,-81.8169,1,0,1,0],[11,1795000,4895000,1,1,1,1,1,true,26.2511,-81.8184,1,0,1,0],[1,6250000,9500000,1,1,1,1,1,true,26.24823,-81.8208,1,0,1,0],[4,1175000,2325000,1,1,1,1,1,true,26.35488,-81.82795,1,1,1,0],[8,160000,822900,1,0,1,1,1,true,26.22662,-81.80745,1,1,1,0],[27,655000,1975000,1,0,1,1,1,true,26.35491,-81.8274,1,1,1,0],[15,799000,2399000,1,0,1,1,1,true,26.34977,-81.8296,1,1,1,0],[5,1350000,1995000,1,0,1,1,1,true,26.34453,-81.8308,1,1,1,0],[9,1535200,2211600,1,0,1,1,1,true,26.356485,-81.8318,1,1,1,0],[7,495000,875000,1,0,1,1,1,true,26.34557,-81.831,1,1,1,0],[0,294900,960000,1,0,1,1,1,true,26.36478,-81.8078,1,1,1,0],[13,649000,1295000,1,0,1,1,1,true,26.3398,-81.7786,1,1,1,0],[8,875000,2395000,1,0,1,1,1,true,26.385375,-81.8389,1,0,1,0],[13,321651,875000,1,0,1,1,1,true,26.368295,-81.8056,1,1,1,0],[15,639000,2999000,1,0,1,1,1,true,26.388695,-81.8314,1,1,1,0],[8,419000,4750000,1,0,1,1,1,true,27.00231,-81.6739,1,1,1,0],[9,789000,1500000,1,0,1,1,1,true,26.392335,-81.8332,1,1,1,0],[2,575000,599000,1,1,0,0,0,true,26.35476,-81.8566,0,0,1,0],[22,559000,1750000,1,1,1,0,1,true,26.312255,-81.83745,1,0,1,0],[3,280900,799000,1,1,0,0,1,true,26.3563,-81.85715,0,0,1,0],[19,129000,340000,1,1,0,0,1,true,26.33065,-81.8419,0,0,1,0],[11,390000,695000,1,1,1,0,1,true,26.362325,-81.86095,1,0,1,0],[4,549900,1750000,1,1,0,0,0,true,26.33047,-81.8407,0,1,1,0],[12,399000,899900,1,1,0,0,0,true,26.35995,-81.8597,0,0,1,0],[3,419000,549000,1,1,0,0,1,true,26.3583,-81.85795,0,0,1,0],[1,699900,945000,1,1,0,0,0,true,26.35715,-81.85805,0,0,0,0],[0,449000,449000,1,1,0,0,0,true,26.35427,-81.8563,0,0,1,0],[38,150000,2700000,1,1,1,1,1,true,26.410105,-81.89225,1,1,1,0],[0,539000,539000,1,1,0,0,0,true,26.35391,-81.8561,0,0,1,0],[16,295000,2500000,1,0,1,1,1,true,26.424455,-81.8372,1,0,1,0],[28,1199000,8300000,0,1,0,0,0,true,26.125165,-81.7985,0,1,0,0],[3,3600000,10495000,0,1,0,0,0,true,26.101415,-81.80165,0,1,0,0],[42,444510,8495000,0,1,0,0,0,true,26.264365,-81.82105,0,1,0,0],[12,3995000,4995000,0,1,0,0,0,true,26.1666,-81.81,0,1,0,0],[7,550000,4600000,0,1,0,0,0,true,26.13633,-81.78565,0,1,0,0],[0,22975000,22975000,0,1,0,0,1,true,26.112084,-81.80207,1,0,1,0],[15,1299000,5950000,0,1,0,1,1,true,26.17767,-81.80835,1,1,1,0],[13,1850000,13900000,0,1,0,0,0,true,26.14438,-81.8027,0,0,0,0],[2,299900,795000,0,1,0,0,0,true,26.134095,-81.78445,0,1,0,0],[23,1250000,6450000,0,1,0,1,1,true,26.198525,-81.81045,1,1,1,0],[61,2950000,23000000,0,1,0,0,1,true,26.1088,-81.79525,1,1,1,0],[49,565155,6900000,0,1,0,0,0,true,26.126825,-81.7862,0,1,0,0],[1,4500000,4500000,0,1,0,0,0,true,26.10098,-81.8001,0,1,0,0],[1,12500000,17700000,0,1,1,1,1,true,26.24099,-81.82005,1,0,1,0],[13,1395000,18000000,1,1,0,0,0,true,26.52742,-82.1958,0,1,0,0],[14,550000,3695000,0,1,0,0,0,true,26.072425,-81.77695,0,1,0,0],[218,255423,9500000,1,1,0,1,0,true,26.06196,-81.71915,0,1,0,0],[8,1029000,13500000,1,1,0,1,0,true,26.45706,-82.1097,0,1,0,0],[2,595000,1790000,0,1,0,0,1,true,26.513295,-81.9743,0,0,0,0],[50,139900,12999000,1,1,1,1,1,true,26.481975,-81.8866,1,1,1,0],[3,465000,2300000,0,1,1,0,0,true,26.4931,-81.9941,1,1,1,0],[4,799000,1549000,0,1,0,0,0,true,26.53826,-81.9305,0,1,0,0],[1,899000,1395000,0,1,1,0,1,true,26.51021,-81.98325,0,1,1,0],[2,299900,579900,0,1,1,0,1,true,26.481095,-81.84715,0,1,1,0],[0,650000,675000,0,1,0,0,0,true,26.477605,-81.8571,0,1,0,0],[6,445000,3495000,0,1,0,0,0,true,35.426315,-94.20455,0,1,0,0],[34,1189000,12575000,0,1,1,0,1,true,26.193285,-81.77865,1,1,1,0],[43,199500,4895000,0,1,0,0,0,true,26.34244,-81.8246,0,1,1,0],[3,995000,2775000,0,1,0,0,0,true,26.34706,-81.8494,0,1,0,0],[1,1875000,1875000,0,1,0,0,0,true,26.32375,-81.8272,0,1,1,0],[3,197500,699900,0,1,0,0,0,true,26.381105,-81.83275,0,1,0,0],[10,315000,2590000,0,1,0,0,0,true,26.333845,-81.8249,0,1,0,0],[15,60000,1979000,0,1,0,0,0,true,26.327095,-81.8285,0,1,0,0],[3,999900,2495000,0,1,0,0,0,true,26.360055,-81.85945,0,1,0,0]);markerOvs.each(function(m){if(m){map.addOverlay(m);}});commLinks=$$('div.element a[class!=head]');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;}