// objectReference must be a relative path: e.g "test.pdf" or "downloads/test.pdf".
// A path outside the current directory is NOT allowed: e.g. "../download/test.pdf".
function trackRelative(objectReference,objectTitle){
  path = getFolder() + objectReference;
  dcsMultiTrack('DCS.dcsuri',path,'WT.ti',objectTitle);
  if (DCS.dcsref) {
    DCS.dcsref = self.location.href.substring(0,self.location.href.indexOf(self.location.pathname)) + DCS.dcsuri;
  }
}

// objectReference must be an absolute path starting from the web root directory: e.g "/com/en/downloads/test.pdf".
// The path must begin with a slash: e.g. "/".
function trackAbsolute(objectReference,objectTitle){
  path = objectReference;
  dcsMultiTrack('DCS.dcsuri',path,'WT.ti',objectTitle);
  if (DCS.dcsref) {
    DCS.dcsref = self.location.href.substring(0,self.location.href.indexOf(self.location.pathname)) + DCS.dcsuri;
  }
}

// objectReference must be a URL to an external website that is not part of your website tracking: e.g "www.microsoft.com".
// The URL protocol, e.g. "http://", is NOT allowed as part of the reference.
function trackExternal(objectReference,objectTitle){
  path = "/external/" + objectReference;
  dcsMultiTrack('DCS.dcsuri',path,'WT.ti',objectTitle);
  if (DCS.dcsref) {
    DCS.dcsref = self.location.href.substring(0,self.location.href.indexOf(self.location.pathname)) + DCS.dcsuri;
  }
}

// Returns the page path starting from the web root directory.
function getFolder(){
  return thisFolder = self.location.pathname.substring(0,self.location.pathname.lastIndexOf('/')+1);
}
