function segmentVisitor(strSegment)
{
	// strSegment is either 'No Action', 'Lead' or 'Conversion'
    var strCookieValue = readCookie("__utmv"); // GA cookie that stores custom visitor segment
	//document.getElementById("divvar").innerHTML = strCookieValue;
	switch (strSegment)
	{
	case 'Lead':
		// Highest level - write cookie if segment is a lesser segment than Conversion - if same, restarts cookie expiry 
	  if (strCookieValue.indexOf('Conversion') == -1 ) firstTracker._setVar(strSegment);
	  break;
	case 'Conversion':
		// Highest level - write cookie no matter what - if same, restarts cookie expiry 
	  firstTracker._setVar(strSegment);
	  break;
	case 'No Action':
	  //if (strCookieValue.indexOf('No Action') > -1 ) firstTracker._setVar(strSegment); // re start cookie
	}
}

function readCookie(strName)
{
  var cookieValue = "";
  var strSearch = strName + "=";
  var strCookie = document.cookie;
  if(strCookie.length > 0)
  { 
    intOffset = strCookie.indexOf(strSearch);
    if (intOffset != -1)
    { 
      intOffset += strSearch.length;
      intEnd = strCookie.indexOf(";", intOffset);
      if (intEnd == -1) intEnd = strCookie.length;
      cookieValue = unescape(strCookie.substring(intOffset, intEnd))
    }
  }
  return cookieValue;
}
