Maslov index for homoclinic orbits of hamiltonian systems