jcycle help

jcycle help

hi i'm using the jquery cycle plugin.. here's my code http://pastie.org/440344. What I wanted to do is everytime the image changes, the corresponding "a" gets the class "selected". I currently done it with the code provided above although I'm not quite sure if that's the best approach.. Thanks!