  We present a construction, which assigns two groupoids, $\Gugamma$ and
$\Gmgamma$, to an inverse semigroup $\Gamma$. By definition, $\Gmgamma$ is a
subgroupoid (even a reduction) of $\Gugamma$.
  The construction unifies known constructions for groupoids. More precisely,
the groupoid $\Gugamma$ is shown to be isomorphic to the universal groupoid of
$\Gamma$ introduced by Paterson. For $\Gamma$ arising from graphs resp.
tilings, the groupoid $\Gmgamma$ is the graph groupoid introduced by Kumjian et
al. resp. the tiling groupoid introduced by Kellendonk.
  We obtain a characterisation of open invariant sets in $\Gmgamma^{(0)}$ in
terms of certain order ideals of $\Gammanull$ for a large class of $\Gamma$
(including those arising from graphs and from tilings). If $\Gmgamma$ is
essentially principal this gives a characterization of the ideal structure of
$\Cred(\Gmgamma)$ by a theory of Renault. In particular, we then obtain
necessary and sufficient conditions on $\Gamma$ for simplicity of
$\Cred(\Gmgamma)$.
  Our approach relies on a detailed analysis of the order structure of
$\Gamma$.
