function click(feature,url)
{
	var sendstring = 'id=' + feature + '&url=' + url;
	var path = getPrefix() + '/featureclick.action';
	sendRequest(path,sendstring);
}

function getPrefix()
{
	var path = window.location.pathname;
	var pathArray = path.split('/');
	if(pathArray[1]=='mindbodygreen')
		return '/mindbodygreen';
	else
		return '';

}

function sendRequest(page,args)
{
	var req = newXMLHttpRequest();
	var handlerFunction = getReadyStateHandler(req, responseHandler);
	req.onreadystatechange = handlerFunction;
	req.open("POST", page, true);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	req.send(args);
}

function newXMLHttpRequest() 
{
  var xmlreq = false;
  if (window.XMLHttpRequest) 
  {
    xmlreq = new XMLHttpRequest();
  } 
  else if (window.ActiveXObject) 
  {
    try 
    {
      xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e1) 
    {
      try 
      {
        xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (e2) 
      {
        // Unable to create an XMLHttpRequest with ActiveX
      }
    }
  }
  return xmlreq;
}

function getReadyStateHandler(req, responseXmlHandler) {

  return function () 
  {
    if (req.readyState == 4) 
    {
      if (req.status == 200) 
      {
        responseXmlHandler(req.responseText);
      } 
      else 
      {
        //alert("HTTP error: "+req.status);
      }
    }
  }
}

function responseHandler(response)
{

}
