Synthesis and characterization of ruthenium and rhenium dyes with phosphonate anchoring groups.