Hi, Im trying to add a 5 star rating system to me site, I have images (1 star, 2star....)

what im trying to do is if the click the 2nd star then the 2 star image appears , and if they click the 4th star a 4 star image appears simular to this - http://en.fotolia.com/id/15678596

What script will I need to add, and if this will be in a form, is it possible for me to be able to know what star rating they have given?