
	function homesMap(){

    if (GBrowserIsCompatible()) {
      var side_bar_html = "";
      var gmarkers = [];
      var htmls = [];
      var i = 0;

      // Create some custom icons

      // This icon uses the same shape as the default Google marker
      // So we can use its details for everything except the image
      var Icon1 = new GIcon();
      Icon1.image = "images/marker_2.gif";
      Icon1.shadow = "http://www.google.com/mapfiles/shadow50.png";
      Icon1.iconSize = new GSize(40, 40);
      Icon1.shadowSize = new GSize(37, 34);
      Icon1.iconAnchor = new GPoint(9, 34);
      Icon1.infoWindowAnchor = new GPoint(9, 2);
      Icon1.infoShadowAnchor = new GPoint(18, 25);
      Icon1.transparent = "http://www.google.com/intl/en_ALL/mapfiles/markerTransparent.png";
      Icon1.printImage = "images/marker_2.gif";
      Icon1.mozPrintImage = "images/marker_2.gif";
	  Icon1.title = "Property Details";

	  var Icon2 = new GIcon();
      Icon2.image = "images/marker_1.gif";
      Icon2.shadow = "http://www.google.com/mapfiles/shadow50.png";
      Icon2.iconSize = new GSize(40, 40);
      Icon2.shadowSize = new GSize(37, 34);
      Icon2.iconAnchor = new GPoint(9, 34);
      Icon2.infoWindowAnchor = new GPoint(9, 2);
      Icon2.infoShadowAnchor = new GPoint(18, 25);
      Icon2.transparent = "http://www.google.com/intl/en_ALL/mapfiles/markerTransparent.png";
      Icon2.printImage = "images/marker_2.gif";
      Icon2.mozPrintImage = "images/marker_2.gif";
	  Icon2.title = "Property Details";

      // An array of GIcons, to make the selection easier
      var icons = [];
	  icons[0] = Icon1;
	  icons[1] = Icon2;


      // the icon information is passed to this function
      function createMarker(point,name,html,icontype) {
        var marker = new GMarker(point,icons[icontype]);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
		gmarkers[i].title = "Property Details";
        htmls[i] = html;
        // add a line to the side_bar html
        side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
        i++;
        return marker;
      }

      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }

      var map = new GMap2(document.getElementById("googlemap"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(aLat, aLong), zoom);

      // Read the data from custom.xml
      var request = GXmlHttp.create();
      request.open("GET", region, true);
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          var xmlDoc = GXml.parse(request.responseText);
          // obtain the array of markers and loop through it
          var markers = xmlDoc.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            // obtain the attribues of each marker
            var lat = parseFloat(markers[i].getAttribute("lat"));
            var lng = parseFloat(markers[i].getAttribute("lng"));
			//var lat = 53.391109;
            //var lng = -2.847776;
            var point = new GLatLng(lat,lng);
			var html = [];
			var image = markers[i].getAttribute("image");
			var road = markers[i].getAttribute("road");
			var town = markers[i].getAttribute("town");
			var city = markers[i].getAttribute("city");
			var pcode = markers[i].getAttribute("pcode");
			var bungalow = markers[i].getAttribute("bungalow");
			var house = markers[i].getAttribute("house");
			var apartment = markers[i].getAttribute("apartment");
			var propid = markers[i].getAttribute("propid");
			html[i] += '<div style="width:200px; height:200px; overflow:auto; background-color:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#006B74; border:solid 1px #5CA3AC; padding:5px;" ><div style="height:75px;">';
			if(image==""){}else{
				html[i] += '<img src="phpThumb/phpThumb.php?src=../photos/'+image+'&w=75&h=75&zc=1&q=90" width="75" style="margin:0 5px 0 0; float:left; width:75px;">';
			}
			html[i] += '<div style="width:110px; float:left;">'+road+'<br />';
			html[i] += '<br />'+town+'';
			html[i] += '<br />'+city+' '+pcode+'<br />';
			html[i] += '</div></div>';
			html[i] += '<strong>Home Types Available</strong><div style="height:50px; width:200px;">';
			if(bungalow==1){
				html[i] += '<img src="images/icon_bungalow.jpg" align="left"/>';
			}
			if(house==1){
				html[i] += '<img src="images/icon_house.jpg" width="50" height="50" align="left"/>';
			}
			if(apartment==1){
				html[i] += '<img src="images/icon_apartment.jpg"  align="left"/>';
			}
			html[i] += '</div>';
			html[i] += '<br /><a href="property_details.php?id='+propid+'">More details &raquo;</a><br /><a href="contact_us.php">Contact us &raquo;</a></div>';
            //var html = markers[i].getAttribute("html");
			//var html = '<div style="width:200px; height:200px; overflow:auto; background-color:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#006B74; border:solid 1px #5CA3AC; padding:5px;" ><div style="height:75px;"><img src="images/image_example.jpg" width="75" style="margin:0 5px 0 0; float:left; width:75px;"><strong>Ringway Road<br /><br />Netherly<br />Liverpool L25</strong><br /></div><strong>Home Types Available</strong><div style="height:50px; width:200px;"> <img src="images/icon_bungalow.jpg" align="left"/> <img src="images/icon_house.jpg" width="50" height="50" align="left"/> <img src="images/icon_apartment.jpg"  align="left"/> </div> <br /><a href="property_details.php">More details &raquo;</a><br /><a href="contact_us.php">Contact us &raquo;</a></div>';
            var label = road+", "+town;
			//var label = 'Ringway Road, Liverpool';
            var icontype = parseInt(markers[i].getAttribute("icontype"));
			//var icontype = 0;
            // create the marker
            var marker = createMarker(point,label,html[i],icontype);
            map.addOverlay(marker);
          }
        }
      }
      request.send(null);
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}


