docs: function(element) {
  		var i, points = element.points;
  		var N = points.numberOfItems;
  		if (N >= 4) {
  			// loop through every 3 points and convert to a cubic bezier curve segment
  			// 
  			// NOTE: this is cheating, it means that every 3 points has the potential to 
  			// be a corner instead of treating each point in an equal manner. In general,
  			// this technique does not look that good.
  			// 
  			// I am open to better ideas!
  			// 
  			// Reading:
  			// - http://www.efg2.com/Lab/Graphics/Jean-YvesQueinecBezierCurves.htm
  			// - http://www.codeproject.com/KB/graphics/BezierSpline.aspx?msg=2956963
  			// - http://www.ian-ko.com/ET_GeoWizards/UserGuide/smooth.htm
  			// - http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html
  			var curpos = points.getItem(0), prevCtlPt = null;
  			var d = [];
  			d.push(["M", curpos.x, ",", curpos.y, " C"].join(""));
  			for (i = 1; i <= (N-4); i += 3) {
  				var ct1 = points.getItem(i);
  				var ct2 = points.getItem(i+1);
  				var end = points.getItem(i+2);
  				
  				// if the previous segment had a control point, we want to smooth out
  				// the control points on both sides
  				if (prevCtlPt) {
  					var newpts = svgedit.path.smoothControlPoints( prevCtlPt, ct1, curpos );
  					if (newpts && newpts.length == 2) {
  						var prevArr = d[d.length-1].split(',');
  						prevArr[2] = newpts[0].x;
  						prevArr[3] = newpts[0].y;
  						d[d.length-1] = prevArr.join(',');
  						ct1 = newpts[1];
  					}
  				}
  				
  				d.push([ct1.x, ct1.y, ct2.x, ct2.y, end.x, end.y].join(','));
  				
  				curpos = end;
  				prevCtlPt = ct2;
  			}
  			// handle remaining line segments
  			d.push("L");
  			while (i < N) {
  				var pt = points.getItem(i);
  				d.push([pt.x, pt.y].join(","));
  				i++;
  			}
  			d = d.join(" ");
  
  			// create new path element
  			element = addSvgElementFromJson({
  				"element": "path",
  				"curStyles": true,
  				"attr": {
  					"id": getId(),
  					"d": d,
  					"fill": "none"
  				}
  			});
  			// No need to call "changed", as this is already done under mouseUp
  		}
  		return element;
  	}