function GetRealEstetaJSONDate(jData){try{var markers=mapdata.markers;for(var i=0;i<markers.length;i++){id=i;var Property=null;try{Property=markers[i].Property;if(Property!=''){MAPBUILDER.widget.MapObject.Ref.markers[id].Property=Property;}
else
MAPBUILDER.widget.MapObject.Ref.markers[id].Property=null;}
catch(e){}}}
catch(e){}}
function onMarkerClick(id,point,html,iconname){try{document.getElementById('dImg').innerHTML='';document.getElementById('dImages').innerHTML='';var Property=MAPBUILDER.widget.MapObject.Ref.markers[id].Property;if(Property!=null){try{var images=Property.Images;for(var i=0;i<images.length;i++){if(i==0)addImg('dImg','<img src="'+images[i].ImageUrl+'" alt="Image">')
addImg('dImages','<img src="'+images[i].ImageUrl+'" alt="Image">')}}
catch(e){}
var addr=buildAddrStr(MAPBUILDER.widget.MapObject.Ref.markers[id].address,MAPBUILDER.widget.MapObject.Ref.markers[id].city,MAPBUILDER.widget.MapObject.Ref.markers[id].zip,MAPBUILDER.widget.MapObject.Ref.markers[id].state,MAPBUILDER.widget.MapObject.Ref.markers[id].country);document.getElementById('dFeatures').style.display='none';setText('dTitle',MAPBUILDER.widget.MapObject.Ref.markers[id].name);setText('dAddress',addr);setText('dDescription',MAPBUILDER.widget.MapObject.Ref.markers[id].description);setText('dPrice',Property.Currency+'&nbsp;'+MAPBUILDER.util.formatNumber(Property.Price));setText('dShortInfo',Property.Bedrooms+' BR, '+Property.Bathrooms+' Bath');setText('Type',Property.Type+', '+Property.Status);setText('BuildDate',Property.BuildDate);setText('Bedrooms',Property.Bedrooms);setText('Bathrooms',Property.Bathrooms);setText('Garage',Property.Garage);setText('GarageCars',Property.GarageCars);setText('Stories',Property.Stories);setText('Square',Property.Square+", "+Property.Unit);setText('Notes',Property.Notes);setText('Pool',Property.Pool);try{setText('LotSize',Property.LotSize);}catch(e){}
try{setText('ZoningType',Property.ZoningType);}catch(e){}
try{setText('WaterType',Property.WaterType);}catch(e){}
try{setText('Appliances',Property.Appliances);}catch(e){}
try{setText('SchoolDistrict',Property.SchoolDistrict);}catch(e){}
try{setText('MLS',Property.MLS);}catch(e){}
try{setText('Taxes',Property.Taxes);}catch(e){}
try{setBool('UndergroundSprinklers',Property.UndergroundSprinklers);}catch(e){}
try{setBool('CentralVacuum',Property.CentralVacuum);}catch(e){}
setBool('AC',Property.AC);setBool('Spa',Property.Spa);setBool('Fireplace',Property.Fireplace);setBool('MasterBedroom',Property.MasterBedroom);setBool('DiningRoom',Property.DiningRoom);setBool('Library',Property.Library);setBool('SeparateFamilyRoom',Property.SeparateFamilyRoom);setBool('SeparateLivingUnit',Property.SeparateLivingUnit);setBool('Basement',Property.Basement);if(MAPBUILDER.widget.MapObject.Ref.markers[id].Property.Type=='Lot/Land'||MAPBUILDER.widget.MapObject.Ref.markers[id].Property.Type=='Commercial'){document.getElementById('dFeatures').style.display='none';document.getElementById('dShortInfo').style.display='none';}
else{document.getElementById('dFeatures').style.display='block';document.getElementById('dShortInfo').style.display='block';}}
document.getElementById('propertyInfoNo').style.display='none';document.getElementById('propertyInfo').style.display='block';tabbedPane.set('detail');}
catch(e){}}
function onRenderMarkers(){if(MAPBUILDER.widget.MapObject.Ref.sideBar){MAPBUILDER.widget.MapObject.Ref.divs['sideBar'].innerHTML="";}
var html,price,tmpHtml;tmpHtml='';for(var i=0;i<MAPBUILDER.widget.MapObject.Ref.markers.length;i++){if(!MAPBUILDER.widget.MapObject.Ref.markers[i].visible)continue;try{price=MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Price.substring(0,MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Price.length-3);html=MAPBUILDER.util.trunkStr(MAPBUILDER.widget.MapObject.Ref.markers[i].name,20);if(MAPBUILDER.widget.MapObject.Ref.sideBar){tmpHtml+='<tr><td>'+MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Currency;tmpHtml+=((price=='')?'0':price)+"K</td><td>"+"<a href='javascript:MAPBUILDER.event.infoLink("+i+");'>"+html+"</a><br>";tmpHtml+='</td></tr>';}}
catch(e){}}
if(tmpHtml!=''){document.getElementById('sidebarHeader').innerHTML='<table><tbody><thead><tr><th>Price</th><th>Description</th></tr></thead></tbody></table>';tmpHtml='<table><tbody>'+tmpHtml+'</tbody></table>';}
MAPBUILDER.widget.MapObject.Ref.divs['sideBar'].innerHTML=tmpHtml;}
function onCreateMarker(id,marker){var images=MAPBUILDER.widget.MapObject.Ref.markers[id].Property.Images;var imgTag='';for(var i=0;i<images.length;i++){if(i==0)imgTag='<img src="'+images[i].ImageUrl+'" alt="Image">';}
marker.setTooltip(MAPBUILDER.widget.MapObject.Ref.markers[id].Property.Currency+MAPBUILDER.util.formatNumber(MAPBUILDER.widget.MapObject.Ref.markers[id].Property.Price)+"<br/>"+imgTag);marker.setOpacity(100);return marker;}
function showPropertyInfo(id){alert("showPropertyInfo"+id);}
function buildAddrStr(a,c,z,s,co){var addr=(a=='')?'':(a+'<br />');addr=(addr=='')?((c=='')?'':c):(addr+((c=='')?'':(c+', ')));addr=(addr=='')?((s=='')?'':s):(addr+((s=='')?'':(s+' ')));addr=(addr=='')?((z=='')?'':z):(addr+((z=='')?'':(z)));return addr;}
function addImg(id,value){document.getElementById(id).innerHTML=(document.getElementById(id).innerHTML=='')?value:(document.getElementById(id).innerHTML+"<br />"+value);}
function setText(id,value){try{document.getElementById(id).innerHTML=value;}catch(e){}}
function setBool(id,value){try{document.getElementById(id).innerHTML=(value=='1')?'Y':'N';}catch(e){}}
function appLayoutSize(){var clientWidth=document.body.clientWidth;var cliHeight=document.body.clientHeight;var d=550;var dd=22;var widthPx=(clientWidth-d)+"px";var widthPx2=(clientWidth-d-dd)+"px";if((clientWidth-d)<250){var widthPx="250px";var widthPx2="228px";}
document.getElementById("content").style.width=clientWidth+"px";document.getElementById("mapColumn").style.width=widthPx;document.getElementById("tabbedPane2").style.width=widthPx;document.getElementById("mapcontainer").style.width=widthPx2;}
function resizeMap(){appLayoutSize();MyMapObject.onResize();}
function doSearch(){document.getElementById('statusBar').innerHTML='Searching...';try{var isHouse=document.getElementById('House').checked;}catch(e){var isHouse=false;}
try{var isCondo=document.getElementById('Condo').checked;}catch(e){var isCondo=false;}
try{var isApartment=document.getElementById('Apartment').checked;}catch(e){var isApartment=false;}
try{var isLot=document.getElementById('Lot').checked;}catch(e){var isLot=false;}
try{var isFarm=document.getElementById('Farm').checked;}catch(e){var isFarm=false;}
try{var isCommercial=document.getElementById('Commercial').checked;}catch(e){var isCommercial=false;}
try{var isAny=document.getElementById('Any').checked;}catch(e){var isAny=false;}
var intMinBedrooms=MAPBUILDER.util.toInt(MAPBUILDER.util.getRadioValue(document.getElementById('F').MinBedrooms));var fMinBathrooms=MAPBUILDER.util.toFloat(MAPBUILDER.util.getRadioValue(document.getElementById('F').MinBathrooms));var intMinPrice=MAPBUILDER.util.toInt(document.getElementById('MinPrice').options[document.getElementById('MinPrice').selectedIndex].value);var intMaxPrice=MAPBUILDER.util.toInt(document.getElementById('MinPrice').options[document.getElementById('MaxPrice').selectedIndex].value);var price,bedrooms,bathrooms;var nFound=0;for(var i=0;i<MAPBUILDER.widget.MapObject.Ref.markers.length;i++){try{MAPBUILDER.widget.MapObject.Ref.markers[i].visible=true;price=MAPBUILDER.util.toInt(MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Price);bedrooms=MAPBUILDER.util.toInt(MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Bedrooms);bathrooms=MAPBUILDER.util.toFloat(MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Bathrooms);if(price<intMinPrice){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(intMaxPrice>0&&price>intMaxPrice){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isAny){if(!isHouse&&MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='House'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isCondo&&(MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Condo'||MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Townhouse')){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isApartment&&MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Apartment'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isLot&&MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Lot/Land'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isFarm&&MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Farm'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(!isCommercial&&MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Commercial'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
if(MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Multi-Family'||MAPBUILDER.widget.MapObject.Ref.markers[i].Property.Type=='Other'){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}}
if(intMinBedrooms!=0){if(intMinBedrooms<5&&bedrooms<intMinBedrooms){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
else
if(intMinBedrooms>=5&&bedrooms<intMinBedrooms){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}}
if(intMinBedrooms!=0){if(intMinBedrooms<3&&bathrooms<fMinBathrooms){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}
else
if(intMinBedrooms>=3&&bathrooms<fMinBathrooms){MAPBUILDER.widget.MapObject.Ref.markers[i].visible=false;continue;}}
nFound++;}
catch(e){}}
document.getElementById('statusBar').innerHTML=nFound+' locations found.';MAPBUILDER.widget.MapObject.Ref.renderMarkers();}
