code: function relativeURI(uri, base) {
      
      // reduce base and uri strings to just their difference string
      var baseParts = base.split('/');
      baseParts.pop();
      base = baseParts.join('/') + '/';
      i = 0;
      while (base.substr(i, 1) == uri.substr(i, 1))
        i++;
      while (base.substr(i, 1) != '/')
        i--;
      base = base.substr(i + 1);
      uri = uri.substr(i + 1);
  
      // each base folder difference is thus a backtrack
      baseParts = base.split('/');
      var uriParts = uri.split('/');
      out = '';
      while (baseParts.shift())
        out += '../';
      
      // finally add uri parts
      while (curPart = uriParts.shift())
        out += curPart + '/';
      
      return out.substr(0, out.length - 1);
    }
docs: given an absolute URI, calculate the relative URI