Let S be a topological semigroup acting on a topological space X. We
develop the theory of (weakly) almost periodic functions on X, with respect
to S, and form the (weakly) almost periodic compactifications of X and S,
with respect to each other. We then consider the notion of an action of Son a
Banach space, and on its dual, and after defining S-invariant means for such a
space, we give a result concerning the existence of such means, and apply it to
prove the existence of a G-invariant mean on the space of weakly almost
periodic functions defined on a topological space on which a topological
group G acts.