function centerOn(i)
{
//  map.removeTLabel(labels[i]);
  b=document.getElementById('label'+i);
  b.style.zIndex = 20;
  b.firstChild.className = "hood-tag-selected";
  if(selected_attraction != null && selected_attraction != b){
	selected_attraction.style.zIndex = 1;
	selected_attraction.firstChild.className = "hood-tag";
  }
  selected_attraction = b;
  map.centerAndZoom(labels[i].anchorLatLng, map.getZoomLevel());
}
String.prototype.reduce=function(l,p)
{
  if(this.length>l)
    return this.substring(0,l-2)+p;
  else
    return this;
    
}
function importXML()
{
  // Read the data from example.xml
      var request = GXmlHttp.create();
      request.open("GET", rootpath+"cache/"+filename+".xml", true);
      request.onreadystatechange = function() 
      {
        if (request.readyState == 4) 
        {
          var xmlDoc = request.responseXML;
          var markers = xmlDoc.documentElement.getElementsByTagName("marker");
          
          for (var i = 0; i < markers.length; i++) 
          {
             lat = parseFloat(markers[i].getAttribute("lat"));
             lng = parseFloat(markers[i].getAttribute("long"));
             sho = markers[i].getAttribute("name");
             link = markers[i].getAttribute("link");
             point = new GPoint(lng,lat);
             linkname= link;
            linkname=rootpath+linkname.replace(/\s/g,"_");
            
            content927 = '<div class="hood-tag" onClick=document.location.href="'+linkname+'";><nobr>'+sho.reduce(24,"&hellip;")+'</nobr></div>';

            label927 = new TLabel();
            label927.id = 'label'+i;
            label927.anchorLatLng = point;
            
            label927.anchorPoint = 'bottomRight';
            label927.content = content927;
            label927.percentOpacity = 100;
            labels.push(label927);
            map.addTLabel(labels[i]);
          }
        }
      }
      request.send(null);
}

