docs: function joinPath()
  	{
  		var parts = Array.prototype.slice.call(arguments, 0);
  		if (parts[0] instanceof Array)
  			parts = parts[0];
  
  		// Strip off all parts before the first part with a root prefix.
  		var i = parts.length,
  			rootPrefix;
  
  		while (i--) if (isAbsPath(parts[i]))
  		{
  			// If the path is absolute, then save the root prefix so that it doesn't get
  			// removed by a .. part.
  			parts = parts.slice(i);
  			rootPrefix = parts[0].match(/^([a-z]:|)[\/\\]/i)[1] + '/';
  			parts[0] = parts[0].slice(rootPrefix.length);
  			break;
  		}
  
  		parts = parts.join('/').split(/[\/\\]+/).reverse();
  
  		i = parts.length;
  
  		while (i--)
  		{
  			switch (parts[i])
  			{
  				case '':
  					if (i !== 0)
  						parts.splice(i, 1);
  					break;
  				case '.':
  					if (i !== 0)
  						parts.splice(i, 1);
  					else
  						parts[i] = '';
  					break;
  				case '..':
  					// Only strip off leading .. parts if the path is absolute.
  					if (rootPrefix || parts[i+1] !== '..')
  						parts.splice(i, 2);
  					break;
  			}
  		}
  
  		parts = parts.reverse();
  
  		// If there's a prefix, add it back in.
  		if (rootPrefix)
  			return rootPrefix + parts.join('/');
  		else
  			return parts.join('/');
  	}