//= 5.5) && (document.body.filters)) { var img = document.images['mcontrol'] var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText if (img.align == "left") imgStyle = "float:left;" + imgStyle if (img.align == "right") imgStyle = "float:right;" + imgStyle if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle var strNewHTML = "" img.outerHTML = strNewHTML } } initsrch=true; forceAreas('madriver'); } } function updateMap(){ if (loading){return;} loading=true; //if (moved){GEvent.removeListener(moved);} map.clearOverlays(); batch = []; markerinfo= []; //mgr = new GMarkerManager(map); map.disableDragging(); //if (!initsrch){lookurl = $('mapsearchform').serialize();}else{lookurl="newmapsearch=1";} lookurl = $('mapsearchform').serialize(); loading=true; $("busyoverlay").style.visibility = 'visible'; $("searching").style.visibility = 'visible'; GDownloadUrl("/mapsearch/searchresults?"+lookurl, function(data, responseCode) { var xml = GXml.parse(data); markers = xml.documentElement.getElementsByTagName("marker"); bounds = new GLatLngBounds(); for (var i = 0; i < markers.length; i++) { if (!isNaN(parseFloat(markers[i].getAttribute("lat"))) && !isNaN(parseFloat(markers[i].getAttribute("lng")))){ var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var markerinfoin = []; markerinfoin['lat'] = markers[i].getAttribute("lat"); markerinfoin['lng'] = markers[i].getAttribute("lng"); markerinfoin['id'] = markers[i].getAttribute("id"); markerinfoin['upd'] = markers[i].getAttribute("upd"); markerinfoin['name'] = markers[i].getAttribute("name"); markerinfoin['city'] = markers[i].getAttribute("city"); markerinfoin['price'] = markers[i].getAttribute("price"); markerinfoin['img'] = markers[i].getAttribute("img"); markerinfoin['beds'] = markers[i].getAttribute("beds"); markerinfoin['baths'] = markers[i].getAttribute("baths"); markerinfoin['sqft'] = markers[i].getAttribute("sqft"); markerinfoin['acre'] = markers[i].getAttribute("acre"); markerinfoin['type'] = markers[i].getAttribute("type"); markerinfoin['ihtml'] = markers[i].childNodes[0].childNodes[0].nodeValue; markerinfo.push(markerinfoin); bounds.extend(point); var marker = creatMarker(point,batch.length); map.addOverlay(marker); batch.push(marker); } } loading=false; if (map.getBoundsZoomLevel(bounds) > 0 && markerinfo.length > 0){ map.setCenter(bounds.getCenter()); map.setZoom(map.getBoundsZoomLevel(bounds)); createListHTML(); }else if (markerinfo.length==0){ //alert('No properties were found matching your search.\nPlease change your criteria and try again.'); } map.enableDragging(); $("searching").style.visibility = 'hidden'; $("busyoverlay").style.visibility = 'hidden'; });//end gdownload markers } function showInfoWin(id){ $("menu_bar_infowin").innerHTML = markerinfo[id]['ihtml']; $("menu_bar_infowin").style.display = 'inline'; } function hideInfoWin(){$("menu_bar_infowin").style.display = 'none';} function showSrchWin(){ map.closeInfoWindow(); $("srchbar").style.display = 'block'; $("resbar").style.display = 'none'; $("tab_mapsearch").setAttribute("class", "active"); $("tab_mapsearch").setAttribute("className", "active"); $("tab_mapresults").setAttribute("class", "inactive"); $("tab_mapresults").setAttribute("className", "inactive"); } function showResWin(){ $("srchbar").style.display = 'none'; $("resbar").style.display = 'inline'; $("tab_mapsearch").setAttribute("class", "inactive"); $("tab_mapsearch").setAttribute("className", "inactive"); $("tab_mapresults").setAttribute("class", "active"); $("tab_mapresults").setAttribute("className", "active"); } function hideSrchWin(){$("srchbar").style.display = 'none';} function showDetailWin(id){document.location.href='/search/detail/'+markerinfo[id]['id']; } function switchOptions(n){ switch(n) { case 'residential': $("mhomes").style.display = 'none'; $("acre").style.display = 'block'; $("homes").style.display = 'block'; break; case 'multi_family': $("homes").style.display = 'none'; $("acre").style.display = 'none'; $("mhomes").style.display = 'block'; break; case 'land': $("homes").style.display = 'none'; $("mhomes").style.display = 'none'; $("acre").style.display = 'block'; } } function creatMarker(point,id) { // Tom changed this line to restore the stock marker // if (markerinfo[id]['bhlisting']=='true'){var marker = new GMarker(point,bhicon);}else{var marker = new GMarker(point,gicon);} if (markerinfo[id]['bhlisting']=='true'){var marker = new GMarker(point);}else{var marker = new GMarker(point);} GEvent.addListener(marker, "mouseover", function() {showInfoWin(id);}); GEvent.addListener(marker, "mouseout", function() {hideInfoWin();}); GEvent.addListener(marker, "click", function() {showDetailWin(id);}); return marker; } function listrowOn(lr,id){ //map.removeOverlay(polyline);map.removeOverlay(polyline2); lr.style.backgroundColor='#ffff99'; var winhtml="
| Address: | List Price: | Beds: | Baths: | Sq. Ft: | Acreage: | MLS #: |
| " + markerinfo[xx]['name'] +" | "; lhtml += "$" + markerinfo[xx]['price'] +" | "; lhtml += "" + markerinfo[xx]['beds'] +" | "; lhtml += "" + markerinfo[xx]['baths'] +" | "; lhtml += "" + markerinfo[xx]['sqft'] +" | "; lhtml += "" + markerinfo[xx]['acre'] +" | "; lhtml += "" + markerinfo[xx]['upd'] +" | "; lhtml += "

";
c.innerHTML+="";
c.innerHTML+="";
c.innerHTML+="";
c.innerHTML+="";
c.innerHTML+="";
c.innerHTML+="";
//c.innerHTML+="";
container.appendChild(c);
GEvent.addDomListener($('zout'), "click", function() {map.zoomOut();});
GEvent.addDomListener($('zin'), "click", function() {map.zoomIn();});
GEvent.addDomListener($('panl'), "click", function() {map.panDirection(1, 0);});
GEvent.addDomListener($('panr'), "click", function() {map.panDirection(-1, 0);});
GEvent.addDomListener($('panu'), "click", function() {map.panDirection(0, 1);});
GEvent.addDomListener($('pand'), "click", function() {map.panDirection(0, -1);});
//GEvent.addDomListener($('srch'), "click", function() {showSrchWin();});
return c;
}
function addRegionOverlay(name) {
overlay_polygon = new GPolygon(points[name], "#0000ff", 2, 1, "#ff0000", 0.0);
map.addOverlay(overlay_polygon);
}
function forceAreas(which) {
if (typeof which== 'undefined') {
which = 'madriver';
}
if (which=='burlington') {
var sel_areas = ['Alburg', 'Bolton', 'Burlington', 'Charlotte', 'Colchester', 'Essex Junction', 'Essex', 'Grand Isle', 'Hinesburg', 'Huntington', 'Jericho Village', 'Jericho', 'Richmond-Chittenden', 'Richmond', 'Shelburne', 'South Burlington', 'North Hero', 'South Hero', 'St. George', 'Underhill', 'Williston', 'Winooski'];
} else if (which=='waterbury') {
var sel_areas = ['Morristown', 'Stowe', 'Waterbury'];
} else if (which=='montpelier') {
var sel_areas = ['Berlin', 'East Montpelier', 'Middlesex', 'Montpelier', 'Northfield Village', 'Northfield', 'Roxbury-Washington', 'Roxbury'];
} else if (which=='middlebury') {
var sel_areas = ['Addison', 'Bristol', 'Bristol-Addison', 'Buels Gore', 'Buel\'s Gore', 'Ferrisburg', 'Ferrisburgh', 'Granville', 'Hancock', 'Lincoln', 'Middlebury', 'Monkton', 'New Haven', 'Panton', 'Pittsfield', 'Ripton', 'Rochester', 'Starksboro', 'Vergennes', 'Waltham', 'Weybridge'];
} else {
var sel_areas = ['Duxbury', 'Fayston', 'Moretown', 'Waitsfield', 'Warren'];
}
obj = document.getElementById('my_regions');
for (i=0; i