    //<![CDATA[

    // set up vars
    var selectproptext = 'Select a Property';	// text that appears in the property dropdown
    var propselectzoom = 12;		// zoom level to use when selecting property from dropdown

    var zoomlimit = new Array();	// set zoom constraints
	zoomlimit.min = 6;		// zoom out limit
	zoomlimit.max = 14;		// zoom in limit

    var zoomarea_data = new Array();	// region select lat/lng/zoom values
	zoomarea_data['default']	= new Array(44.1500, -74.0000, 6);
	zoomarea_data["northeast"]	= new Array(44.1500, -74.0000, 6);
	zoomarea_data["CT"]		= new Array(41.6667, -72.6801, 9);
	zoomarea_data["MA"]		= new Array(42.1593, -71.7297, 8);
	zoomarea_data["ME"]		= new Array(45.3675, -69.1040, 6);
	zoomarea_data["NH"]		= new Array(43.4050, -71.6144, 8);
	zoomarea_data["NJ"]		= new Array(40.4511, -74.4928, 8);
	zoomarea_data["PA"]		= new Array(40.9467, -77.0471, 7);
	zoomarea_data["RI"]		= new Array(41.7036, -71.4935, 9);


    // set up global vars (do not change any vars below this line)
    var map;
    var mgr;
    var xml;
    var markers;
    var mhandle = new Array();
    var pidlist = new Array();

    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

	// set lat/lon to center map, and set default zoom level
        map.setCenter(new GLatLng(zoomarea_data['default'][0], zoomarea_data['default'][1]), zoomarea_data['default'][2]);
	map.enableContinuousZoom();

        mgr = new GMarkerManager(map);

        // Create a base icon for all of our markers that specifies the
        // shadow, icon dimensions, etc.
        var baseIcon = new GIcon();
        //baseIcon.shadow = "global/img/shadow.png";
        baseIcon.iconSize = new GSize(37, 34);
        //baseIcon.shadowSize = new GSize(37, 34);
        baseIcon.iconAnchor = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(18, 34);
        //baseIcon.infoShadowAnchor = new GPoint(18, 25);

        var basepinIcon = new GIcon();
//        basepinIcon.shadow = "global/img/ws_pin.png";
        basepinIcon.iconSize = new GSize(37, 34);
//        basepinIcon.shadowSize = new GSize(38, 22);
        basepinIcon.iconAnchor = new GPoint(9, 34);
        basepinIcon.infoWindowAnchor = new GPoint(18, 34);
//        basepinIcon.infoShadowAnchor = new GPoint(18, 25);

	// zoom restriction function
	// Get the list of map types      
	var mt = map.getMapTypes();
	// Overwrite the getMinimumResolution() and getMaximumResolution() methods
	for (var i=0; i<mt.length; i++) {
	  mt[i].getMinimumResolution = function() {return zoomlimit.min;}
	  mt[i].getMaximumResolution = function() {return zoomlimit.max;}
	}


        // Creates a marker whose info window displays the letter corresponding
        // to the given index.
        function createMarker(i, point, pid, pn, ct, st, zip, ad, gla, loc) {
          // Create a lettered icon for this point using our icon class
//          var letter = String.fromCharCode("A".charCodeAt(0) + index);  
          var icon = new GIcon(baseIcon);
          icon.image = "global/img/ws_pin.png";
          var icon_pin = new GIcon(basepinIcon);
          icon_pin.image = "global/img/ws_pin.png";
          var marker = new GMarker(point, icon);
          var marker_pin = new GMarker(point, icon_pin);
          mgr.addMarker(marker_pin, 6, 8);
          mgr.addMarker(marker, 9, 14);
          //mgr.refresh();


          GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(getMarkerInfo(i));
		});
          GEvent.addListener(marker_pin, "click", function() {
		marker_pin.openInfoWindowHtml(getMarkerInfo(i));
		});

	  var mh = [marker, marker_pin];

	  return mh;
	}

// Read the data from data.xml and load markers on the map. The format we expect is:
// <markers>
//   <marker lat="41.8238" lng="-72.8833" pid="1" pn="The Shoppes at Farmington Valley" gla="420000" loc="Routes 44 and 177" ad="100 Albany Turnpike" ct="Canton" st="CT" zip="06019" />
// </markers>

GDownloadUrl("global/xml/data.xml", function(data, responseCode) {
  xml = GXml.parse(data);
  markers = xml.documentElement.getElementsByTagName("marker");
  for (var i = 0; i < markers.length; i++) {
    var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                            parseFloat(markers[i].getAttribute("lng")));
    var pid = markers[i].getAttribute("pid");
    var pn = markers[i].getAttribute("pn");
    var ct = markers[i].getAttribute("ct");
    var st = markers[i].getAttribute("st");
    var zip = markers[i].getAttribute("zip");
    var ad = markers[i].getAttribute("ad");
    var gla = markers[i].getAttribute("gla");
    var loc = markers[i].getAttribute("loc");
    mhandle[i] = createMarker(i, point, pid, pn, ct, st, zip, ad, gla, loc);
    //mgr.addOverlay(mhandle[i]);
    addPropertySelect(i,pid,pn,st);
  }
  populatePropertySelect('all');
});

      }
    }

	// build info html for any marker
	function getMarkerInfo(i) {
	  var pid = markers[i].getAttribute("pid");
	  var pn = markers[i].getAttribute("pn");
	  var ct = markers[i].getAttribute("ct");
	  var st = markers[i].getAttribute("st");
	  var zip = markers[i].getAttribute("zip");
	  var ad = markers[i].getAttribute("ad");
	  var gla = markers[i].getAttribute("gla");
	  var loc = markers[i].getAttribute("loc");

	  var printme = "";
	  printme +="<div class=\"map_properties_centername\">";
	  if (pn == "") {
	    printme += ct + ", " + st;
	  } else {
	    printme += "<a href=\"http://www.wsdevelopment.com/property.asp?property=" + pid + "\" target=\"_self\" class=\"map_properties_centername\"><b>" + pn + "</b></a>";
	  }
	  printme += "</div><div class=\"map_properties_details_txt\">";
	  if (gla == "") {
	    printme += "";
	  } else {
	    printme += "GLA: "+gla+" S.F." + "<br>";
	  }

	  if (loc == "") {
	    printme +=""; 
	  } else {
	    printme +=loc +"<br>";
	  }

	  if (ad == "") {
	    printme += "" ;
	  } else {
	    printme += ad + "<br>";
	  }

	  printme += ct + ", " + st + " ";

	  if (zip == ""){
	    printme += "<br>" ;
	  } else {
	    printme += zip+"<br>";
	  }

	  printme +="For more information about this property, click <a href=\"http://www.wsdevelopment.com/property.asp?property=" + pid + "\" target=\"_self\" class=\"map_properties_details_link\">here.</a>";

	  return printme;
	}

	// relocate map area to ( (lat,lng) , zoom )
	function moveMap(center, zoom){
	  if (map.getZoom() != zoom){
	    map.setCenter(center, zoom);
	  } else {
	    map.panTo(center);
	  }
	}

	function showProperty(index) {
	  if (map.getZoom() <= 8) {
	    mhandle[index][1].openInfoWindowHtml(getMarkerInfo(index));
	  } else {
	    mhandle[index][0].openInfoWindowHtml(getMarkerInfo(index));
	  }
	  moveMap(new GLatLng(markers[index].getAttribute("lat"), markers[index].getAttribute("lng")), propselectzoom); 
	}

	function addPropertySelect(index, id, name, state) {
	  if (name.length == 0) {
	    name = 'Property #' + id + ' (no name)';
	  }
	  pidlist.push(name + '|' + index + '|' + state);
	}

	function populatePropertySelect(area) {
	  var pDrop = document.control.propertysel;
	  var pDropText = selectproptext;
	  var isState = 0;
	  if (area.length == 2) { isState = 1; pDropText += ' in ' + area; }
	  pDrop.options.length = 0;
  	  pDrop.options[0] = new Option(pDropText + '...','');
	  pidlist.sort();
	  for (var i=0; i<pidlist.length-1;i++){
	    var values = pidlist[i].split('|');
	    if (isState) {
	      if (area != values[2]) { continue; }
	    }
	    pDrop.options[pDrop.options.length] = new Option(values[0],values[1]);
	  }
	}

	function changeArea() {
	  var areaselect = document.control.areasel;
	  var areadestination = areaselect.options[areaselect.selectedIndex].value;
	  if (areadestination) {
	    moveMap(new GLatLng(zoomarea_data[areadestination][0], zoomarea_data[areadestination][1]), zoomarea_data[areadestination][2]);
	    populatePropertySelect(areadestination);
	  }
	}

	function changeProperty() {
	  var propertyselect = document.control.propertysel;
	  var propertydestination = propertyselect.options[propertyselect.selectedIndex].value;
	  if (propertydestination) {
	    showProperty(propertydestination);
	  }
	}

	function resetMap() {
	  document.control.areasel.selectedIndex = 0;
	  document.control.propertysel.selectedIndex = 0;
	  map.closeInfoWindow();
	  changeArea('default');
	}