Variation of Adatom Valence-Level Positions With the Distance to a Metal Surface