  This paper is an expanded and updated version of the preprint
arXiv:math/0406499. It includes a more detailed description of the basics of
the theory of Cherednik and Hecke algebras of varieties started in
arXiv:math/0406499, as well as a new Section 4, which reviews the developments
in this theory since 2004 with references to the relevant literature.
  Let $G$ be a finite group of linear transformations of a finite dimensional
complex vector space $V$. To this data one can attach a family of algebras
$H_{t,c}(V,G)$, parametrized by complex numbers $t$ and conjugation invariant
functions $c$ on the set of complex reflections in $G$, which are called
rational Cherednik algebras. These algebras have been studied for over 15 years
and revealed a rich structure and deep connections with algebraic geometry,
representation theory, and combinatorics. In this paper, we define global
analogs of Cherednik algebras, attached to any smooth algebraic or analytic
variety $X$ with a finite group $G$ of automorphisms. We show that many
interesting properties of Cherednik algebras (such as the PBW theorem,
universal deformation property, relation to Calogero-Moser spaces, action on
quasiinvariants) still hold in the global case, and give several interesting
examples. Then we define the KZ functor for global Cherednik algebras, and use
it to define (in the case $\pi_2(X)\otimes \Bbb Q=0$) a flat deformation of the
orbifold fundamental group of the orbifold $X/G$, which we call the Hecke
algebra of $X/G$. This includes usual, affine, and double affine Hecke algebras
for Weyl groups, Hecke algebras of complex reflection groups, as well as many
new examples.
