Ab initio study of the magnetic behavior of metal hydrides : a comparison with the slater-pauling curve