var map=null;var iconPink=null;var iconPurple=null;var iconWhite=null;var iconBrown=null;var iconBlue=null;var iconGreen=null;var iconOrange=null;var iconRed=null;var iconYellow=null;var markerOptions=null;var cityCenters=new Array();cityCenters[0]=new Array(28.2172,-80.6815);cityCenters[1]=new Array(28.711667523482784,-80.86349487304687,12);cityCenters[2]=new Array(28.65323575209858,-80.84701538085937,12);cityCenters[3]=new Array(28.57306501044475,-80.81954956054687,12);cityCenters[4]=new Array(28.54230662300966,-80.82916259765625,12);cityCenters[5]=new Array(28.476236212533962,-80.80204010009765,12);cityCenters[6]=new Array(28.421900801094903,-80.82435607910156,12);cityCenters[7]=new Array(28.376297906469307,-80.76736450195312,12);cityCenters[8]=new Array(28.36602699884236,-80.7330322265625,11);cityCenters[9]=new Array(28.322515664722942,-80.73440551757812,12);cityCenters[10]=new Array(28.340647553430923,-80.76530456542969,12);cityCenters[11]=new Array(28.260541715303056,-80.71243286132812,12);cityCenters[12]=new Array(28.26840382349626,-80.73749542236328,12);cityCenters[13]=new Array(28.22001242425805,-80.69869995117187,12);cityCenters[14]=new Array(28.441827026717966,-80.70419311523437,12);cityCenters[15]=new Array(28.384755554306423,-80.6942367553711,12);cityCenters[16]=new Array(28.385963734648648,-80.67089080810547,12);cityCenters[17]=new Array(28.272939391283682,-80.66539764404297,12);cityCenters[18]=new Array(28.33551049906923,-80.66265106201172,12);cityCenters[19]=new Array(28.408614566620322,-80.60462951660156,12);cityCenters[20]=new Array(28.384755554306423,-80.60256958007812,12);cityCenters[21]=new Array(28.312541807437636,-80.61389923095703,12);cityCenters[22]=new Array(28.18188875196871,-80.6894302368164,12);cityCenters[23]=new Array(28.144659671673157,-80.6887435913086,12);cityCenters[24]=new Array(28.17795458325142,-80.65715789794922,12);cityCenters[25]=new Array(28.131036041480442,-80.64823150634765,12);cityCenters[26]=new Array(28.082885345939864,-80.62625885009765,12);cityCenters[27]=new Array(28.075312516072422,-80.68462371826172,12);cityCenters[28]=new Array(28.023803118321453,-80.62179565429687,12);cityCenters[29]=new Array(28.014710664038,-80.65853118896484,12);cityCenters[30]=new Array(27.970752981490662,-80.58780670166015,11);cityCenters[31]=new Array(27.962565778543535,-80.6509780883789,12);cityCenters[32]=new Array(28.017741567446105,-80.70144653320312,12);cityCenters[33]=new Array(27.96620461209675,-80.6949234008789,12);cityCenters[34]=new Array(27.916766641249062,-80.69698333740234,12);cityCenters[35]=new Array(27.873376057315617,-80.65750122070312,12);cityCenters[36]=new Array(27.890977132192393,-80.52360534667969,12);cityCenters[37]=new Array(28.184007090561987,-80.62694549560547,12);cityCenters[38]=new Array(28.198531710310906,-80.60497283935547,13);cityCenters[39]=new Array(28.168875180063345,-80.59810638427734,13);cityCenters[40]=new Array(28.115896643091606,-80.57991027832031,13);cityCenters[41]=new Array(28.07500959177158,-80.56411743164062,13);cityCenters[42]=new Array(27.983790577690165,-80.52051544189453,12);cityCenters[43]=new Array(29.008140362978157,-80.92254638671875,9);cityCenters[44]=new Array(28.570049879647403,-81.309814453125,9);cityCenters[45]=new Array(28.256005619824972,-81.2493896484375,9);cityCenters[46]=new Array(27.661636331915247,-80.41717529296875,10);cityCenters[47]=new Array(28.20760859532738,-81.54052734375,6);function getCorners(){corners=new Array();bounds=map.getBounds();southWest=bounds.getSouthWest();northEast=bounds.getNorthEast();corners[0]=southWest.lat();corners[1]=northEast.lat();corners[2]=southWest.lng();corners[3]=northEast.lng();return corners;}
function createMarker(point,addhtml,icon){var marker=new GMarker(point,markerOptions[icon]);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(addhtml);});return marker;}
function getFormValues(){values=new Array();pf=document.getElementById("pricefrom");pt=document.getElementById("priceto");typ=document.getElementById("propertytype");bd=document.getElementById("beds");bt=document.getElementById("baths");ct=document.getElementById("citylist");values[0]=pf.value;values[1]=pt.value;values[2]=typ.value;values[3]=bd.value;values[4]=bt.value;values[5]=ct.value;return values;}
function markCount(count){df=document.getElementById("messagebarvalue");df.innerHTML=count;}
function markXML(control){var control=new addLoading();map.addControl(control);corners=getCorners();values=getFormValues();GDownloadUrl("http://www.myfloridahomesforsale.com/mls-new/mq.php?latmin="+corners[0]+"&latmax="+corners[1]+"&lngmin="+corners[2]+"&lngmax="+corners[3]+"&city="+values[5]+"&pricefrom="+values[0]+"&priceto="+values[1]+"&propertytype="+values[2]+"&beds="+values[3]+"&baths="+values[4],function(data,responseCode){var xml=GXml.parse(data);var markers=xml.documentElement.getElementsByTagName("marker");var count=xml.documentElement.getElementsByTagName("count");countres=count[0].getAttribute("value");markCount(countres);for(var i=0;i<markers.length;i++){var point=new GLatLng(parseFloat(markers[i].getAttribute("lat")),parseFloat(markers[i].getAttribute("lng")));map.addOverlay(createMarker(point,markers[i].getAttribute("addhtml"),markers[i].getAttribute("icon")));}
map.removeControl(control);});}
function reloadMap(){map.clearOverlays();markXML();}
function condReloadMap(){ct=document.getElementById("citylist");ct=ct.value;map.setCenter(new GLatLng(cityCenters[ct][0],cityCenters[ct][1]),cityCenters[ct][2]);reloadMap();}
function loadMap(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.addControl(new GLargeMapControl());map.setCenter(new GLatLng(28.2172,-80.6815),10);map.addControl(new GMapTypeControl());var baseIcon=new GIcon();baseIcon.shadow="http://www.myfloridahomesforsale.com/mls-new/icons/shadow.png";baseIcon.iconSize=new GSize(28,36);baseIcon.shadowSize=new GSize(38,30);baseIcon.iconAnchor=new GPoint(10,30)
baseIcon.infoWindowAnchor=new GPoint(18,15);iconPurple=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/4.png");iconWhite=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/10.png");iconBrown=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/7.png");iconBlue=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/6.png");iconGreen=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/5.png");iconOrange=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/2.png");iconRed=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/8.png");iconYellow=new GIcon(baseIcon,"http://www.myfloridahomesforsale.com/mls-new/icons/9.png");markerOptions=new Array();markerOptions[0]={icon:iconPurple};markerOptions[1]={icon:iconWhite};markerOptions[2]={icon:iconBrown};markerOptions[3]={icon:iconBlue};markerOptions[4]={icon:iconGreen};markerOptions[5]={icon:iconOrange};markerOptions[6]={icon:iconRed};markerOptions[7]={icon:iconYellow};GEvent.addListener(map,"dragend",function(){reloadMap();});GEvent.addListener(map,"zoomend",function(oldLevel,newLevel){reloadMap();});reloadMap();}}
window.onload=loadMap;function addLoading(){}
addLoading.prototype=new GControl(false,false);addLoading.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(300,223));};addLoading.prototype.initialize=function(map){var container=map.getContainer();var c=document.createElement("div");c.innerHTML="<img src=\"http://www.myfloridahomesforsale.com/mls-new/output.gif\" width=\"300px\" height=\"151px\"/>";container.appendChild(c);return c;}
window.onunload=GUnload;