docs: function(path, toRel) {
  			var i;
  			var segList = path.pathSegList;
  			var len = segList.numberOfItems;
  			var curx = 0, cury = 0;
  			var d = "";
  			var last_m = null;
  			
  			for (i = 0; i < len; ++i) {
  				var seg = segList.getItem(i);
  				// if these properties are not in the segment, set them to zero
  				var x = seg.x || 0,
  					y = seg.y || 0,
  					x1 = seg.x1 || 0,
  					y1 = seg.y1 || 0,
  					x2 = seg.x2 || 0,
  					y2 = seg.y2 || 0;
  	
  				var type = seg.pathSegType;
  				var letter = pathMap[type]['to'+(toRel?'Lower':'Upper')+'Case']();
  				
  				var addToD = function(pnts, more, last) {
  					var str = '';
  					more = more ? ' ' + more.join(' ') : '';
  					last = last ? ' ' + svgedit.units.shortFloat(last) : '';
  					$.each(pnts, function(i, pnt) {
  						pnts[i] = svgedit.units.shortFloat(pnt);
  					});
  					d += letter + pnts.join(' ') + more + last;
  				};
  				
  				switch (type) {
  					case 1: // z,Z closepath (Z/z)
  						d += "z";
  						break;
  					case 12: // absolute horizontal line (H)
  						x -= curx;
  					case 13: // relative horizontal line (h)
  						if (toRel) {
  							curx += x;
  							letter = 'l';
  						} else {
  							x += curx;
  							curx = x;
  							letter = 'L';
  						}
  						// Convert to "line" for easier editing
  						addToD([[x, cury]]);
  						break;
  					case 14: // absolute vertical line (V)
  						y -= cury;
  					case 15: // relative vertical line (v)
  						if (toRel) {
  							cury += y;
  							letter = 'l';
  						} else {
  							y += cury;
  							cury = y;
  							letter = 'L';
  						}
  						// Convert to "line" for easier editing
  						addToD([[curx, y]]);
  						break;
  					case 2: // absolute move (M)
  					case 4: // absolute line (L)
  					case 18: // absolute smooth quad (T)
  						x -= curx;
  						y -= cury;
  					case 5: // relative line (l)
  					case 3: // relative move (m)
  						// If the last segment was a "z", this must be relative to 
  						if (last_m && segList.getItem(i-1).pathSegType === 1 && !toRel) {
  							curx = last_m[0];
  							cury = last_m[1];
  						}
  					
  					case 19: // relative smooth quad (t)
  						if (toRel) {
  							curx += x;
  							cury += y;
  						} else {
  							x += curx;
  							y += cury;
  							curx = x;
  							cury = y;
  						}
  						if (type === 3) {last_m = [curx, cury];}
  						
  						addToD([[x, y]]);
  						break;
  					case 6: // absolute cubic (C)
  						x -= curx; x1 -= curx; x2 -= curx;
  						y -= cury; y1 -= cury; y2 -= cury;
  					case 7: // relative cubic (c)
  						if (toRel) {
  							curx += x;
  							cury += y;
  						} else {
  							x += curx; x1 += curx; x2 += curx;
  							y += cury; y1 += cury; y2 += cury;
  							curx = x;
  							cury = y;
  						}
  						addToD([[x1, y1], [x2, y2], [x, y]]);
  						break;
  					case 8: // absolute quad (Q)
  						x -= curx; x1 -= curx;
  						y -= cury; y1 -= cury;
  					case 9: // relative quad (q) 
  						if (toRel) {
  							curx += x;
  							cury += y;
  						} else {
  							x += curx; x1 += curx;
  							y += cury; y1 += cury;
  							curx = x;
  							cury = y;
  						}
  						addToD([[x1, y1],[x, y]]);
  						break;
  					case 10: // absolute elliptical arc (A)
  						x -= curx;
  						y -= cury;
  					case 11: // relative elliptical arc (a)
  						if (toRel) {
  							curx += x;
  							cury += y;
  						} else {
  							x += curx;
  							y += cury;
  							curx = x;
  							cury = y;
  						}
  						addToD([[seg.r1, seg.r2]], [
  								seg.angle,
  								(seg.largeArcFlag ? 1 : 0),
  								(seg.sweepFlag ? 1 : 0)
  							], [x, y]
  						);
  						break;
  					case 16: // absolute smooth cubic (S)
  						x -= curx; x2 -= curx;
  						y -= cury; y2 -= cury;
  					case 17: // relative smooth cubic (s)
  						if (toRel) {
  							curx += x;
  							cury += y;
  						} else {
  							x += curx; x2 += curx;
  							y += cury; y2 += cury;
  							curx = x;
  							cury = y;
  						}
  						addToD([[x2, y2],[x, y]]);
  						break;
  				} // switch on path segment type
  			} // for each segment
  			return d;
  		}