function save, addSubNote, removeSubNote de document